Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

RDF Schema


May 23, 2021 RDF


Table of contents


RDF Schema (RDFS)

RDF by itself does not define certain classes and properties, which need to be defined in RDF's descriptive language, RDF Schema.


RDF Schema (RDFS) is an extension of RDF.


RDF Schema and application classes

RDF describes resources by classes, properties, and values.

In addition, RDF requires a way to define application-specific classes and properties. Application-specific classes and properties must be defined using extensions to RDF.

RDF Schema is such an extension.


RDF Schema (RDFS)

RDF Schema does not provide classes and properties that are specific to the actual application, but rather provides a framework that describes the classes and properties that are specific to the application.

The classes in RDF Schema are very similar to those in the object-oriented programming language. This allows resources to be defined as instances of classes and sub-classes of classes.


RDFS instance

The following example demonstrates some aspects of RDFS's capabilities:

<?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>

In the example above, the resource "horse" is a sub-class of the class "animal".


A short example

Since an RDFS class is an RDF resource, we can use rdfs:Class instead of rdf:Description and remove the rdf:type information to briefly follow the example above:

<?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>

That's it!

That's the explanation for RDF Schema.