I have created an ontology using Protege.
Classes -
Person
Man
Woman
Properties(Domain / Range)
Knows(Person / Person)
hasRelationShip(Person / Person)
hasParent(Person / Person)
hasFather(Person / Man)
hasMother(Person / Woman)
hasChild(Person / Person)
hasSon(Person / Man)
hasDaughter(Person / Woman)
Now I imported this ontology in jena fuseki. which is configured with OWLMiniFBRuleReasoner and then created some instance.
I have following instance tripple
:Ravi rdf:type :Man .
:Anjani rdf:type :Man .
:Indra rdf:type :Woman .
:Ravi :hasFather :Anjani .
:Ravi :hasMother :Indra .
Now if i query
SELECT DISTINCT ?a ?b WHERE {
?a :hasParent ?b
}
I get result
:Ravi - :Anjani
:Ravi - :Indra
If I query -
SELECT DISTINCT ?a ?b WHERE {
?a :hasChild ?b
}
I get result -
:Indra - :Ravi
:Anjani - :Ravi
But if query -
SELECT DISTINCT ?a ?b WHERE {
?a :hasSon ?b
}
I don't get any result for obvious reason.
So the question is, is there a way to tell reasoner -
If (?a :hasChild ?b) and (?b rdf:type :Man)
Then ?a :hasSon ?b