OWL Web Ontology Language
Semantics and Abstract Syntax
Section 4. Mapping to RDF Graphs

Editors:
Peter F. Patel-Schneider, Bell Labs Research, Lucent Technologies
Ian Horrocks, Department of Computer Science, University of Manchester

Please refer to the errata for this document, which may include some normative corrections.

See also translations.


Contents


4. Mapping to RDF Graphs (Normative)

This section of the document provides a mapping from the abstract syntax for OWL DL and OWL Lite given in Section 2 to the exchange syntax for OWL, namely RDF/XML [RDF Syntax]. This mapping (and its inverse) provide the normative relationship between the abstract syntax and the exchange syntax. It is shown in Section 5 and Appendix A.1 that this mapping preserves the meaning of OWL DL ontologies. Section 4.2 defines the OWL DL and OWL Lite dialects of OWL as those RDF graphs that are the result of mappings from abstract syntax ontologies.

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.

OWL DL has semantics defined over the abstract syntax and a concrete syntax consisting of a subset of RDF graphs. Hence it is necessary to relate specific abstract syntax ontologies with specific RDF/XML documents and their corresponding graphs. This section defines a many-to-many relationship between abstract syntax ontologies and RDF graphs. This is done using a set of nondeterministic mapping rules. Thus to apply the semantics to a particular RDF graph it is necessary to find one of the abstract syntax ontologies that correspond with that graph under the mapping rules and to apply the semantics to that abstract ontology. The mapping is designed so that any of the RDF graphs that correspond to a particular abstract ontology have the same meaning, as do any of the abstract ontologies that correspond to a particular RDF graph. Moreover, since this process cannot be applied to RDF graphs that do not have corresponding abstract syntax forms, the mapping rules implicitly define a set of graphs, which syntactically characterize OWL DL in RDF/XML.

The syntax for triples used here is the one used in the RDF semantics [RDF Semantics]. In this variant, qualified names are allowed. As detailed in the RDF semantics, 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, using the standard OWL namespaces.

4.1. Translation to RDF Graphs

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 non-deterministic 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]. In a couple of cases one of two triples must be generated. This is indicated by separating the triples with OR. These non-determinisms allow the generation of more RDF Graphs.

The left column of the table gives a piece of abstract syntax (S); the center column gives its transformation into triples (T(S)); and the right column gives an identifier for the main node of the transformation (M(T(S))), for syntactic constructs that can occur as pieces of directives. Repeating components are listed using ellipses, as in description1 … descriptionn, this form allows easy specification of the transformation for all values of n allowed in the syntax. Optional portions of the abstract syntax (enclosed in square brackets) are optional portions of the transformation (signified by square brackets). As well, for any of the built-in OWL datatypes, built-in OWL classes, built-in OWL annotation properties, and built-in OWL ontology properties the first rdf:type triple in the translation of it or any axiom for it is optional.

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, predicate, or object of a triple, even an optional triple, the transformation of the component is part of the production (but only once per production) and the main node of that transformation should be used in 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. Ontologies without a name are given a bnode as their main node; ontologies with a name use that name as their main node; in both cases this node is referred to as O below.

Transformation to Triples
Abstract Syntax (and sequences) - S Transformation - T(S) Main Node - M(T(S))
Ontology(O directive1 … directiven) O rdf:type owl:Ontology .
T(directive1) … T(directiven)
Ontology(directive1 … directiven) O rdf:type owl:Ontology .
T(directive1) … T(directiven)
Annotation(ontologyPropertyID URIreference) ontologyPropertyID rdf:type owl:OntologyProperty .
O ontologyPropertyID URIreference .
URIreference rdf:type owl:Ontology .
Annotation(annotationPropertyID URIreference) annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
O annotationPropertyID URIreference .
Annotation(annotationPropertyID dataLiteral) annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
O annotationPropertyID T(dataLiteral) .
Annotation(annotationPropertyID individual) annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
O annotationPropertyID T(individual) .
rdfs:Literal rdfs:Literal
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 . [opt if there is a triple in the translation of the ontology that types the individualvaluedPropertyID as owl:InverseFunctionalProperty, owl:TransitiveProperty, or owl:SymmetricProperty] .
individualvaluedPropertyID rdf:type rdf:Property . [opt]
individualvalued-
PropertyID
dataLiteral dataLiteral dataLiteral
Individual(iID annotation1 … annotationm
      
type(type1)type(typen)
      value(pID1 v1)value(pIDk vk))
iID T(annotation1) … iID T(annotationm)
iID rdf:type T(type1) . … iID rdf:type T(typen) .
iID T(pID1) T(v1) . … iID T(pIDk) T(vk) .
iID
Individual(annotation1 … annotationm
      type(type1)type(typen)
      value(pID1 v1)value(pIDk vk))
(With at least one type.)
_:x T(annotation1) … _:x T(annotationm)
_:x rdf:type T(type1) . … _:x rdf:type T(typen) .
_:x T(pID1) T(v1) . … _:x T(pIDk) T(vk) .
_:x
Individual(annotation1 … annotationm
      value(pID1 v1)value(pIDk vk))
_:x T(annotation1) … _:x T(annotationm)
_:x rdf:type owl:Thing .
_:x T(pID1) T(v1) . … _:x T(pIDk) T(vk) .
_:x
SameIndividual(iID1 … iIDn) iIDi owl:sameAs iIDi+1 . 1≤i<n
iIDi owl:sameAs iIDj . [opt] 1≤i≠j≤n
DifferentIndividuals(iID1 … iIDn) iIDi owl:differentFrom iIDj . OR
iIDj owl:differentFrom iIDi . 1≤i<j≤n
iIDj owl:differentFrom iIDi . [opt] 1≤i≠j≤n
DifferentIndividuals(iID1 … iIDn) _:x rdf:type owl:AllDifferent .
_:x owl:distinctMembers T(SEQ iID1 … iIDn) .
Class(classID [Deprecated] partial
      annotation1 … annotationm
      description1 … descriptionn)
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm)
classID rdfs:subClassOf T(description1) . …
classID rdfs:subClassOf T(descriptionn) .
Class(classID [Deprecated] complete
      annotation1 … annotationm
      description1 … descriptionn)
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm)
classID owl:intersectionOf T(SEQ description1…descriptionn) .
Class(classID [Deprecated] complete
      annotation1 … annotationm
      description)
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm)
classID owl:equivalentClass T(description) .
Class(classID [Deprecated] complete
      annotation1 … annotationm
      unionOf(description1 … descriptionn))
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm)
classID owl:unionOf T(SEQ description1…descriptionn) .
Class(classID [Deprecated] complete
      annotation1 … annotationm
      complementOf(description))
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm)
classID owl:complementOf T(description) .
EnumeratedClass(classID [Deprecated]
      annotation1 … annotationm
      iID1 … iIDn)
classID rdf:type owl:Class .
classID rdf:type rdfs:Class . [opt]
[classID rdf:type owl:DeprecatedClass .]
classID T(annotation1) … classID T(annotationm) .
classID owl:oneOf T(SEQ iID1…iIDn) .
DisjointClasses(description1 … descriptionn) T(descriptioni) owl:disjointWith T(descriptionj) . OR
T(descriptionj) owl:disjointWith T(descriptioni) . 1≤i<j≤n
T(descriptioni) owl:disjointWith T(descriptionj) . [opt] 1≤i≠j≤n
EquivalentClasses(description1 … descriptionn) T(descriptioni) owl:equivalentClass T(descriptionj) .
for all <i,j> in G where G is a set of pairs over {1,...,n}x{1,...,n}
that if interpreted as an undirected graph forms a connected graph for {1,...,n}
SubClassOf(description1 description2) T(description1) rdfs:subClassOf T(description2) .
Datatype(datatypeID [Deprecated]
      annotation1 … annotationm )
datatypeID rdf:type rdfs:Datatype .
datatypeID rdf:type rdfs:Class . [opt]
[datatypeID rdf:type owl:DeprecatedClass .]
datatypeID T(annotation1) … datatypeID T(annotationm)
unionOf(description1 … descriptionn) _:x rdf:type owl:Class .
_:x rdf:type rdfs:Class . [opt]
_:x owl:unionOf T(SEQ description1…descriptionn) .
_:x
intersectionOf(description1 … descriptionn) _:x rdf:type owl:Class .
_:x rdf:type rdfs:Class . [opt]
_:x owl:intersectionOf T(SEQ description1…descriptionn) .
_:x
complementOf(description) _:x rdf:type owl:Class .
_:x rdf:type rdfs:Class . [opt]
_:x owl:complementOf T(description) .
_:x
oneOf(iID1 … iIDn) _:x rdf:type owl:Class .
_:x rdf:type rdfs:Class . [opt]
_:x owl:oneOf T(SEQ iID1…iIDn) .
_:x
oneOf(v1 … vn) _:x rdf:type owl:DataRange .
_:x rdf:type rdfs:Class . [opt]
_:x owl:oneOf T(SEQ v1 … vn) .
_:x
restriction(ID component1 … componentn)
(With at least two components)
_:x rdf:type owl:Class .
_:x rdf:type rdfs:Class . [opt]
_:x owl:intersectionOf
  T(SEQ(restriction(ID component1) … restriction(ID componentn))) .
_: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 [Deprecated]
      annotation1 … annotationm
      super(super1)super(supern)
      domain(domain1)
      domain(domaink)
      range(range1)
      range(rangeh)
      [Functional])
ID rdf:type owl:DatatypeProperty .
ID rdf:type rdf:Property . [opt]
[ID rdf:type owl:DeprecatedProperty .]
ID T(annotation1) … ID T(annotationm)
ID rdfs:subPropertyOf T(super1) . …
ID rdfs:subPropertyOf T(supern) .
ID rdfs:domain T(domain1) . …
ID rdfs:domain T(domaink) .
ID rdfs:range T(range1) . …
ID rdfs:range T(rangeh) .
[ID rdf:type owl:FunctionalProperty . ]
ObjectProperty(ID [Deprecated]
      annotation1 … annotationm
      super(super1)super(supern)
      domain(domain1)
      domain(domaink)
      range(range1)
      range(rangeh)
      [inverseOf(inverse)]
      [Functional |
       InverseFunctional |
       Transitive])
      [Symmetric]
ID rdf:type owl:ObjectProperty .
    [opt if one of the last three triples is included]
ID rdf:type rdf:Property . [opt]
[ID rdf:type owl:DeprecatedProperty .]
ID T(annotation1) … ID T(annotationm)
ID rdfs:subPropertyOf T(super1) . …
ID rdfs:subPropertyOf T(supern) .
ID rdfs:domain T(domain1) . …
ID rdfs:domain T(domaink) .
ID rdfs:range T(range1) . …
ID rdfs:range T(rangeh) .
[ID owl:inverseOf T(inverse) .]
[ID rdf:type owl:FunctionalProperty . ]
[ID rdf:type owl:InverseFunctionalProperty . ]
[ID rdf:type owl:TransitiveProperty . ]
[ID rdf:type owl:SymmetricProperty . ]
AnnotationProperty(ID
      annotation1 … annotationm)
ID rdf:type owl:AnnotationProperty .
ID rdf:type rdf:Property . [opt]
ID T(annotation1) … ID T(annotationm)
OntologyProperty(ID
      annotation1 … annotationm)
ID rdf:type owl:OntologyProperty .
ID rdf:type rdf:Property . [opt]
ID T(annotation1) … ID T(annotationm)
EquivalentProperties(dvpID1 … dvpIDn) T(dvpIDi) owl:equivalentProperty T(dvpIDi+1) . 1≤i<n
SubPropertyOf(dvpID1 dvpID2) T(dvpID1) rdfs:subPropertyOf T(dvpID2) .
EquivalentProperties(ivpID1 … ivpIDn) T(ivpIDi) owl:equivalentProperty T(ivpIDi+1) . 1≤i<n
SubPropertyOf(ivpID1 ivpID2) T(ivpID1) rdfs:subPropertyOf T(ivpID2) .
annotation(annotationPropertyID URIreference) annotationPropertyID URIreference .
annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
annotation(annotationPropertyID dataLiteral) annotationPropertyID T(dataLiteral) .
annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
annotation(annotationPropertyID individual) annotationPropertyID T(individual) .
annotationPropertyID rdf:type owl:AnnotationProperty .
annotationPropertyID rdf:type rdf:Property . [opt]
SEQ rdf:nil
SEQ item1…itemn _:l1 rdf:type rdf:List . [opt]
_:l1 rdf:first T(item1) . _:l1 rdf:rest _:l2 .

_:ln rdf:type rdf:List . [opt]
_:ln rdf:first T(itemn) . _:ln rdf:rest rdf:nil .
_:l1

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.

4.2. Definition of OWL DL and OWL Lite Ontologies in RDF Graph Form

When considering OWL Lite and DL ontologies in RDF graph form, care must be taken to prevent the use of certain vocabulary as OWL classes, properties, or individuals. If this is not done the built-in definitions or use of this vocabulary (in the RDF or OWL specification) would augment the information in the OWL ontology. Only some of the RDF vocabulary fits in this category, as some of the RDF vocabulary, such as rdf:subject, is given little or no meaning by the RDF specifications and its use does not present problems, as long as the use is consistent with any meaning given by the RDF specifications.

Definition: The disallowed vocabulary from RDF is rdf:type, rdf:Property, rdf:nil, rdf:List, rdf:first, rdf:rest, rdfs:domain, rdfs:range, rdfs:Resource, rdfs:Datatype, rdfs:Class, rdfs:subClassOf, rdfs:subPropertyOf, rdfs:member, rdfs:Container and rdfs:ContainerMembershipProperty. The disallowed vocabulary from OWL is owl:AllDifferent, owl:allValuesFrom, owl:AnnotationProperty, owl:cardinality, owl:Class, owl:complementOf, owl:DataRange, owl:DatatypeProperty, owl:DeprecatedClass, owl:DeprecatedProperty, owl:differentFrom, owl:disjointWith, owl:distinctMembers, owl:equivalentClass, owl:equivalentProperty, owl:FunctionalProperty, owl:hasValue, owl:intersectionOf, owl:InverseFunctionalProperty, owl:inverseOf, owl:maxCardinality, owl:minCardinality, owl:ObjectProperty, owl:oneOf, owl:onProperty, owl:Ontology, owl:OntologyProperty, owl:Restriction, owl:sameAs, owl:someValuesFrom, owl:SymmetricProperty, owl:TransitiveProperty, and owl:unionOf. The disallowed vocabulary is the union of the disallowed vocabulary from RDF and the disallowed vocabulary from OWL.

Definition: The class-only vocabulary is rdf:Statement, rdf:Seq, rdf:Bag, and rdf:Alt. The datatype-only vocabulary is the built-in OWL datatypes. The property-only vocabulary is rdf:subject, rdf:predicate, rdf:object, and all the container membership properties, i.e., rdf:_1, rdf:_2, ….

Definition: A collection of OWL DL ontologies and axioms and facts in abstract syntax form, O, has a separated vocabulary if

  1. the ontologies in O, taken together, do not use any URI reference as more than one of a class ID, a datatype ID, an individual ID, an individual-valued property ID, a data-valued property ID, an annotation property ID, an ontology property ID, or an ontology ID;
  2. the ontologies in O, taken together, provide a type for every individual ID;
  3. the ontologies in O, except as the values of annotations, only use the class-only vocabulary as class IDs; only use the datatype-only vocabulary as datatype IDs; only use rdfs:Literal in data ranges; only use the property-only vocabulary as datavaluedProperty IDs, individualvaluedProperty IDs, or annotationProperty IDs; only use the built-in classes as class IDs; only use the built-in datatypes as datatype IDs; only use the built-in annotation properties as annotationProperty IDs; only use the built-in ontology properties as ontologyProperty IDs; and do not mention any disallowed vocabulary.

Definition: An RDF graph is an OWL DL ontology in RDF graph form if it is equal (see below for a slight relaxation) to a result of the transformation to triples above of a collection of OWL DL ontologies and axioms and facts in abstract syntax form that has a separated vocabulary. 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:integer so long as the data value so encoded is a non-negative integer.

Definition: An RDF graph is an OWL Lite ontology in RDF graph form if it is as above except that the contents of O are OWL Lite ontologies or axioms or facts in abstract syntax form.