While you don't have to create a new class, you still CAN do so by giving some semantic constraints. So, going with your example of my:Person being a subclass of foaf:Person, let's say that you want each instance of my:Person to have a property my:hasFather with both (local) domain and range being my:Person. By "local", I mean that the range (and likewise the domain) is not a global feature of the property my:hasFather (something that you would express by an rdfs:range axiom), but it will only be inferrable for instances of class my:Person - the property my:hasFather may alternatively be used for things outside the class my:Person (such as animals), in which case the range of the property will be undetermined, unless specified elsewhere. You can get this behavior by the following subclass axioms:
(1)
# every my:Person is a foaf:Person
my:Person rdfs:subClassOf foaf:Person .
# every my:Person has exactly one father
# (not what you were asking for, but it makes some sense)
my:Person rdfs:subClassOf [
owl:onProperty my:hasFather ;
owl:cardinality "1"^^xsd:nonNegativeInteger ] .
# local range of my:hasFather:
# the father of a my:Person is himself a my:Person
my:Person rdfs:subClassOf [
owl:onProperty my:hasFather ;
owl:allValuesFrom my:Person ] .
# local domain (what you were asking for!):
# expressed by inverse property!
my:Person rdfs:subClassOf [
owl:onProperty [ owl:inverseOf my:hasFather ] ;
owl:allValuesFrom my:Person ] .
So, say you have within your data the triple
(2) my:alfred my:hasFather my:bob .
you will not immediately learn that my:alfred or my:bob are instances of my:Person. However, if you have the additional triple
(3a) my:alfred rdf:type my:Person .
then you will learn that my:bob is also a my:Person, as this is the local range of my:hasFather with regard to class my:Person. And, likewise, if you have the additional triple
(3b) my:bob rdf:type my:Person .
then you will learn that my:alfred is also a my:Person, as this is the local domain of my:hasFather with regard to class my:Person.
Things you should avoid:
-
Although quite obvious, it should be stated anyways: Do not make class foaf:Person a subclass of any of the given restriction class expressions (neither the owl:cardinality nor the owl:allValuesFrom expressions), as this would change the intended meaning of class foaf:Person: Suddenly, every foaf:Person will have some my:hasFather relationship!
-
Less obvious: Also do not make those restriction class expressions subclasses of foaf:Person, with the idea to have them "in the middle" between foaf:Person and my:Person, as this would have the semantic side effect that every individual that can be inferred to have either exactly one or zero(!) properties my:hasFather will become a foaf:Person.
answered
09 Jan '12, 10:08
Michael Schn... ♦
5.6k●1●6●11
accept rate:
31%