Search code examples
semanticsowlrdfs

owl:allValuesFrom and rdfs:range difference


I'm working on semantic webs and I'm wondering: is there any difference in a semanitc of writing a restriction like:

:Person
  a owl:Class ;
  rdfs:subClassOf
    [ a owl:Restriction ;
      owl:onProperty :hasParent ;
      owl:allValuesFrom :Person
   ] .

and writing a range restriction like:

:hasParent rdfs:range :Person.

It seems to me that it means the same: a parent has to have a type of Person. Isn't there any difference?


Solution

  • The first snippet means that a :Person who has a parent necessarily have a :Person-parent. However, a :Dog may have a parent who is not a :Person, for instance. The second snippet says that anything who has a parent necessarily has a :Person-parent, regardless of what this thing is.

    Edit after krajol's comment:

    The allValuesFrom restriction of the first snippet is not equivalent to:

    :hasParent  rdfs:domain  :Person;
                rdfs:range   :Person .
    

    In the case of the allValuesFrom restriction, it is still possible that there are parents that are not persons. In the case of the rdfs:domain/rdfs:range combination, it is not possible. With allValuesFrom restrictions, it's possible to say that persons have person-parents and that dogs have dog-parents, etc. With domain/range, you cannot.