Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, you have something like the following in your data:</p> <pre><code>:x :parentOf :y . :x :gender "male" . </code></pre> <p>and you would like to infer that:</p> <pre><code>:x :fatherOf :y . </code></pre> <p>I'm afraid you cannot do this in OWL. For cases like this one, you may want to rely on a rule language like SWRL, SPIN, etc. However, for the particular case of father, mother, etc, you could do the following:</p> <ul> <li>define <code>:hasParent</code> as the inverse of <code>:parentOf</code>;</li> <li>restrict the cardinality of <code>:hasParent</code> to 2;</li> <li>define <code>:hasFather</code> as the inverse of <code>:fatherOf</code>;</li> <li>make <code>:hasFather</code> a <code>owl:FunctionalProperty</code>;</li> <li>define <code>:hasMother</code> as the inverse of <code>:motherOf</code>;</li> <li>make <code>:hasMother</code> a <code>owl:FunctionalProperty</code>;</li> <li>define the class <code>:Man</code> of male people;</li> <li>define the class <code>:Woman</code> of female people;</li> <li>make <code>:Man</code> disjointWith <code>:Woman</code>;</li> <li>set the range of <code>:hasFather</code> to <code>:Man</code>;</li> <li>set the range of <code>:hasMother</code> to <code>:Woman</code>.</li> </ul> <p>So the ontology looks like this (in Turtle because I'm not familiar with OWL/XML):</p> <pre><code>:Person a owl:Class; rdfs:subClassOf [ a owl:Restriction; owl:onProperty :hasParent; owl:cardinality 2 ] . :Man a owl:Class; owl:equivalentclass [ a owl:Class; owl:intersectionOf ( :Person [ a owl:Restriction; owl:onProperty :gender; owl:hasValue "male"; ] ) ] . :Woman a owl:Class; owl:equivalentclass [ a owl:Class; owl:intersectionOf ( :Person [ a owl:Restriction; owl:onProperty :gender; owl:hasValue "female"; ] ) ] . :gender a owl:DatatypeProperty, owl:FunctionalProperty . :hasParent a owl:ObjectProperty; owl:inverseOf :parentOf; rdfs:domain :Person; rdfs:range :Person . :hasFather a owl:ObjectProperty, owl:FunctionalProperty; rdfs:subPropertyOf :hasParent; rdfs:range :Man . :hasMother a owl:ObjectProperty, owl:FunctionalProperty; rdfs:subPropertyOf :hasParent; rdfs:range :Woman . </code></pre> <p>This should do the trick, but it's a very complicated ontology and reasoning with it may be very slow.</p> <p><strong>Edit:</strong> I added that <code>:gender</code> must be functional, otherwise there could be a mother who is at the same time a father and that would not work!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload