As we read and write N3, communicating in RDF, we need to share an
understanding of what each URI means. We often pick URIs which offer
clues about meaning, such as
http://www.w3.org/2000/10/swap/test/demo1/biology#Dog
,
but the text of the URI still gives only a clue. Would a wolf qualify
as a one of these? How about a Dingo? We can't tell just by looking
at the name. It's even possible the URI text is misleading, and the
intended meaning has nothing to do with dogs.
A good technique for addressing these issues is to publish a document which carefully describes the intended meaning of each term. If this description is done carefully enough, following a precise structure, software can help us understand what the terms mean, check for some kinds of errors, and sometimes even dynamically update itself to use and recognize new URIs.
There is a vocabulary of about fifty terms (URIs) being developed by W3C Working Groups to support this kind of precise documentation. About a dozen of the terms are part of the RDF Vocabulary Description Language 1.0: RDF Schema, for which we use the "rdfs:" namespace abbreviation. The others are part of the OWL Web Ontology Language. All fifty are listed and cross referenced in the OWL Guide Appendix .
Rdfs:comment is for providing unstructured documentation, while rdfs:label can give an easier-to-read name and rdfs:seeAlso gives untyped links. This is a good start for unstructured documentation.
:CanisFamiliaris rdfs:comment """The class of animals designated Canis familiaris (domestic dog). This includes all the dog breeds, but not wolves."""; rdfs:label "Canis familiaris"; rdfs:seeAlso <http://www.agrobiologicals.com/glossary/G3089.htm>.
Our simplest machine-readable declaration is that two URIs mean the same thing:
:Pat owl:sameAs :Patrick.
Given this statement, a system which understands
owl:sameAs
would know that everything true of
:Pat was also true of :Patrick and everything true of :Patrick was
true of :Pat. They are just synonyms: two names for the same thing.
This is what N3 means with "=". (Note that cwm does not
understand any of these terms natively, but can be instructed
to use them, via rules.)
We could also say:
:Dog owl:equivalentClass :CanisFamiliaris. # or :Dog owl:sameAs :CanisFamiliaris.
These two are slightly different: equivalent classes have exactly the members, but may have a different intended meaning. If we use owl:sameAs, then our label "Canis familiaris" would also apply to :Dog.
In some cases equivalence and sameness can be inferred. OWL has a vocabulary for talking about "cardinality" of properties, saying whether they map one-to-one, one-to-many, many-to-one, etc. If we have a :mother property, we declare that it is many-to-one ("functional"), indicating that people have at most one biological mother:
:mother a owl:FunctionalProperty
This can be used to infer sameness, because if we say
:sam :mother :jackie. :sam :mother :jacqueline.
a human or machine reader can figure out that ":jackie" and ":jacqueline" must be names for the same individual.
Of course it's possible that :jackie and :jacqueline are not the same person, and that one of the lines about :sam was a mistake! OWL has several ways to say that things are not the same; the simplest would be:
:jackie owl:differentFrom :jacqueline.
Taken together, the three statements describe an impossible situation, and OWL software should be able to recognize and warn about this situation.
:Man s:subclassOf :Human . :YoungMan s:subclassOf :Man .
:CanisFamiliarisDingo owl:subClassOf :CanisFamiliaris; # Dingos are Dogs! rdfs:seeAlso <http://www.naturalworlds.org/ wolf/canis/Canis_familiaris_dingo.htm>. :CanisRufus a owl:Class; owl:subClassOf :Canis; owl:disjointFrom :CanisFamiliaris; # Wolves are not Dogs! rdfs:label "Red Wolf"; rdfs:comment """As of 1999 there were about 300 individuals of this endangered species"""; rdfs:seeAlso <http://druidry.org/obod/endangered/redwolf.html>.
:father s:domain :Human; s:range :Man. :Sara :father :Alan. ______________________________________ :Sara a :Human. :Alan a :Man. :father owl:cardinality "1". :Sara :father :Alan. :Sara :father :MrFoster. ___________________________________ :Alan = :MrFoster.