RDFS constructs are the RDFS classes, associated properties and utility properties built on the limited vocabulary of RDF.
Classes
rdfs:Resource is the class of everything. All things described by RDF are resources.
rdfs:Class declares a resource as a class for other resources.
A typical example of an rdfs:Class is foaf:Person in the Friend of a Friend vocabulary. An instance of foaf:Person is a resource that is linked to the class foaf:Person using the rdf:type [|property], such as in the following formal expression of the natural-language sentence : 'John is a Person'. ex:John rdf:type foaf:Person The definition of rdfs:Class is recursive: rdfs:Class is the class of classes, and so it is an instance of itself. rdfs:Class rdf:type rdfs:Class The other classes described by the RDF and RDFS specifications are:
rdfs:Literal – literal values such as strings and integers. Property values such as textual strings are examples of RDF literals. Literals may be plain or typed.
rdfs:Datatype – the class of datatypes. rdfs:Datatype is both an instance of and a subclass of rdfs:Class. Each instance of rdfs:Datatype is a subclass of rdfs:Literal.
rdf:XMLLiteral – the class of XML literal values. rdf:XMLLiteral is an instance of rdfs:Datatype.
rdf:Property – the class of properties.
Properties
Properties are instances of the class rdf:Property and describe a relation between subject resources and object resources. When used as such a property is a .
rdfs:domain of an rdf:Property declares the class of the subject in a triple whose predicate is that property.
rdfs:range of an rdf:Property declares the class or datatype of the object in a triple whose predicate is that property.
For example, the following declarations are used to express that the property ex:employer relates a subject, which is of type foaf:Person, to an object, which is of type foaf:Organization: ex:employer rdfs:domain foaf:Person ex:employer rdfs:range foaf:Organization Given the previous two declarations, from the triple: ex:John ex:employer ex:CompanyX can be inferred that ex:John is a foaf:Person, and ex:CompanyX is a foaf:Organization.
rdf:type is a property used to state that a resource is an instance of a class. A commonly accepted qname for this property is "a".
rdfs:subClassOf allows declaration of hierarchies of classes.
For example, the following declares that 'Every Person is an Agent': foaf:Person rdfs:subClassOf foaf:Agent Hierarchies of classes support inheritance of a property domain and range from a class to its subclasses.
rdfs:subPropertyOf is an instance of rdf:Property that is used to state that all resources related by one property are also related by another.
rdfs:label is an instance of rdf:Property that may be used to provide a human-readable version of a resource's name.
rdfs:comment is an instance of rdf:Property that may be used to provide a human-readable description of a resource.
Utility properties
rdfs:seeAlso is an instance of rdf:Property that is used to indicate a resource that might provide additional information about the subject resource.
rdfs:isDefinedBy is an instance of rdf:Property that is used to indicate a resource defining the subject resource. This property may be used to indicate an RDF vocabulary in which a resource is described.
Examples of RDF Vocabularies
Popular RDF vocabularies represented in RDFS include:
FOAF: the source of the page http://xmlns.com/foaf/spec/ is RDFS written in the RDFa syntax.
Dublin Core: RDFS source is available in several syntaxes
Schema.org: the source of the page http://schema.org/docs/schema_org_rdfa.html is RDFS written in the RDFa syntax.
Simple Knowledge Organization System : http://www.w3.org/TR/skos-reference/skos-xl.rdf is an OWL ontology for the SKOS vocabulary that uses the OWL RDF/XML syntax and hence makes use of a number of classes and properties from RDFS.
An entailment regime defines by using RDFS not only which entailment relation is used, but also which queries and graphs are well-formed for the regime. The RDFS entailment is a standard entailment relation in the semantic web. For example, the following declares that 'Dog1 is an animal','Cat1 is a cat', 'Zoos host animals' and 'Zoo1 hosts the Cat2' :
But this graph is not well formed because the system can not guess that a cat is an animal. We have to add 'Cats are animals' to do a well-formed graph with :
ex:cat rdfs:subClassOf ex:animal
Here is a correct example: If your triplestore implements the regime entailment of RDF and RDFS, the SPARQL query as follows : PREFIX ex: SELECT ?animal WHERE
Gives the following result with cat1 in it because the Cat's type inherits of Animal's type: