I have been creating a toy ontology to further learn the Top Braid Composer tool when I hit an OWL modeling question. I figured out using restriction classes how to say when a Person is a Nephew. In the ontology below you can see a hasBrother property, which links a Parent instance to a Brother instance. hasBrother links a Person to a Brother. Tim hasParent Betty, and Betty hasBrother Lloyd. So, my restriction classes let me determine a Nephew from the hasParent and hasBrother links I just mention, so that when I run SPIN I can tell Tim is type Nephew. But I can't figure out how to state the inverse, and figure out that Lloyd is type Uncle. If you look at my Uncle class it is merely a subClass of Person at the moment.

  # baseURI: file:///SpinTest/spintest.owl
  # imports: http://spinrdf.org/spin

  @prefix :        <http://www.yarcdata.com/ontologies/SpinTest#> .
  @prefix owl:     <http://www.w3.org/2002/07/owl#> .
  @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
  @prefix spin:    <http://spinrdf.org/spin#> .
  @prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

  <file:///SpinTest/spintest.owl>
        rdf:type owl:Ontology ;
        spin:imports <http://topbraid.org/spin/owlrl-all> ;
        owl:imports <http://spinrdf.org/spin> .

  :Betty
        rdf:type _:b2 , _:b3 , :Parent ;
        :hasBrother :Lloyd .

  :Brother
        rdf:type owl:Class ;
        rdfs:subClassOf :Sibling .

  :Lloyd
        rdf:type :Brother .

  :Nephew
        rdf:type owl:Class ;
        rdfs:subClassOf :Person ;
        owl:equivalentClass _:b4 .

  :Parent
        rdf:type owl:Class ;
        rdfs:subClassOf :Person .

  :Person
        rdf:type owl:Class ;
        rdfs:subClassOf owl:Thing .

  :Sibling
        rdf:type owl:Class ;
        rdfs:subClassOf :Person .

  :Tim  rdf:type _:b4 , _:b5 , :Nephew , :Person ;
        :hasParent :Betty .

  :Uncle
        rdf:type owl:Class ;
        rdfs:subClassOf :Person .

  :hasBrother
        rdf:type rdf:Property ;
        rdfs:domain :Person ;
        rdfs:range :Brother .

  :hasParent
        rdf:type rdf:Property ;
        rdfs:domain :Person ;
        rdfs:range :Parent .

  :hasUncle
        rdf:type rdf:Property ;
        rdfs:domain :Person ;
        rdfs:range :Uncle .

  _:b4  rdf:type owl:Class ;
        owl:equivalentClass :Nephew ;
        owl:intersectionOf (:Person _:b5) .

  _:b5  rdf:type owl:Restriction ;
        owl:onProperty :hasParent ;
        owl:someValuesFrom _:b3 .

  _:b3  rdf:type owl:Class ;
        owl:intersectionOf (:Person _:b2) .

  _:b2  rdf:type owl:Restriction ;
        owl:onProperty :hasBrother ;
        owl:someValuesFrom :Brother .

asked 08 Jan '13, 19:10

harschware's gravatar image

harschware ♦
7.7k1616
accept rate: 20%

edited 09 Jan '13, 12:16

Not all of your ontology is relevant here. Could you please summarise it, removing all the stuff about activities and adventures?

(09 Jan '13, 01:34) Antoine Zimm... ♦ Antoine%20Zimmermann's gravatar image

Done. Also removed some extraneous assertions from running OWL-RL on an intial incarnation of the ontology.

(09 Jan '13, 12:17) harschware ♦ harschware's gravatar image

Just do the same as for nephew, with the inverse properties. For nephew, you should have:

:Nephew  owl:equivalentClass  [
    owl:onProperty  :hasParent;
    owl:someValuesFrom  [
       owl:onProperty  :hasBrother;  # It should be sibling in fact
       owl:someValuesFrom  :Person
    ] .

It should be said that a nephew is male, but anyway. So for uncle:

:Uncle  owl:equivalentClass  [
    owl:onProperty  [ owl:inverseOf :hasBrother ];  # or :hasBrother if it's asserted to be symmetric
    owl:someValuesFrom  [
       owl:onProperty  [ owl:inverseOf :hasParent ]; # or :hasChild if it's defined
       owl:someValuesFrom  :Person
    ] .

But better in my opinion is to use property chains:

:hasUncle  owl:inverseOf  :hasNephew;   # disregarding gender issues
    owl:propertyChainAxiom ( :hasParent :hasBrother ) .

Still, you should do something about gender or use something neutral, like :hasUncleOrAunt, :hasNephewOrNiece, etc. Anyway, family relations are complicated ;)

permanent link

answered 09 Jan '13, 01:32

Antoine%20Zimmermann's gravatar image

Antoine Zimm... ♦
10.5k514
accept rate: 33%

edited 09 Jan '13, 01:36

In some families more than others... ;-) Hey thanks, the trick I wasn't able to envision was stating the inverse in that way. I wasn't thinking I could state the inverse without actually creating a named inverse in the model first. I actually left out gender issues on purpose because I was trying to create the issue in the model. BTW I went searching for a gender neutral form of the words nephew or niece, and someone had suggested "nibling" and "auncle" for the aunt/uncle problem. I don't know if it really solves the problem, but its kinda funny.

(09 Jan '13, 12:13) harschware ♦ harschware's gravatar image

Nits: Your restriction class examples are missing "a owl:Restriction" and closing bracket in both cases.

(10 Jan '13, 18:26) harschware ♦ harschware's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×632
×78

question asked: 08 Jan '13, 19:10

question was seen: 981 times

last updated: 10 Jan '13, 18:26