Best Practice: Be careful with the use of inferencing in RDF Vocabularies
State: Draft
Contact: Nick Crossley
Scope
This Best Practice recommends appropriate usage of inferencing properties such as
rdfs:domain,
rdfs:range,
rdfs:subClassOf, and
rdfs:subPropertyOf in RDF vocabularies.
Recommendation
RDFS contains terms such as rdfs:domain, rdfs:range, rdfs:subClassOf, and rdfs:subPropertyOf, which go beyond mere vocabulary definition and enter into the world of ontologies. The primary difference between a vocabulary and an ontology is that an ontology includes inference rules which let you infer new information from given information - that is, add new triples to those stated, rather than constrain data to some schema.
For more information on this, read
OSLC Resource Shape - A language for defining constraints on Linked Data
.
In the light of this knowledge, be careful with the use of inferencing terms in vocabularies - they often do not mean what you might have thought they meant. In particular, do not use
rdfs:domain or
rdfs:range with multiple values when defining a vocabulary term for a property, since that infers the target of that property is of all mentioned types, not any one of them.
Examples
Here is an example snippet of an RDF vocabulary document:
@prefix oslc: <http://open-services.net/ns/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
oslc:ServiceProvider a rdfs:Class ;
rdfs:isDefinedBy oslc: ;
rdfs:label "ServiceProvider" ;
rdfs:comment "The Service Provider resource" ;
rdfs:seeAlso <http://open-services.net/bin/view/Main/OslcCoreSpecification#Resource_Service_Provider> .
See Also