RDF, RDFS and OWL are means to express increasingly complex information or knowledge. All of them can be serialised in RDF/XML syntax (or any other RDF serialisation syntax like Turtle or N3 for instance).
These technologies are related and supposed to be interoperable, yet they have different origins that's maybe why the relation between them is complicated to grasp. The choice on one or the other depends on how much complexity the situation you are modelling requires.
Summary of expressivity
RDF: Straightforward representation, focused on the instances and on the mapping to their types (rdf:type
). It is possible to define custom properties to link data and creating triples. RDF data are queried with SPARQL.
Example of RDF serialised in Turtle:
@prefix : <http://www.example.org/> .
:john rdf:type :Man .
:john :livesIn "New-York" .
:livesIn rdf:type rdf:Property .
RDFS: Some situations are not easily modelled by RDF alone, it is sometimes interesting to represent more complex relations like subclasses (the type of a type) for example. RDFS provides special means to represent such cases, with constructs like rdfs:subClassOf
, rdfs:range
or rdfs:domain
. Ideally, a reasoner can understand the RDFS semantics and expand the number of triples based on the relations: For instance if you have the triples John a Man
and Man rdfs:subClassOf
Human
then you should generate as well the triple John a Human
. Note that this is not possible to do with RDF alone. RDFS data are queried using SPARQL.
Example of RDFS serialised in Turtle:
@prefix : <http://www.example.org/> .
:john rdf:type :Man .
:Man rdfs:subClassOf :Human .
:john :livesIn "New-York" .
:livesIn rdf:type rdf:Property .
# After reasoning
:john rdf:type :Human .
OWL: The highest level of expressivity. Relation between classes can be formally modelled based on description logics (mathematical theory). OWL relies heavily on the reasoner, it is possible to express complex constructs such as chained properties for instance or restriction between classes. OWL serves to build ontologies or schema on the top of RDF datasets. As OWL can be serialised as RDF/XML, it is theoretically possible to query it via SPARQL, yet it is much more intuitive to query an OWL ontology with a DL query (which is usually a standard OWL class expression).
Example of OWL constructs serialised in Turtle.
@prefix : <http://www.example.org/> .
:livesIn rdf:type owl:DatatypeProperty .
:Human rdf:type owl:Class .
:Man rdf:type owl:Class .
:Man rdfs:subClassOf :Human .
:John rdf:type :Man .
:John rdf:type owl:NamedIndividual .