RDF Quick Start...login
RDF Quick Start Tutorial
author:php.cn  update time:2022-04-11 14:47:18

RDF Schema



RDF Schema (RDFS) is an extension to RDF.


RDF Schema and Application Classes

RDF describes resources through classes, properties, and values.

Additionally, 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 actual application-specific classes and properties, but 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 enables resources to be defined as instances of classes and subclasses of classes.


RDFS Example

The following example demonstrates some aspects of the capabilities of RDFS:

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

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


Example of abbreviation

Since an RDFS class is an RDF resource, we can replace the above by using rdfs:Class instead of rdf:Description and removing the rdf:type information. The example is abbreviated:

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

php.cn