RDFS Vocab - gchq/LD-Explorer GitHub Wiki

https://www.w3.org/TR/rdf12-schema/

RDFS, the schema-language for RDF, is a core component of the main w3c recommendations and one of the most liberally used vocabs in the semantic web ecosystem. The vocab itself is concerned with bringing basic schema-writing functionality to RDF data by allowing for relationships between classes and properties to be expressed in more detail, as well as providing basic set theory mechanisms like intersections and unions. On top of this, the RDFS vocab also provides a few utilities for working with resources, such as the ability to label them. Other mathematical concepts are also borrowed for this vocab, such as rdfs:domain and rdfs:range which can be used to describe the appropriate subject and object classes to associate with a particular property.

RDFS can be thought of as providing the basics of what you need in order to describe an ontology.

Example

These examples showcase some of the more commonly used axioms in the rdfs vocab. This first block uses RDFS to label up a resource and comment on it, then defines a particular individual as being a member of that class.

@prefix : <http://www.example.com/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:Animal a rdfs:Class ;
    rdfs:label "Animals" ;
    rdfs:comment "The class of all animals" .

:Squirrel a :Animal .

This next block uses rdfs:domain and rdfs:range to indicate that a particular property (:hasFather) expects the subject and object to be a :Person. You could use this information to computationally build features into user interfaces, or to infer the class of a particular resource based on its properties.

@prefix : <http://www.example.com/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:hasFather rdfs:domain :Person .
:hasFather rdfs:range :Person .

The final block here demonstrates the set theory concept of a "union" using the rdfs:subClassOf property to indicate :Number is the union of the sets :OddNumber and :EvenNumber.

@prefix : <http://www.example.com/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:OddNumber rdfs:subClassof :Number .
:EvenNumber rdfs:subClassof :Number .