Reasoning using RDFS
RDF Schema introduces a very limited range of logical terms based mostly on the concept of class, or rdfs:Class, a concept absent from RDF.
It is possible to state directly that a resource denotes a class, using a triple such as the following (to save space we omit prefixes):
mo:MusicGroup rdf:type rdfs:Class .
We have already seen an example of the predicate rdfs:subClassOf, through which we can assert that the resource in subject position is a subclass of the resource in object position – a relationship often expressed in English by sentences of the form All X are Y (e.g., “All pianists are musicians”). A similar predicate is provided for properties rather than classes, illustrated by the following triple in which subject, predicate and object are all property resources:
ex:hasSinger rdfs:subPropertyOf ex:hasPerformer .
This means that if a subject and object are related by the ex:hasSinger predicate, they must also be related by the ex:hasPerformer predicate.
Note that even though these are properties, they may occur in subject and object position – in other words, we can make statements about properties, as well as using them to express relationships among other resources.
Two important facts about any property are its domain and range, which constrain the resources that can be employed in subject and object position when the property is used as a predicate; these can also be defined using RDFS resources, as follows:
ex:hasSinger rdfs:domain mo:Performance . ex:hasSinger rdfs:range foaf:Agent .
This means that any resource occurring as subject of ex:hasSinger must belong to the class mo:Performance (only performances have singers), while any resource occurring as object of ex:hasSinger must belong to the class foaf:Agent (only agents are singers).
RDFS entailment rules
The RDFS entailment regime is defined by thirteen rules, which are listed here. In brief, their import is as follows:
Allocates a blank node to a literal, and classifies this node as a member of the class rdfs:Literal.
Uses a rdfs:domain statement to classify a resource found in subject position (in a triple containing the relevant property as predicate).
Uses a rdfs:range statement to classify a resource found in object position (in a triple containing the relevant property as predicate).
Classifies a resource found in subject or object position in a triple as belonging to the class rdfs:Resource.
Inference based on the transitivity of rdfs:subPropertyOf.
Infers that any resource classified as a property is a sub-property of itself.
Uses a rdfs:subPropertyOf statement to infer that two resources are related by a property P if they are related by a subproperty of P.
Infers that any resource classified as a class is a subclass of rdfs:Resource.
Infers that a resource belongs to a class if it belongs to its subclass.
Infers that any class is a subclass of itself.
Uses the transitivity of rdfs:subClassOf to infer that the subclass of a class C is a subclass of the superclass of C.
Infers that any resource belonging to rdfs:ContainerMembershipProperty is a subproperty of rdfs:member.
Infers that any resource belonging to rdfs:Datatype is a subclass of rdfs:Literal.
Following these rules and using rdfs:subClassOf as an example, the pattern follows Aristotelian syllogism:
“Socrates is a man.
All men are mortal.
Therefore, Socrates is mortal.”
This work is a derivative of ‘Using Linked Data Effectively’ by The Open University (2014) and licensed under CC by 4.0 International Licence adapted and used by the University of Southampton. http://www.euclid-project.eu/