RDF Schema
Overview
The simplest extension to RDF that allows a modeler to manage inference is RDF Schema (RDFS). Triples that are inserted directly into an underlying RDF store are called asserted triples. Triples that are derived from inference rules are called inferred triples.
Classes
All things described by RDF are called resources. In RDFS, resources may be divided into groups called classes. The rdf:type property states a resource is an instance of a class. Associated with a class is its class extension, i.e. the set containing all of the instances of the class. A class may be a member of its own class extension.
Subclasses
If a class C is a subclass of a class C', then all instances of C will also be instances of C'. The rdfs:subClassOf property may be used to state that one class is a subclass of another.
CONSTRUCT { ?x a ?B }
WHERE { ?A rdfs:subClassOf ?B. ?x a ?A }
Intersection
Let
It does so using the following inference rules:
:C rdfs:subClassOf :A .
:C rdfs:subClassOf :B .
Union
Let
It does so using the following inference rules:
:A rdfs:subClassOf :C .
:B rdfs:subClassOf :C .
Properties
A property P is often annotated with the rdfs:domain and rdfs:range properties.
For any triple involving P, these properties specify the classes the subject and object of the triple should be members of respectively.
CONSTRUCT { ?x a ?D }
WHERE { ?P rdfs:domain ?D. ?x ?P ?y }
CONSTRUCT { ?y a ?R }
WHERE { ?P rdfs:range ?R. ?x ?P ?y }
Subproperties
The rdfs:subPropertyOf property may be used to state that one property is a subproperty of another.
CONSTRUCT { ?x ?r ?y }
WHERE { ?x ?q ?y. ?q rdfs:subPropertyOf ?r }
Intersection
Let
It does so using the following inference rules:
:R rdfs:subPropertyOf :P .
:R rdfs:subPropertyOf :Q .
Union
Let
It does so using the following inference rules:
:P rdfs:subPropertyOf :R .
:Q rdfs:subPropertyOf :R .