Question

I need to infer that one individual is the brother of other one if they have the same father.

So, if I have this:

Bart hasFather Homer.

Lisa hasFather Homer.

Because Bart and Lisa have the same father, I would like to infer:

Lisa hasBrother Bart.

Is there any method to do that using any property characteristics?

Was it helpful?

Solution

Use Property Chains and Rolification

Antoine Zimmermann's answer is a very good start to this problem, and touches on the major point that you need to solve this sort of task:

From x to each of x's brothers, there is a path of the form hasFather o hasFather-1.

Now, that's actually not true of just brothers, though. That's true for all siblings and for x itself. This means you'll have the following definition of hasSibling:

hasSibling ≡ hasFather o hasFather-1

(Actually, that's really just hasPaternalSibling; a more refined definition would use hasParent.) Now, using this, you could ask for brothers, which are simply siblings who are men, of x with a query like:

(hasSibling value x) and Man

However, it would be nice to define a proper hasBrother property. You could do this with a property chain and hasSibling if you had a special property that linked each Man to himself, and only linked males to themselves:

hasBrother ≡ hasSibling o specialProperty

In fact, such a property is what we get from a technique called rolification, which has been described more in a question, OWL 2 rolification, and its answer. The idea is that for the class Man, we create a new property rMan and add the equivalence:

Man ≡ rMan some Self

which says that each Man is related to himself by the rMan property, and that only instances of Man are so connected. This is exactly the property that we need as specialProperty above. Thus, we end up with the following definitions of Man, hasSibling, and hasBrother:

definition of Man definition of hasSibling definition of hasBrother

Now we can ask for the brothers of x with a query like:

hasBrother-1 value x

For instance, we can ask for Greg's siblings, and get Peter, Greg (himself), and Bobby.

example of query

Sample Ontology

Here's that ontology in Turtle:

@prefix :      <http://www.example.org/brady#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix brady: <http://www.example.org/brady#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

brady:hasSibling  a             owl:ObjectProperty ;
        owl:propertyChainAxiom  ( brady:hasFather [ owl:inverseOf
                          brady:hasFather ] ) .

brady:Carol  a  owl:NamedIndividual , brady:Woman .

brady:hasBrother  a             owl:ObjectProperty ;
        owl:propertyChainAxiom  ( brady:hasSibling brady:r_Man ) .

<http://www.example.org/brady>
        a       owl:Ontology .

brady:Woman  a               owl:Class ;
        rdfs:subClassOf      brady:Person ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  brady:r_Woman
                             ] .

brady:hasFather  a  owl:ObjectProperty .

brady:Person  a  owl:Class .

brady:Man  a                 owl:Class ;
        rdfs:subClassOf      brady:Person ;
        owl:equivalentClass  [ a               owl:Restriction ;
                               owl:hasSelf     true ;
                               owl:onProperty  brady:r_Man
                             ] .

brady:r_Woman  a  owl:ObjectProperty .

brady:r_Man  a  owl:ObjectProperty .

brady:Marcia  a          owl:NamedIndividual , brady:Woman ;
        brady:hasFather  brady:Mike .

brady:Peter  a           owl:NamedIndividual , brady:Man ;
        brady:hasFather  brady:Mike .

brady:Jan  a             owl:NamedIndividual , brady:Woman ;
        brady:hasFather  brady:Mike .

brady:Cindy  a           owl:NamedIndividual , brady:Woman ;
        brady:hasFather  brady:Mike .

brady:Bobby  a           owl:NamedIndividual , brady:Man ;
        brady:hasFather  brady:Mike .

brady:Greg  a            owl:NamedIndividual , brady:Man ;
        brady:hasFather  brady:Mike .

brady:Mike  a   owl:NamedIndividual , brady:Man .

OTHER TIPS

Assuming that everyone is their own brother, and that sisters are brothers too:

:hasBrother  owl:propertyChainAxiom  (:hasFather [ owl:inverseOf :hasFather ]) .

It is hardly possible to define :hasBrother more precisely, excluding female brothers and self-brotherhood. But you can infer all the brothers of Lisa as follows:

:Female  a  owl:Class .
:Male  a  owl:Class;
  owl:disjointWith  :Female .
:Lisa  a  :Female .
:Bart  a  :Male .
:Homer a  :Male .
:hasFather  a  owl:ObjectProperty;
  rdfs:range  :Male .
:hasBrother a  owl:ObjectProperty;
  rdfs:range  :Male .
:hasSiblingOrSelf  owl:propertyChainAxiom  ( :hasFather [ :hasFather ] ) .
:LisaBrother  owl:equivalentClass  [
    a  owl:Restriction;
    owl:onProperty  [ owl:inverseOf  :hasBrother ];
    owl:hasValue  :Lisa
  ], [
    a  owl:Class;
    owl:intersectionOf  (
      [ a owl:Restriction; owl:onProperty :hasSiblingOrSelf; owl:hasValue :Lisa ]
      :Male
    )
  ] .

One way to this is by using SWRL rules.

On protege:

  1. go to Window
  2. Click on Tabs
  3. Click on Swrl Tab
  4. Press the "new" button and write the following rule

Write rule:

isChildOf(?x,?y)^FatherOf(?y,?z)^differentFrom(?z,?x)->isBrotherOf(?x,?z)

This means that if "x is a child of y", and "y is also a parent of z" and "z and x are different" then "z and x are Brothers".

A brother is a male sibling. Consequently, we should define both 'male' and being a sibling. But since a sibling is itself a non-identical child of the same parents, one should also define being a child. For simplicity, we'll treat half-siblings as siblings, restrict the domain to humans, and leave the explicit definition of related concepts like motherhood and fatherhood aside.

1 Define Man

  1. Create a Human class
  2. Create a Gender class disjoint with the Human class. Create male and female as individuals instantiating the Gender type (there are other ways to do this, but this is a pretty simple one).
  3. Create a hasGender Object property, with Human as domain and Gender for its range
  4. Create a Man class as a subclass of Human. Make it equivalent to Human and (hasGender value male).

2 Define child

  1. Create an isChildOf Object property with Human for both its domain and range (Optional: Define a Child class as a subtype of human equivalent to isChildOf some Human. In similar fashion, you can also create object properties, then classes for Mother, Parent, Daughter, etc).

3 Define sibling with help from SWRL

  1. First, create an irreflexive, symmetric isSiblingOf object property in Protege with Human for its domain and range.
  2. In the menu bar at the top of Protege, ensure Window -> tabs -> SWRLTab is checked and then find and click on the SWRLTab tab.
  3. Click new to create a new rule, and add the rule: isChildOf(?sibling1, ?parent) ^ isChildOf(?sibling2, ?parent) ^ differentFrom(?sibling1, ?sibling2) -> isSiblingOf(?sibling1, ?sibling2) You may also want to add rules for what you want to be able to infer from the siblinghood relation, e.g isSiblingOf(?x, ?y) ^ isChildOf(?x, z?) -> isChildOf(?y, ?z)

4 Define being a brother of

  1. Create an isBrotherOf Object property in Protege with domain Man and range Human
  2. On the SWRLTab, add the following rules: Man(?x) ^ isSiblingOf(?x, ?y) -> isBrotherOf(?x, ?y)

isBrotherOf(?x, ?y) -> Man(?x)

isBrotherOf(?x, ?y) -> isSiblingOf(?x, ?y)

The first rule states that any male sibling is a brother. The second and third infer maleness and siblinghood from brotherhood.

  1. Optionally create a Brother class equivalent to isBrotherOf some Human to complete the rollification process.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top