RDF Schema (RDFS) is an extension of RDF. RDF describes resources by classes, attributes, and values. In addition, RDF needs a way to define application-specific classes and properties. Application-specific classes and properties must be defined using an extension to RDF. RDF Schema is such an extension. Instead of providing actual application-specific classes and properties, RDF Schema provides a framework for describing application-specific classes and properties. Classes in RDF Schema are very similar to classes in object-oriented programming languages. This allows resources to be defined as instances of the class and subclasses of the class. The following example demonstrates some aspects of RDFS’s capabilities: In the above example, the resource “horse” is a subclass of the class “animal”. Since a RDFS class is a RDF resource, we can abbreviate the above example by using rdfs:Class instead of rdf:Description and removing the rdf:type information: okay!Classes for RDF Schema and applications ¶
RDF Schema (RDFS) ¶
RDFS instance ¶
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.animals.fake/animals#">
<rdf:Description rdf:ID="animal">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
</rdf:Description>
<rdf:Description rdf:ID="horse">
<rdf:type rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
<rdfs:subClassOf rdf:resource="#animal"/>
</rdf:Description>
</rdf:RDF>
An example of shorthand ¶
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://www.animals.fake/animals#">
<rdfs:Class rdf:ID="animal" />
<rdfs:Class rdf:ID="horse">
<rdfs:subClassOf rdf:resource="#animal"/>
</rdfs:Class>
</rdf:RDF>