Copyright © 2003 W3C^{®} (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
The exchange syntax for OWL is RDF/XML [RDF Syntax], as specified in the OWL Reference Description [OWL Reference]. Further, the meaning of an OWL ontology in RDF/XML is determined only from the RDF graph [RDF Concepts] that results from the RDF parsing of the RDF/XML document. Thus one way of translating an OWL ontology in abstract syntax form into the exchange syntax is by giving a transformation of each directive into a collection of triples. As all OWL Lite constructs are special cases of constructs in the full abstract syntax, transformations are only provided for the OWL DL versions.
The syntax for triples used here is the one used in the RDF Model Theory [RDF MT]. In this variant, qualified names are allowed. As detailed in the RDF Model Theory, to turn this syntax into the standard one just expand the qualified names into URI references in the standard RDF manner by concatenating the namespace name with the local name. The only namespace prefixes used in the transformation are rdf, rdfs, xsd, and owl, which correspond to the namespaces http://www.w3.org/1999/02/22rdfsyntaxns#, http://www.w3.org/2000/01/rdfschema#, http://www.w3.org/2001/XMLSchema#, and http://www.w3.org/2002/07/owl#, respectively.
The Transformation Table gives transformation rules that transform the abstract syntax to the OWL exchange syntax. In a few cases, notably for the DifferentIndividuals construct, there are different transformation rules. In such cases either rule can be chosen, resulting in a nondeterministic translation. In a few other cases, notably for class and property axioms, there are triples that may or may not be generated. These triples are indicated by flagging them with [opt]. These nondeterminisms allow the generation of more RDF Graphs.
The left column of the table gives a piece of syntax (S), the center column gives its transformation (T(S)), and the right column gives an identifier for the main node of the transformation (M(T(S))), but only for syntactic constructs that can occur as pieces of directives. Repeating components are listed using ellipses, as in description_{1}; … description_{n}, this form allows easy specification of the transformation for all values of n greater than or equal to zero. Optional portions of the abstract syntax (enclosed in square brackets) are optional portions of the transformation (signified by square brackets).
Some transformations in the table are for directives. Other transformations are for parts of directives. The last transformation is for sequences, which are not part of the abstract syntax per se. This last transformation is used to make some of the other transformations more compact and easier to read.
For many directives these transformation rules call for the transformation of components of the directive using other transformation rules. When the transformation of a component is used as the subject or object of a triple, the transformation of the construct is part of the production (but only once per production) and the main node of that transformation should be used for that node of the triple.
Bnode identifiers here must be taken as local to each transformation, i.e., different identifiers should be used for each invocation of a transformation rule. Also, some of the transformations require a URI for the current ontology. It is assumed that ontologies that are subject to this sort of transformation will be placed into a webaccessible document; the URI of this document is given as U.
Abstract Syntax (and sequences)  S  Transformation  T(S)  Main Node  M(T(S)) 
Ontology(directive_{1} … directive_{n})  U rdf:type owl:Ontology . [opt] T(directive_{1}) … T(directive_{n}) 

datatypeID  datatypeID rdf:type rdfs:Datatype .  datatypeID 
classID  classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] 
classID 
individualID  individualID  
datavaluedPropertyID  datavaluedPropertyID rdf:type owl:DatatypeProperty . datavaluedPropertyID rdf:type rdf:Property . [opt] 
datavalued PropertyID 
individualvaluedPropertyID  individualvaluedPropertyID rdf:type owl:ObjectProperty . individualvaluedPropertyID rdf:type rdf:Property . [opt] 
individualvalued PropertyID 
datatypeID literal  literal^^<datatypeID>  literal^^ <datatypeID> 
literal  literal  literal 
Annotation(URIreference URIreference)  U <URIreference> <URIreference> .  
Annotation(URIreference dataLiteral)  U <URIreference> T(dataLiteral) .  
Imports(URI)  U owl:imports URI .  
Individual(iID annotation_{1} … annotation_{n} type(type_{1})…type(type_{n}) value(pID_{1} value_{1}) … value(pID_{n} value_{n})) 
iID T(annotation_{1}) . … iID T(annotation_{n}) . iID rdf:type T(type_{1}) . … iID rdf:type T(type_{n}) . iID T(pID_{1}) T(value_{1}) . … iID T(pID_{n}) T(value_{n}) . 
iID 
Individual(annotation_{1} … annotation_{n} type(type_{1})…type(type_{n}) value(pID_{1} value_{1}) … value(pID_{n} value_{n})) 
_:x T(annotation_{1}) . … _:x T(annotation_{n}) . _:x rdf:type T(type_{1}) . … _:x rdf:type T(type_{n}) . _:x T(pID_{1}) T(value_{1}) . … _:x T(pID_{n}) T(value_{n}) . 
_:x 
SameIndividual(iID_{1} … iID_{n})  iID_{i} owl:sameIndividualAs iID_{j} . 1≤ij≤n  
DifferentIndividuals(iID_{1} … iID_{n})  iID_{i} owl:differentFrom iID_{j} . 1≤ij≤n  
DifferentIndividuals(iID_{1} … iID_{n}) 
_:x rdf:type owl:AllDifferent . _:x owl:distinctMembers T(SEQ iID_{i} … iID_{j}) 

Class(classID partial annotation_{1} … annotation_{n} description_{1} … description_{n}) 
classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] classID T(annotation_{1}) . … classID T(annotation_{n}) . classID rdfs:subClassOf T(description_{1}) . … classID rdfs:subClassOf T(description_{n}) . 

Class(classID complete annotation_{1} … annotation_{n} description_{1} … description_{n}) 
classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] classID T(annotation_{1}) . … classID T(annotation_{n}) . classID owl:intersectionOf T(SEQ description_{1}…description_{n}) . 

Class(classID complete annotation_{1} … annotation_{n} description) 
classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] classID T(annotation_{1}) . … classID T(annotation_{n}) . classID owl:sameClassAs T(description) . 

Class(classID complete annotation_{1} … annotation_{n} unionOf(description_{1} … description_{n})) 
classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] classID T(annotation_{1}) . … classID T(annotation_{n}) . classID owl:unionOf T(SEQ description_{1}…description_{n}) . 

Class(classID complete annotation_{1} … annotation_{n} complementOf(description)) 
classID rdf:type owl:Class . classID rdf:type rdfs:Class . [opt] classID T(annotation_{1}) . … classID T(annotation_{n}) . classID owl:complementOf T(description) . 

EnumeratedClass(classID annotation_{1} … annotation_{n} iID_{1} … iID_{n}) 
classID rdf:type owl:Class . classID T(annotation_{1}) . … classID T(annotation_{n}) . classID owl:oneOf T(SEQ iID_{1}…iID_{n}) . 

DisjointClasses(description_{1} … description_{n})  T(description_{i}) owl:disjointWith T(description_{j}) . 1≤i<j≤n  
EquivalentClasses(description_{1} … description_{n})  T(description_{i}) owl:sameClassAs T(description_{j}) . 1≤i<j≤n  
SubClassOf(description_{1} description_{2})  T(description_{1}) rdfs:subClassOf T(description_{2}) .  
unionOf(description_{1} … description_{n}) 
_:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:unionOf T(SEQ description_{1}…description_{n}) . 
_:x 
intersectionOf(description_{1} … description_{n}) 
_:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:intersectionOf T(SEQ description_{1}…description_{n}) . 
_:x 
complementOf(description)  _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:complementOf T(description) . 
_:x 
oneOf(iID_{1} … iID_{n}) 
_:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:oneOf T(SEQ iID_{1}…iID_{n}) . 
_:x 
oneOf(v_{1} … v_{n}) 
_:x rdf:type rdfs:Class . [opt] _:x owl:oneOf T(SEQ v_{1} … v_{n}) . 
_:x 
restriction(ID component_{1} … component_{n})  _:x owl:intersectionOf T(SEQ(restriction(ID component_{1})… restriction(ID component_{n}))) . 
_:x 
restriction(ID allValuesFrom(range))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:allValuesFrom T(range) . 
_:x 
restriction(ID someValuesFrom(required))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:someValuesFrom T(required) . 
_:x 
restriction(ID value(value))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:hasValue T(value) . 
_:x 
restriction(ID minCardinality(min))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:minCardinality "min"^^xsd:nonNegativeInteger . 
_:x 
restriction(ID maxCardinality(max))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:maxCardinality "max"^^xsd:nonNegativeInteger . 
_:x 
restriction(ID cardinality(card))  _:x rdf:type owl:Restriction . _:x rdf:type owl:Class . [opt] _:x rdf:type rdfs:Class . [opt] _:x owl:onProperty T(ID) . _:x owl:cardinality "card"^^xsd:nonNegativeInteger . 
_:x 
DatatypeProperty(ID annotation_{1} … annotation_{n} super(super_{1})… super(super_{n}) domain(domain_{1})… domain(domain_{n}) range(range_{1})… range(range_{n}) [Functional]) 
ID rdf:type owl:DatatypeProperty . ID rdf:type rdf:Property . [opt] ID T(annotation_{1}) . … ID T(annotation_{n}) . ID rdfs:subPropertyOf T(super_{1}) . … ID rdfs:subPropertyOf T(super_{n}) . ID rdfs:domain T(domain_{1}) . … ID rdfs:domain T(domain_{n}) . ID rdfs:range T(range_{1}) . … ID rdfs:range T(range_{n}) . [ID rdf:type owl:FunctionalProperty . ] 

ObjectProperty(ID annotation_{1} … annotation_{n} super(super_{1})… super(super_{n}) domain(domain_{1})… domain(domain_{n}) range(range_{1})… range(range_{n}) [inverseOf(inverse)] [Symmetric] [Functional  InverseFunctional  Transitive]) 
ID rdf:type owl:ObjectProperty . ID rdf:type rdf:Property . [opt] ID T(annotation_{1}) . … ID T(annotation_{n}) . ID rdfs:subPropertyOf T(super_{1}) . … ID rdfs:subPropertyOf T(super_{n}) . ID rdfs:domain T(domain_{1}) . … ID rdfs:domain T(domain_{n}) . ID rdfs:range T(range_{1}) . … ID rdfs:range T(range_{n}) . [ID owl:inverseOf T(inverse) .] [ID rdf:type owl:SymmetricProperty . ] [ID rdf:type owl:FunctionalProperty . ] [ID rdf:type owl:InverseFunctionalProperty . ] [ID rdf:type owl:TransitiveProperty . ] 

EquivalentProperties(dvpID_{1} … dvpID_{n})  T(dvpID_{i}) owl:samePropertyAs T(dvpID_{j}) . 1≤ij≤n  
SubPropertyOf(dvpID_{1} dvpID_{2})  T(dvpID_{1}) rdfs:subPropertyOf T(dvpID_{2}) .  
EquivalentProperties(ivpID_{1} … ivpID_{n})  T(ivpID_{i}) owl:samePropertyAs T(ivpID_{j}) . 1≤ij≤n  
SubPropertyOf(ivpID_{1} ivpID_{2})  T(ivpID_{1}) rdfs:subPropertyOf T(ivpID_{2}) .  
annotation (URIreference URIreference)  <URIreference> <URIreference>  
annotation (URIreference dataLiteral)  <URIreference> T(dataLiteral)  
SEQ  rdf:nil  
SEQ item_{1}…item_{n}  _:l_{1} rdf:type rdf:List . _:l_{1} rdf:first T(item_{1}) . _:l_{1} rdf:rest _:l_{2} . … _:ln rdf:type rdf:List . _:ln rdf:first T(item_{n}) . _:ln rdf:rest rdf:nil . 
_:l_{1} 
Definition: An RDF graph is an OWL DL ontology in RDF graph form if it is equal (see below for a slight expansion) to a result of the transformation to triples above of the imports closure of an OWL DL ontology in abstract syntax form and, moreover,
For the purposes of determining whether an RDF graph is an
OWL DL ontology in RDF graph form, cardinality restrictions are explicitly
allowed to use constructions like "1"^^xsd:decimal
so long as
the data value so encoded is a nonnegative integer.
Definition: An RDF graph is an OWL Lite ontology in RDF graph form if it is equal (with the same relaxation as for OWL DL) to a result of the transformation to triples above of the imports closure of an OWL Lite ontology in abstract syntax form that meets the requirements given just above.
This transformation is not injective, as several OWL abstract ontologies that do not use the above reserved vocabulary can map into equal RDF graphs. However, the only cases where this can happen is with constructs that have the same meaning, such as several DisjointClasses axioms having the same effect as one larger one. It would be possible to define a canonical inverse transformation, if desired.
The above definition of OWL DL and OWL Lite ontologies in RDF graph form is couched from the perspective of the abstract syntax, as this is the perspective from which it can be easily stated. The following, much longer description of OWL DL ontologies in RDF graph form is couched from the perspective of RDF graphs. This description is strictly informative. The normative definition of what constitutes an OWL DL ontology in RDF graph form is given above.
Let G be an RDF graph. A node x1 in G is a nonempty list in G with elements e1,…,en if there is a set of triples in G of the form
x1 rdf:type rdf:List . x1 rdf:first e1 . x1 rdf:rest x2 . ... xn rdf:type rdf:List . xn rdf:first en . xn rdf:rest rdf:nil .
where each xi is a distinct blank node that appears as the object of exactly one triple in G and x1 does not appear as the object of an rdf:rest triple. The definition triples of x1 are the triples above plus the definition triples of e1,...,en.
A node x in G is a description in G if x is a blank node and there is a set of triples of one of the entries in the Description Triples table, where
Constructor  Triples 

allValuesFrom  x rdf:type owl:Restriction .

someValuesFrom 
x rdf:type owl:Restriction .

hasValue 
x rdf:type owl:Restriction .

minCardinality 
x rdf:type owl:Restriction .

maxCardinality 
x rdf:type owl:Restriction .

cardinality 
x rdf:type owl:Restriction .

unionOf 
x owl:unionOf ds .

intersectionOf 
x owl:intersectionOf ds .

complementOf 
x owl:complementOf dc .

oneOf 
x owl:oneOf is .

The definition triples of the description are the triples above plus any
x rdf:type owl:Class .
or
x rdf:type rdfs:Class .
triples
plus the definition triples of any description, data range, or list in the
triples above.
A node x in G is a data range in G if x is a blank node and there
is a triple of the form
x owl:oneOf rdf:nil .
or
x owl:oneOf is .
where is is a nonempty list whose elements are typed or untyped literals.
The definition triples of the data range are the triples above plus any
triples of the form
x rdf:type rdfs:Class .
plus the definition triples of the list.
A node x in G is a datatype property if x is a URI reference and
there is a triple of the form
x rdf:type owl:DatatypeProperty .
but no triple of any of the following forms
x rdf:type owl:SymmetricProperty . x rdf:type owl:InverseFunctionalProperty . x rdf:type owl:TransitiveProperty .
The assertions about x in G are the triples in G of the following forms, where y is a datatype property in G, d is a description or class in G, and r is a data range or datatype in G
x rdf:type owl:DatatypeProperty . x rdf:type rdf:Property . x rdfs:subPropertyOf y . x rdfs:domain d . x rdfs:range r . x rdf:type owl:FunctionalProperty . x owl:samePropertyAs y .
plus the definition triples of any description or data range in these triples.
A node x in G is an object property if x is a URI reference and
there is a triple of the form
x rdf:type owl:ObjectProperty .
The assertions about x in G are the triples in G of the following forms,
where y is an object property in G, d is a description or class in G
x rdf:type owl:ObjectProperty . x rdf:type rdf:Property . x rdfs:subPropertyOf y . x rdfs:domain d . x rdfs:range d . x owl:inverseOf y . x rdf:type owl:SymmetricProperty . x rdf:type owl:FunctionalProperty . x rdf:type owl:InverseFunctionalProperty . x rdf:type owl:TransitiveProperty . x owl:samePropertyAs y .
plus the definition triples of any description in these triples.
A node x in G is a transitive object property if x is an object
property and there is a triple of the form
x rdf:type owl:TransitiveProperty .
A node x in G is a complex object property if x is an object property and there is a triple of any of the following forms in G
x rdf:type owl:FunctionalProperty . x rdf:type owl:InverseFunctionalProperty . x owl:inverseOf y . x owl:samePropertyAs y . y rdfs:subClassOf x .
where y is a complex object property in G or if there are triples of each of the forms
z owl:onProperty x . z c y .
where c is one of owl:minCardinality
,
owl:maxCardinality
, or owl:cardinality
.
A node x in G is a datatype if x is a URI reference and there
is a triple of the form
x rdf:type rdfs:Datatype .
The assertions about x in G are the triples in G of the following forms,
where d is a toplevel description or class in G
x rdf:type rdfs:Datatype .
A node x in G is a class if x is owl:Thing
or
owl:Nothing
or x is a URI reference and there is a triple of
the form
x rdf:type owl:Class .
The assertions about x in G are the triples in G of the following forms,
where d is a toplevel description or class in G and ds is rdf:nil or a
nonempty list whose elements are descriptions or classes and is is rdf:nil
or a nonempty list whose elements are individuals, plus the definition
triples of any nonempty lists in these triples
x rdf:type owl:Class . x rdf:type rdfs:Class . x rdfs:subClassOf d . x owl:sameClassAs d . x owl:disjointFrom d. x owl:complementOf d. x owl:intersectionOf ds. x owl:unionOf ds. x owl:oneOf is .
A node x in G is a toplevel description if x is a description that is not in the definition triples of any other description in G nor an element of a list in G. The assertions about x in G are the triples in G of the following forms, where d is a toplevel description or class in G
x rdf:type owl:Class . x rdfs:subClassOf d . x owl:sameClassAs d . x owl:disjointWith d .
plus the definition triples of x.
A node x in G is an individual if there is a triple of the form
x rdf:type c .
where c is a description or class.
The assertions about x in G are the triples of G of the following forms,
where c is a description or class, rd is a datatype property, v is a typed
or untyped literal, ro is an object property, and i is an individual.
x rdf:type c . x rd v . x ro i . x owl:sameIndividualAs i . x owl:differentFrom i .
plus the definition triples of any description in these triples.
A node x in G is an alldifferent node if there is a triple of the
form
x rdf:type owl:allDifferent .
and there is exactly one other triple in G whose subject is x and this
triple is of one of the following forms, where l is a nonempty list
whose elements are individuals
x owl:distinctMembers owl:nil . x owl:distinctMembers l .
The assertions about x are the above triples, plus the definition triples of l, if present.
A node x in G is an ontology if x is a URI reference and there
is a triple of the form
x rdf:type owl:Ontology .
The assertions about x are the triples of G of the following form
x rdf:type owl:Ontology . x owl:imports y .
where y is a URI reference that is not a datatype property, an object property, a class, or an individual.
An RDF graph is an OWL DL graph if:
A quick incomplete gloss of the above is that