3

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
Ravi Kumar
  • 993
  • 1
  • 12
  • 37

1 Answers1

0

Yes, there is. Assuming you are using simply OWL you can model it in Protege like this:

  • Create an object property R_Man
  • Go to class Man. Section EquivalentTo add:

    R_Man some Self

  • Go to the property hasSon. Section SuperPropertyOf (Chain), add:

    hasChild o R_Man

Unfortunately, this will give you a Cyclic Dependency error. I know it is not ideal, but if you define hasSon and hasDaughter not to be subproperties of hasChild, it will give you the expected result.

user1156544
  • 1,725
  • 2
  • 25
  • 51