Difference between revisions of "Mapping to RDF Graphs"
(→Introduction and Preliminaries) 
(→Mapping from RDF Graphs to the Structural Specification) 

(4 intermediate revisions by 2 users not shown)  
Line 699:  Line 699:  
* Possible conditions on the pattern are enclosed in curly braces { }.  * Possible conditions on the pattern are enclosed in curly braces { }.  
* Some patterns use optional parts, which are enclosed in square brackets '[ ]'.  * Some patterns use optional parts, which are enclosed in square brackets '[ ]'.  
−  * The abbreviation <span class="name">T(SEQ y<sub>1</sub> ... y<sub>n</sub>)</span> denotes the pattern corresponding to RDF lists, as shown in Table 3.  +  * The abbreviation <span class="name">T(SEQ y<sub>1</sub> ... y<sub>n</sub>)</span> denotes the pattern corresponding to RDF lists, as shown in Table 3. When a list pattern is matched to ''G'', all variables <span class="name">y<sub>i</sub></span> and <span class="name">y<sub>j</sub></span> with <span class="name">i ≠ j</span> <em title="MUST in RFC 2119 context" class="RFC2119">MUST</em> be matched to different nodes; furthermore, it <em title="MUST NOT in RFC 2119 context" class="RFC2119">MUST NOT</em> be possible to match the list pattern to two maximal subsets of ''G'' such that some variable in the first pattern instance is matched to the same node as some (possibly different) variable in the second pattern instance. This is necessary in order to detect malformed lists such as lists with internal cycles, lists that share tails, and lists that cross. 
<div class="center">  <div class="center">  
Line 713:  Line 713:  
 class="name"  ''rdf:nil''   class="name"  ''rdf:nil''  
    
−   class="name"  SEQ y  +   class="name"  SEQ y 
−  +   _:x ''rdf:first'' y<br /> _:x ''rdf:rest'' ''rdf:nil''  
 class="name"  _:x   class="name"  _:x  
+    
+   class="name"  SEQ y<sub>1</sub> ... y<sub>n</sub><br /> { n>1 }  
+   class="name"  _:x<sub>1</sub> ''rdf:first'' y<sub>1</sub><br /> _:x<sub>1</sub> ''rdf:rest'' _:x<sub>2</sub><br /> ... <br /> _:x<sub>n</sub> ''rdf:first'' y<sub>n</sub><br /> _:x<sub>n</sub> ''rdf:rest'' ''rdf:nil''  
+   class="name"  _:x<sub>1</sub>  
    
}  }  
</div>  </div>  
+  
=== Extracting Declarations and the IRIs of the Directly Imported Ontology Documents ===  === Extracting Declarations and the IRIs of the Directly Imported Ontology Documents === 
Revision as of 18:38, 4 February 2009
__NUMBEREDHEADINGS__
 Document title:
 OWL 2 Web Ontology Language
Mapping to RDF Graphs (Second Edition)
 Editors
 Peter F. PatelSchneider, Bell Labs Research, AlcatelLucent
 Boris Motik, Oxford University
 Contributors (alphabetical order)
 Bernardo Cuenca Grau, Oxford University
 Ian Horrocks, Oxford University
 Bijan Parsia, University of Manchester
 Alan Ruttenberg, Science Commons (Creative Commons)
 Michael Schneider, FZI Research Center for Information Technology
 Abstract
 The OWL 2 Web Ontology Language, informally OWL 2, is an ontology language for the Semantic Web with formally defined meaning. OWL 2 ontologies provide classes, properties, individuals, and data values and are stored as Semantic Web documents. OWL 2 ontologies can be used along with information written in RDF, and OWL 2 ontologies themselves are primarily exchanged as RDF documents. The OWL 2 Document Overview describes the overall state of OWL 2, and should be read before other OWL 2 documents.
This document defines a mapping of OWL 2 ontology into the RDF syntax, and vice versa.  Status of this Document
Copyright © 20082009 W3C^{®} (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
Contents
1 Introduction and Preliminaries
This document defines mappings by means of which every OWL 2 ontology [OWL 2 Specification] can be mapped into an RDF graph and back. These transformations do not incur any change in the formal meaning of the ontology. More precisely, let O be any OWL 2 ontology, let T(O) be the RDF graph obtained by transforming O as specified in Section 2, and let O' be the OWL 2 ontology obtained by applying the reverse transformation from Section 3 to T(O); then, O and O' are logically equivalent — that is, they have exactly the same set of models.
The mappings presented in this document are backwardscompatible with that of OWL DL: every OWL DL ontology encoded as an RDF graph can be mapped into a valid OWL 2 ontology using the reversetransformation from Section 3 such that the resulting OWL 2 ontology has exactly the same set of models as the original OWL DL ontology.
The syntax for triples used in this document is the one used in the RDF Semantics [RDF Semantics]. Full IRIs are abbreviated using the namespaces from the OWL 2 Specification [OWL 2 Specification]. OWL 2 ontologies mentioned in this document should be understood as instances of the structural specification of OWL 2 [OWL 2 Specification]; when required, these are written in this document using the functionalstyle syntax.
The following notation is used throughout this document for referring to parts of RDF graphs:
 *:x denotes an IRI reference;
 _:x denotes a blank node;
 x denotes a blank node or an IRI reference; and
 lt denotes a literal.
The italicized keywords MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are used to specify normative features of OWL 2 documents and tools, and are interpreted as specified in RFC 2119 [RFC 2119].
2 Mapping from the Structural Specification to RDF Graphs
This section defines a mapping of an OWL 2 ontology O into an RDF graph T(O). The mapping is presented in three parts. Section 2.1 shows how to translate axioms that do not contain annotations, Section 2.2 shows how to translate annotations, and Section 2.3 shows how to translate axioms containing annotations.
2.1 Translation of Axioms without Annotations
Table 1 presents the operator T that maps an OWL 2 ontology O into an RDF graph T(O), provided that no axiom in O is annotated. The mapping is defined recursively; that is, the mapping of a construct often depends on the mappings of its subconstructs, but in a slightly unusual way: if the mapping of a construct refers to the mapping of a subconstruct, then the triples generated by the recursive invocation of T are added to the graph under construction, and its main node is used in place of the invocation itself.
The definition of the operator T uses the operator TANN in order to translate annotations. The operator TANN is defined in Section 2.2. It takes an annotation and an IRI reference or a blank node and produces the triples that attach the annotation to the supplied object.
In the mapping, each generated blank node (i.e., each blank node that does not correspond to an anonymous individual) is fresh in each application of a mapping rule. Furthermore, the following conventions are used in this section to denote different parts of OWL 2 ontologies:
 OP denotes an object property;
 OPE denotes an object property expression;
 DP denotes a data property;
 DPE denotes a data property expression;
 PE denotes an object or a data property expression;
 AP denotes an annotation property;
 C denotes a class;
 CE denotes a class expression;
 DT denotes a datatype;
 DR denotes a data range;
 U denotes an IRI;
 F denotes a constraining facet;
 a denotes an individual (named or anonymous);
 *:a denotes a named individual;
 lt denotes a literal;
 as denotes an annotation source; and
 av denotes an annotation value.
In this section, T(SEQ y_{1} ... y_{n}) denotes the translation of a sequence of objects from the structural specification into an RDF list, as shown in Table 1.
Element E of the Structural Specification  Triples Generated in an Invocation of T(E)  Main Node of T(E) 

SEQ  rdf:nil  
SEQ y_{1} ... y_{n}  _:x rdf:first T(y_{1}) _:x rdf:rest T(SEQ y_{2} ... y_{n}) 
_:x 
Ontology( ontologyIRI [ versionIRI ] Import( importedOntologyIRI_{1} ) ... Import( importedOntologyIRI_{k} ) annotation_{1} ... annotation_{m} axiom_{1} ... axiom_{n} ) 
ontologyIRI rdf:type owl:Ontology [ ontologyIRI owl:versionInfo versionIRI ] ontologyIRI owl:imports importedOntologyIRI_{1} ... ontologyIRI owl:imports importedOntologyIRI_{k} TANN(annotation_{1}, ontologyIRI) ... TANN(annotation_{m}, ontologyIRI) T(axiom_{1}) ... T(axiom_{n}) 
ontologyIRI 
Ontology( Import( importedOntologyIRI_{1} ) ... Import( importedOntologyIRI_{k} ) annotation_{1} ... annotation_{m} axiom_{1} ... axiom_{n} ) 
_:x rdf:type owl:Ontology _:x owl:imports importedOntologyIRI_{1} ... _:x owl:imports importedOntologyIRI_{k} TANN(annotation_{1}, _:x) ... TANN(annotation_{m}, _:x) T(axiom_{1}) ... T(axiom_{n}) 
_:x 
C  C  
DT  DT  
OP  OP  
DP  DP  
AP  AP  
U  U  
a  a  
lt  lt  
Declaration( Datatype( DT ) )  T(DT) rdf:type rdfs:Datatype  
Declaration( Class( C ) )  T(C) rdf:type owl:Class  
Declaration( ObjectProperty( OP ) )  T(OP) rdf:type owl:ObjectProperty  
Declaration( DataProperty( DP ) )  T(DP) rdf:type owl:DatatypeProperty  
Declaration( AnnotationProperty( AP ) )  T(AP) rdf:type owl:AnnotationProperty  
Declaration( NamedIndividual( *:a ) )  T(*:a) rdf:type owl:NamedIndividual  
InverseOf( OP )  _:x owl:inverseOf T(OP)  _:x 
IntersectionOf( DR_{1} ... DR_{n} )  _:x rdf:type rdfs:Datatype _:x owl:intersectionOf T(SEQ DR_{1} ... DR_{n}) 
_:x 
UnionOf( DR_{1} ... DR_{n} )  _:x rdf:type rdfs:Datatype _:x owl:unionOf T(SEQ DR_{1} ... DR_{n}) 
_:x 
ComplementOf( DR )  _:x rdf:type rdfs:Datatype _:x owl:datatypeComplementOf T(DR) 
_:x 
OneOf( lt_{1} ... lt_{n} )  _:x rdf:type rdfs:Datatype _:x owl:oneOf T(SEQ lt_{1} ... lt_{n}) 
_:x 
DatatypeRestriction( DT F_{1} lt_{1} ... F_{n} lt_{n} ) 
_:x rdf:type rdfs:Datatype _:x owl:onDatatype T(DT) _:x owl:withRestrictions T(SEQ _:y_{1} ... _:y_{n}) _:y_{1} F_{1} lt_{1} ... _:y_{n} F_{n} lt_{n} 
_:x 
IntersectionOf( CE_{1} ... CE_{n} )  _:x rdf:type owl:Class _:x owl:intersectionOf T(SEQ CE_{1} ... CE_{n}) 
_:x 
UnionOf( CE_{1} ... CE_{n} )  _:x rdf:type owl:Class _:x owl:unionOf T(SEQ CE_{1} ... CE_{n}) 
_:x 
ComplementOf( CE )  _:x rdf:type owl:Class _:x owl:complementOf T(CE) 
_:x 
OneOf( a_{1} ... a_{n} )  _:x rdf:type owl:Class _:x owl:oneOf T(SEQ a_{1} ... a_{n}) 
_:x 
SomeValuesFrom( OPE CE )  _:x rdf:type owl:Restriction _:x owl:onProperty T(OPE) _:x owl:someValuesFrom T(CE) 
_:x 
AllValuesFrom( OPE CE )  _:x rdf:type owl:Restriction _:x owl:onProperty T(OPE) _:x owl:allValuesFrom T(CE) 
_:x 
HasValue( OPE a )  _:x rdf:type owl:Restriction _:x owl:onProperty T(OPE) _:x owl:hasValue T(a) 
_:x 
HasSelf( OPE )  _:x rdf:type owl:Restriction _:x owl:onProperty T(OPE) _:x owl:hasSelf "true"^^xsd:boolean 
_:x 
MinCardinality( n OPE )  _:x rdf:type owl:Restriction _:x owl:minCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) 
_:x 
MinCardinality( n OPE CE )  _:x rdf:type owl:Restriction _:x owl:minQualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) _:x owl:onClass T(CE) 
_:x 
MaxCardinality( n OPE )  _:x rdf:type owl:Restriction _:x owl:maxCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) 
_:x 
MaxCardinality( n OPE CE )  _:x rdf:type owl:Restriction _:x owl:maxQualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) _:x owl:onClass T(CE) 
_:x 
ExactCardinality( n OPE )  _:x rdf:type owl:Restriction _:x owl:cardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) 
_:x 
ExactCardinality( n OPE CE )  _:x rdf:type owl:Restriction _:x owl:qualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(OPE) _:x owl:onClass T(CE) 
_:x 
SomeValuesFrom( DPE DR )  _:x rdf:type owl:Restriction _:x owl:onProperty T(DPE) _:x owl:someValuesFrom T(DR) 
_:x 
SomeValuesFrom( DPE_{1} ... DPE_{n} DR ), n ≥ 2  _:x rdf:type owl:Restriction _:x owl:onProperties T(SEQ DPE_{1} ... DPE_{n}) _:x owl:someValuesFrom T(DR) 
_:x 
AllValuesFrom( DPE DR )  _:x rdf:type owl:Restriction _:x owl:onProperty T(DPE) _:x owl:allValuesFrom T(DR) 
_:x 
AllValuesFrom( DPE_{1} ... DPE_{n} DR ), n ≥ 2  _:x rdf:type owl:Restriction _:x owl:onProperties T(SEQ DPE_{1} ... DPE_{n}) _:x owl:allValuesFrom T(DR) 
_:x 
HasValue( DPE lt )  _:x rdf:type owl:Restriction _:x owl:onProperty T(DPE) _:x owl:hasValue T(lt) 
_:x 
MinCardinality( n DPE )  _:x rdf:type owl:Restriction _:x owl:minCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) 
_:x 
MinCardinality( n DPE DR )  _:x rdf:type owl:Restriction _:x owl:minQualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) _:x owl:onDataRange T(DR) 
_:x 
MaxCardinality( n DPE )  _:x rdf:type owl:Restriction _:x owl:maxCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) 
_:x 
MaxCardinality( n DPE DR )  _:x rdf:type owl:Restriction _:x owl:maxQualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) _:x owl:onDataRange T(DR) 
_:x 
ExactCardinality( n DPE )  _:x rdf:type owl:Restriction _:x owl:cardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) 
_:x 
ExactCardinality( n DPE DR )  _:x rdf:type owl:Restriction _:x owl:qualifiedCardinality "n"^^xsd:nonNegativeInteger _:x owl:onProperty T(DPE) _:x owl:onDataRange T(DR) 
_:x 
SubClassOf( CE_{1} CE_{2} )  T(CE_{1}) rdfs:subClassOf T(CE_{2})  
EquivalentClasses( CE_{1} ... CE_{n} )  T(CE_{1}) owl:equivalentClass T(CE_{2}) ... T(CE_{n1}) owl:equivalentClass T(CE_{n}) 

DisjointClasses( CE_{1} CE_{2} )  T(CE_{1}) owl:disjointWith T(CE_{2})  
DisjointClasses( CE_{1} ... CE_{n} ), n > 2  _:x rdf:type owl:AllDisjointClasses _:x owl:members T(SEQ CE_{1} ... CE_{n}) 

DisjointUnion( C CE_{1} ... CE_{n} )  T(C) owl:disjointUnionOf T(SEQ CE_{1} ... CE_{n})  
SubPropertyOf( OPE_{1} OPE_{2} )  T(OPE_{1}) rdfs:subPropertyOf T(OPE_{2})  
SubPropertyOf( PropertyChain( OPE_{1} ... OPE_{n} ) OPE )  _:x rdfs:subPropertyOf T(OPE) _:x owl:propertyChain T(SEQ OPE_{1} ... OPE_{n}) 

EquivalentProperties( OPE_{1} ... OPE_{n} )  T(OPE_{1}) owl:equivalentProperty T(OPE_{2}) ... T(OPE_{n1}) owl:equivalentProperty T(OPE_{n}) 

DisjointProperties( OPE_{1} OPE_{2} )  T(op_{1}) owl:propertyDisjointWith T(op_{2})  
DisjointProperties( OPE_{1} ... OPE_{n} ), n > 2  _:x rdf:type owl:AllDisjointProperties _:x owl:members T(SEQ OPE_{1} ... OPE_{n}) 

PropertyDomain( OPE CE )  T(OPE) rdfs:domain T(CE)  
PropertyRange( OPE CE )  T(OPE) rdfs:range T(CE)  
InverseProperties( OPE_{1} OPE_{2} )  T(OPE_{1}) owl:inverseOf T(OPE_{2})  
FunctionalProperty( OPE )  T(OPE) rdf:type owl:FunctionalProperty  
InverseFunctionalProperty( OPE )  T(OPE) rdf:type owl:InverseFunctionalProperty  
ReflexiveProperty( OPE )  T(OPE) rdf:type owl:ReflexiveProperty  
IrreflexiveProperty( OPE )  T(OPE) rdf:type owl:IrreflexiveProperty  
SymmetricProperty( OPE )  T(OPE) rdf:type owl:SymmetricProperty  
AsymmetricProperty( OPE )  T(OPE) rdf:type owl:AsymmetricProperty  
TransitiveProperty( OPE )  T(OPE) rdf:type owl:TransitiveProperty  
SubPropertyOf( DPE_{1} DPE_{2} )  T(DPE_{1}) rdfs:subPropertyOf T(DPE_{2})  
EquivalentProperties( DPE_{1} ... DPE_{n} )  T(DPE_{1}) owl:equivalentProperty T(DPE_{2}) ... T(DPE_{n1}) owl:equivalentProperty T(DPE_{n}) 

DisjointProperties( DPE_{1} DPE_{2} )  T(DPE_{1}) owl:propertyDisjointWith T(DPE_{2})  
DisjointProperties( DPE_{1} ... DPE_{n} ), n > 2  _:x rdf:type owl:AllDisjointProperties _:x owl:members T(SEQ DPE_{1} ... DPE_{n}) 

PropertyDomain( DPE CE )  T(DPE) rdfs:domain T(CE)  
PropertyRange( DPE DR )  T(DPE) rdfs:range T(DR)  
FunctionalProperty( DPE )  T(DPE) rdf:type owl:FunctionalProperty  
HasKey( CE PE_{1} ... PE_{n} )  T(CE) owl:hasKey T(SEQ PE_{1} ... PE_{n}) 

SameIndividual( a_{1} ... a_{n} )  T(a_{1}) owl:sameAs T(a_{2}) ... T(a_{n1}) owl:sameAs T(a_{n}) 

DifferentIndividuals( a_{1} a_{2} )  T(a_{1}) owl:differentFrom T(a_{2})  
DifferentIndividuals( a_{1} ... a_{n} ), n > 2  _:x rdf:type owl:AllDifferent _:x owl:members T(SEQ a_{1} ... a_{n}) 

ClassAssertion( CE a )  T(a) rdf:type T(CE)  
PropertyAssertion( OP a_{1} a_{2} )  T(a_{1}) T(OP) T(a_{2})  
PropertyAssertion( InverseOf( OP ) a_{1} a_{2} )  T(a_{2}) T(OP) T(a_{1})  
NegativePropertyAssertion( OPE a_{1} a_{2} )  _:x rdf:type owl:NegativePropertyAssertion _:x owl:sourceIndividual T(a_{1}) _:x owl:assertionProperty T(OPE) _:x owl:targetIndividual T(a_{2}) 

PropertyAssertion( DPE a lt )  T(a) T(DPE) T(lt)  
NegativePropertyAssertion( DPE a lt )  _:x rdf:type owl:NegativePropertyAssertion _:x owl:sourceIndividual T(a) _:x owl:assertionProperty T(DPE) _:x owl:targetValue T(lt) 

AnnotationAssertion( AP as av )  T(as) T(AP) T(av)  
SubPropertyOf( AP_{1} AP_{2} )  T(AP_{1}) rdfs:subPropertyOf T(AP_{2})  
PropertyDomain( AP U )  T(AP) rdfs:domain T(U)  
PropertyRange( AP U )  T(AP) rdfs:range T(U) 
2.2 Translation of Annotations
The operator TANN, which translates annotations and attaches them to an IRI reference or a blank node, is defined in Table 2.
Annotation ann  Triples Generated in an Invocation of TANN(ann, y) 

Annotation( AP av )  T(y) T(AP) T(av) 
Annotation( annotation_{1} ... annotation_{n} AP av ) 
T(y) T(AP) T(av) _:x rdf:type owl:Annotation _:x owl:subject T(y) _:x owl:predicate T(AP) _:x owl:object T(av) TANN(annotation_{1}, _:x) ... TANN(annotation_{n}, _:x) 
Consider the following axiom that associates the IRI a:Peter with a simple label.
AnnotationAssertion( rdfs:label a:Peter "Peter Griffin" )
This axiom is translated into the following triple:
a:Peter rdfs:label "Peter Griffin"^^xsd:string
Consider the following axiom that associates a:Peter with an annotation containing a nested annotation.
AnnotationAssertion( a:Peter
Annotation(
Annotation( a:author a:Seth_MacFarlane )
rdfs:label "Peter Griffin"
)
)
This axiom is translated into the following triples:
a:Peter rdfs:label "Peter Griffin"^^xsd:string
_:x rdf:type owl:Annotation
_:x owl:subject a:Peter
_:x owl:predicate rdfs:label
_:x owl:object "Peter Griffin"^^xsd:string
_:x a:auhtor a:Seth_MacFarlane
2.3 Translation of Axioms with Annotations
If an axiom ax contains embedded annotations annotation_{1} ... annotation_{m}, its serialization into RDF depends on the type of the axiom. Let ax' be the axiom that is obtained from ax by removing all axiom annotations.
2.3.1 Axioms that Generate a Single Triple or that Have a Main Triple
If ax' is translated into a single RDF triple s p o, then the axiom ax is translated into the following triples:
s p o
_:x rdf:type owl:Axiom
_:x owl:subject s
_:x owl:predicate p
_:x owl:object o
TANN(annotation_{1}, _:x)
...
TANN(annotation_{m}, _:x)
This is the case for the following axioms: SubClassOf, DisjointClasses with two classes, SubPropertyOf without a property chain as the subproperty expression, PropertyDomain, PropertyRange, InverseProperties, FunctionalProperty, InverseFunctionalProperty, ReflexiveProperty, IrreflexiveProperty, SymmetricProperty, AsymmetricProperty, TransitiveProperty, DisjointProperties with two properties, ClassAssertion, PropertyAssertion, Declaration, DifferentIndividuals with two individuals, and AnnotationAssertion.
Consider the following subclass axiom:
SubClassOf( Annotation( rdfs:comment "Children are people." ) a:Child a:Person )
Without the annotation, the axiom would be translated into the following triple:
a:Child rdfs:subClassOf a:Person
Thus, the annotated axiom is transformed into the following triples:
a:Child rdfs:subClassOf a:Person
_:x rdf:type owl:Axiom
_:x owl:subject a:Child
_:x owl:predicate rdfs:subClassOf
_:x owl:object a:Person
_:x rdfs:comment "Children are people."^^xsd:string
DisjointUnion, SubPropertyOf with a subproperty chain, and HasKey axioms are, without annotations, translated into several, and not a single triple. If such such axioms are annotated, then the main triple is subjected to the transformation described above. The other triples — called side triples — are output without any change.
Consider the following subproperty axiom:
SubPropertyOf( Annotation( rdfs:comment "An aunt is a mother's sister." ) PropertyChain( a:hasMother a:hasSister ) a:hasAunt ) )
Without the annotation, the axiom would be translated into the following triples:
_:y rdfs:subPropertyOf a:hasAunt
_:y owl:propertyChain _:z_{1}
_:z_{1} rdf:first a:hasMother
_:z_{1} rdf:rest _:z_{2}
_:z_{2} rdf:first a:hasSister
_:z_{2} rdf:rest rdf:nil
In order to capture the annotation on the axiom, the first triple plays the role of the main triple for the axiom, so it is represented using a fresh blank node _:x in order to be able to attach the annotation to it. The original triple is output alongside all other triples as well.
_:x rdf:type owl:Axiom
_:x owl:subject _:y
_:x owl:predicate rdfs:subPropertyOf
_:x owl:object a:hasAunt
_:x rdfs:comment "An aunt is a mother's sister."^^xsd:string
_:y rdfs:subPropertyOf a:hasAunt
_:y owl:propertyChain _:z_{1}
_:z_{1} rdf:first a:hasMother
_:z_{1} rdf:rest _:z_{2}
_:z_{2} rdf:first a:hasSister
_:z_{2} rdf:rest rdf:nil
Consider the following key axiom:
HasKey( Annotation( rdfs:comment "SSN uniquely determines a person." ) a:Person a:hasSSN )
Without the annotation, the axiom would be translated into the following triples:
a:Person owl:hasKey _:y
_:y rdf:first a:hasSSN
_:y rdf:rest rdf:nil
In order to capture the annotation on the axiom, the first triple plays the role of the main triple for the axiom, so it is represented using a fresh blank node _:x in order to be able to attach the annotation to it.
_:x rdf:type owl:Axiom
_:x owl:subject a:Person
_:x owl:predicate owl:hasKey
_:x owl:object _:y
_:x rdfs:comment "SSN uniquely determines a person."^^xsd:string
a:Person owl:hasKey _:y
_:y rdf:first a:hasSSN
_:y rdf:rest rdf:nil
2.3.2 Axioms that are Translated to Multiple Triples
If the axiom ax' is of type EquivalentClasses, EquivalentProperties, or SameIndividual, its translation into RDF can be broken up into several RDF triples (because RDF can only represent binary relations). In this case, each of the RDF triples obtained by the translation of ax' is transformed as described in previous section, and the annotations are repeated for each of the triples obtained in the translation.
Consider the following individual equality axiom:
SameIndividual( Annotation( a:source a:Fox ) a:Meg a:Megan a:Megan_Griffin )
This axiom is first split into the following equalities between pairs of individuals, and the annotation is repeated on each axiom obtained in this process:
SameIndividual( Annotation( a:source a:Fox ) a:Meg a:Megan )
SameIndividual( Annotation( a:source a:Fox ) a:Megan a:Megan_Griffin )
Each of these axioms is now transformed into triples as explained in the previous section:
a:Meg owl:sameAs a:Megan
_:x_{1} rdf:type owl:Axiom
_:x_{1} owl:subject a:Meg
_:x_{1} owl:predicate owl:sameAs
_:x_{1} owl:object a:Megan
_:x_{1} a:source a:Fox
a:Megan owl:sameAs a:Megan_Griffin
_:x_{2} rdf:type owl:Axiom
_:x_{2} owl:subject a:Megan
_:x_{2} owl:predicate owl:sameAs
_:x_{2} owl:object a:Megan_Griffin
_:x_{2} a:source a:Fox
2.3.3 Axioms Represented by Blank Nodes
If the axiom ax' is of type NegativePropertyAssertion, DisjointClasses with more than two classes, DisjointObjectProperties or DisjointDataProperties with more than two properties, or DifferentIndividuals with more than two individuals, then its translation already requires introducing a blank node _:x. In such cases, ax is translated by first translating ax' into _:x as shown in Table 1, and then attaching the annotations of ax to _:x.
Consider the following negative property assertion:
NegativePropertyAssertion( Annotation( a:author a:Seth_MacFarlane ) a:brotherOf a:Chris a:Stewie )
Even without the annotation, this axiom would be represented using a blank node. The annotation can readily be attached to this node, so the axiom is transformed into the following triples:
_:x rdf:type owl:NegativePropertyAssertion
_:x owl:sourceIndividual a:Chris
_:x owl:assertionProperty a:brotherOf
_:x owl:targetIndividual a:Stewie
_:x a:author a:Seth_MacFarlane
3 Mapping from RDF Graphs to the Structural Specification
This section specifies the results of steps CP2.2 and CP3.3 of the canonical parsing process from Section 3.6 of the OWL 2 Specification [OWL 2 Specification] on an ontology document D that can be parsed into an RDF graph G. An OWL 2 tool MAY implement these steps in any way it chooses; however, the results MUST be structurally equivalent to the ones defined in the following sections. These steps do not depend on the RDF syntax used to encode the RDF graph in D; therefore, the ontology document D is identified in this section with the corresponding RDF graph G.
An RDF syntax ontology document is any sequence of octets accessible from some given IRI that can be parsed into an RDF graph, and that then be transformed into an OWL 2 ontology by the canonical parsing process instantiated as specified in this section.
The following sections contain rules in which triple patterns are matched to G. If a triple pattern contains a variable number of triples, the maximal possible subset of G MUST be matched. The following notation is used in the patterns:
 The notation NN_INT(n) can be matched to any literal whose value n is a nonnegative integer.
 Possible conditions on the pattern are enclosed in curly braces { }.
 Some patterns use optional parts, which are enclosed in square brackets '[ ]'.
 The abbreviation T(SEQ y_{1} ... y_{n}) denotes the pattern corresponding to RDF lists, as shown in Table 3. When a list pattern is matched to G, all variables y_{i} and y_{j} with i ≠ j MUST be matched to different nodes; furthermore, it MUST NOT be possible to match the list pattern to two maximal subsets of G such that some variable in the first pattern instance is matched to the same node as some (possibly different) variable in the second pattern instance. This is necessary in order to detect malformed lists such as lists with internal cycles, lists that share tails, and lists that cross.
Sequence S  Triples Corresponding to T(S)  Main Node of T(S) 

SEQ  rdf:nil  
SEQ y  _:x rdf:first y _:x rdf:rest rdf:nil 
_:x 
SEQ y_{1} ... y_{n} { n>1 } 
_:x_{1} rdf:first y_{1} _:x_{1} rdf:rest _:x_{2} ... _:x_{n} rdf:first y_{n} _:x_{n} rdf:rest rdf:nil 
_:x_{1} 
3.1 Extracting Declarations and the IRIs of the Directly Imported Ontology Documents
This section specifies the result of step CP2.2 of the canonical parsing process on an RDF graph G
3.1.1 Resolving Included RDF Graphs
For backwards compatibility with OWL DL, if G contains an owl:imports triple pointing to an RDF graph G' and G' does not have an ontology header, this owl:imports triple is interpreted as an include rather than an import — that is, the triples of G' are included into G and are not parsed into a separate ontology. To achieve this, the following transformation is applied to G as long as the following rule is applicable to G.
If G contains a pair of triples of the form
x rdf:type owl:Ontology
x owl:imports *:y
and the values for x and *:y have not already been considered, the following actions are performed:
 The ontology document accessible from the IRI *:y is retrieved as specified in Section 3.2 of the OWL 2 Specification [OWL 2 Specification].
 The document is parsed into an RDF graph G' using an appropriate RDF syntax.
 If the parsing succeeds and the graph G' does not contain a triple of the form z rdf:type owl:Ontologythen G' is merged (as in RDF Semantics [RDF Semantics]) into G and the triplex owl:imports *:yis removed from G.
3.1.2 Parsing of the Ontology Header and Declarations
Next, the ontology header is extracted from G by matching patterns from Table 4 to G. It MUST be possible to match exactly one such pattern to G in exactly one way. The matched triples are removed from G. The set Imp(G) of the IRIs of ontology documents that are directly imported into G contains exactly all *:z_{1}, ..., *:z_{k} that are matched in the pattern.
If G contains this pattern...  ...then the ontology header has this form. 

*:x rdf:type owl:Ontology [ *:x owl:versionInfo *:y ] *:x owl:imports *:z_{1} ... *:x owl:imports *:z_{k} { The following triple pattern cannot be matched in G: u w *:x u rdf:type owl:Ontology w rdf:type owl:OntologyProperty } 
Ontology( *:x [ *:y ] Import( *:z_{1} ) ... Import( *:z_{k} ) ... ) 
_:x rdf:type owl:Ontology _:x owl:imports *:z_{1} ... _:x owl:imports *:z_{k} { The following triple pattern cannot be matched in G: u w _:x u rdf:type owl:Ontology w rdf:type owl:OntologyProperty } 
Ontology( Import( *:z_{1} ) ... Import( *:z_{k} ) ... ) 
Next, for backwards compatibility with OWL DL, certain redundant triples are removed from G. In particular, if the triple pattern from the lefthand side of Table 5 is matched in G, then the triples on the righthand side of Table 5 are removed from G.
If G contains this pattern...  ...then these triples are removed from G. 

x rdf:type owl:Ontology  x rdf:type owl:Ontology 
x rdf:type owl:Class x rdf:type rdfs:Class 
x rdf:type rdfs:Class 
x rdf:type rdfs:Datatype x rdf:type rdfs:Class 
x rdf:type rdfs:Class 
x rdf:type owl:DataRange x rdf:type rdfs:Class 
x rdf:type rdfs:Class 
x rdf:type owl:Restriction x rdf:type rdfs:Class 
x rdf:type rdfs:Class 
x rdf:type owl:Restriction x rdf:type owl:Class 
x rdf:type owl:Class 
x rdf:type owl:ObjectProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:FunctionalProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:InverseFunctionalProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:TransitiveProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:DatatypeProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:AnnotationProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type owl:OntologyProperty x rdf:type rdf:Property 
x rdf:type rdf:Property 
x rdf:type rdf:List x rdf:first y x rdf:rest z 
x rdf:type rdf:List 
Next, for backwards compatibility with OWL DL, G is modified such that declarations can be properly extracted in the next step. When a triple pattern from the first column of Table 6 is matched in G, the matching triples are replaced in G with the triples from the second column. This matching phase stops when matching a pattern and replacing it as specified does not change G. Note that G is a set and thus cannot contain duplicate triples, so this last condition prevents infinite matches.
If G contains this pattern...  ...then the matched triples are replaced in G with these triples. 

*:x rdf:type owl:OntologyProperty  *:x rdf:type owl:AnnotationProperty 
*:x rdf:type owl:InverseFunctionalProperty  *:x rdf:type owl:ObjectProperty *:x rdf:type owl:InverseFunctionalProperty 
*:x rdf:type owl:TransitiveProperty  *:x rdf:type owl:ObjectProperty *:x rdf:type owl:TransitiveProperty 
*:x rdf:type owl:SymmetricProperty  *:x rdf:type owl:ObjectProperty *:x rdf:type owl:SymmetricProperty 
Next, the set of declarations Decl(G) is extracted from G according to Table 7. The matched triples are not removed from G — the triples from Table 7 can contain annotations so, in order to correctly parse the annotations, they will be matched again in the step described in Section 3.2.5.
If G contains this pattern...  ...then this declaration is added to Decl(G). 

*:x rdf:type owl:Class  Declaration( Class( *:x ) ) 
*:x rdf:type rdfs:Datatype  Declaration( Datatype( *:x ) ) 
*:x rdf:type owl:ObjectProperty  Declaration( ObjectProperty( *:x ) ) 
*:x rdf:type owl:DatatypeProperty  Declaration( DataProperty( *:x ) ) 
*:x rdf:type owl:AnnotationProperty  Declaration( AnnotationProperty( *:x ) ) 
*:x rdf:type owl:NamedIndividual  Declaration( NamedIndividual( *:x ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object owl:Class 
Declaration( Class( *:y ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object rdfs:Datatype 
Declaration( Datatype( *:y ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object owl:ObjectProperty 
Declaration( ObjectProperty( *:y ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object owl:DatatypeProperty 
Declaration( DataProperty( *:y ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object owl:AnnotationProperty 
Declaration( AnnotationProperty( *:y ) ) 
_:x rdf:type owl:Axiom _:x owl:subject *:y _:x owl:predicate rdf:type _:x owl:object owl:NamedIndividual 
Declaration( NamedIndividual( *:y ) ) 
Finally, the set RIND of anonymous individuals used in reification is identified. This is done by initially setting RIND = ∅ and then applying the patterns shown in Table 8. The matched triples are not deleted from G.
If G contains this pattern, then _:x is added to RIND. 

_:x rdf:type owl:Axiom 
_:x rdf:type owl:Annotation 
_:x rdf:type owl:AllDisjointClasses 
_:x rdf:type owl:AllDisjointProperties 
_:x rdf:type owl:AllDifferent 
_:x rdf:type owl:NegativePropertyAssertion 
3.2 Populating an Ontology
This section specifies the result of step CP3.3 of the canonical parsing process on an RDF graph G, the corresponding instance O_{G} of the Ontology class, and the set AllDecl(G) of all declarations for G computed as specified in step CP3.1 of the canonical parsing process.
3.2.1 Analyzing Declarations
The following functions map an IRI reference or a blank node x occurring in G into an object of the structural specification. In particular,
 CE(x) maps x into a class expression,
 DR(x) maps x into a data range,
 OPE(x) maps x into an object property expression,
 DPE(x) maps x into a data property expression, and
 AP(x) maps x into an annotation property.
Initially, these functions are undefined for all IRIs and blank nodes occurring in G; this is written as CE(x) = ε, DR(x) = ε, OPE(x) = ε, DPE(x) = ε, and AP(x) = ε. The functions are updated as parsing progresses. All of the following conditions MUST be satisfied at any given point in time during parsing.
 For each x, at most one of OPE(x), DPE(x), and AP(x) is defined.
 For each x, at most one of CE(x) and DR(x) is defined.
Furthermore, the value of any of these functions for any x MUST NOT be redefined during parsing (i.e., if a function is not undefined for x, no attempt should be made to change the function's value for x).
The function OPEorDPE is defined as follows:
 OPEorDPE(x) = OPE(x) if OPE(x) ≠ ε;
 OPEorDPE(x) = DPE(x) if DPE(x) ≠ ε; and
 OPEorDPE(x) = ε otherwise.
Functions CE, DR, OPE, DPE, and AP are initialized as shown in Table 9.
If AllDecl(G) contains this declaration...  ...then perform this assignment. 

Declaration( Class( *:x ) )  CE(*:x) := a class with the IRI *:x 
Declaration( Datatype( *:x ) )  DR(*:x) := a datatype with the IRI *:x 
Declaration( ObjectProperty( *:x ) )  OPE(*:x) := an object property with the IRI *:x 
Declaration( DataProperty( *:x ) )  DPE(*:x) := a data property with the IRI *:x 
Declaration( AnnotationProperty( *:x ) )  AP(*:x) := an annotation property with the IRI *:x 
3.2.2 Parsing of Annotations
The annotations in G are parsed next. The function ANN assigns a set of annotations ANN(x) to each IRI reference or a blank node x. This function is initialized by setting ANN(x) = ∅ for each each IRI reference or a blank node x. Next, the triple patterns from Table 10 are matched in G and, for each matched pattern, ANN(x) is extended with an annotation from the right column. Each time one of these triple patterns is matched, the matched triples are removed from G. This process is repeated until no further matches are possible.
If G contains this pattern...  ...then this annotation is added to ANN(x). 

x *:y z { AP(*:y) ≠ ε, z is an IRI reference or a blank node, and there is no blank node _:w such that G contains the triples _:w rdf:type owl:Annotation _:w owl:subject x _:w owl:predicate *:y _:w owl:object z } 
Annotation( *:y z ) 
x *:y z _:w rdf:type owl:Annotation _:w owl:subject x _:w owl:predicate *:y _:w owl:object z { AP(*:y) ≠ ε, z is an IRI reference or a blank node, and no other triple in G contains _:w in subject or object position } 
Annotation( ANN(_:w) *:y z ) 
3.2.3 Parsing of Ontology Annotations
Let x be the node that was matched in G to *:x or _:x according to the patterns from Table 4; then, ANN(x) determines the set of ontology annotations of O_{G}.
3.2.4 Parsing of Expressions
Next, functions OPE, DR, and CE are extended as shown in Tables 11, 12, and 13, as well as in Tables 14 and 15. The patterns in the latter two tables are not generated by the mapping from Section 2, but they can be present in RDF graphs that encode OWL DL ontologies. Each time a pattern is matched, the matched triples are removed from G. Pattern matching is repeated until no triple pattern can be matched to G.
If G contains this pattern...  ...then OPE(_:x) is set to this object property expression. 

_:x owl:inverseOf *:y { OPE(_:x) = ε and OPE(*:y) ≠ ε } 
InverseOf( OPE(*:y) ) 
If G contains this pattern...  ...then DR(_:x) is set to this data range. 

_:x rdf:type rdfs:Datatype _:x owl:intersectionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2 and DR(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
IntersectionOf( DR(y_{1}) ... DR(y_{n}) ) 
_:x rdf:type rdfs:Datatype _:x owl:unionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2 and DR(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
UnionOf( DR(y_{1}) ... DR(y_{n}) ) 
_:x rdf:type rdfs:Datatype _:x owl:datatypeComplementOf y { DR(y) ≠ ε } 
ComplementOf( DR(y) ) 
_:x rdf:type rdfs:Datatype _:x owl:oneOf T(SEQ lt_{1} ... lt_{n}) { n ≥ 1 } 
OneOf( lt_{1} ... lt_{n} ) 
_:x rdf:type rdfs:Datatype _:x owl:onDatatype *:y _:x owl:withRestrictions T(SEQ _:z_{1} ... _:z_{n}) _:z_{1} *:w_{1} lt_{1} ... _:z_{n} *:w_{n} lt_{n} { DR(*:y) is a datatype } 
DatatypeRestriction( DR(*:y) *:w_{1} lt_{1} ... *:w_{n} lt_{n} ) 
If G contains this pattern...  ...then CE(_:x) is set to this class expression. 

_:x rdf:type owl:Class _:x owl:intersectionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2 and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
IntersectionOf( CE(y_{1}) ... CE(y_{n}) ) 
_:x rdf:type owl:Class _:x owl:unionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2 and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
UnionOf( CE(y_{1}) ... CE(y_{n}) ) 
_:x rdf:type owl:Class _:x owl:complementOf y { CE(y) ≠ ε } 
ComplementOf( CE(y) ) 
_:x rdf:type owl:Class _:x owl:oneOf T(SEQ *:y_{1} ... *:y_{n}) { n ≥ 1 } 
OneOf( *:y_{1} ... *:y_{n} ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:someValuesFrom z { OPE(y) ≠ ε and CE(z) ≠ ε } 
SomeValuesFrom( OPE(y) CE(z) ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:allValuesFrom z { OPE(y) ≠ ε and CE(z) ≠ ε } 
AllValuesFrom( OPE(y) CE(z) ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:hasValue *:z { OPE(y) ≠ ε } 
HasValue( OPE(y) *:z ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:hasSelf "true"^^xsd:boolean { OPE(y) ≠ ε } 
HasSelf( OPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:minQualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onClass z { OPE(y) ≠ ε and CE(z) ≠ ε } 
MinCardinality( n OPE(y) CE(z) ) 
_:x rdf:type owl:Restriction _:x owl:maxQualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onClass z { OPE(y) ≠ ε and CE(z) ≠ ε } 
MaxCardinality( n OPE(y) CE(z) ) 
_:x rdf:type owl:Restriction _:x owl:qualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onClass z { OPE(y) ≠ ε and CE(z) ≠ ε } 
ExactCardinality( n OPE(y) CE(z) ) 
_:x rdf:type owl:Restriction _:x owl:minCardinality NN_INT(n) _:x owl:onProperty y { OPE(y) ≠ ε } 
MinCardinality( n OPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:maxCardinality NN_INT(n) _:x owl:onProperty y { OPE(y) ≠ ε } 
MaxCardinality( n OPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:cardinality NN_INT(n) _:x owl:onProperty y { OPE(y) ≠ ε } 
ExactCardinality( n OPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:hasValue lt { DPE(y) ≠ ε } 
HasValue( DPE(y) lt ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:someValuesFrom z { DPE(y) ≠ ε and DR(z) ≠ ε } 
SomeValuesFrom( DPE(y) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:onProperties T(SEQ y_{1} ... y_{n}) _:x owl:someValuesFrom z { DPE(y_{i}) ≠ ε for each 1 ≤ i ≤ n and DR(z) ≠ ε } 
SomeValuesFrom( DPE(y_{1}) ... DPE(y_{n}) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:onProperty y _:x owl:allValuesFrom z { DPE(y) ≠ ε and DR(z) ≠ ε } 
AllValuesFrom( DPE(y) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:onProperties T(SEQ y_{1} ... y_{n}) _:x owl:allValuesFrom z { DPE(y_{i}) ≠ ε for each 1 ≤ i ≤ n and DR(z) ≠ ε } 
AllValuesFrom( DPE(y_{1}) ... DPE(y_{n}) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:minQualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onDataRange z { DPE(y) ≠ ε and DR(z) ≠ ε } 
MinCardinality( n DPE(y) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:maxQualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onDataRange z { DPE(y) ≠ ε and DR(z) ≠ ε } 
MaxCardinality( n DPE(y) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:qualifiedCardinality NN_INT(n) _:x owl:onProperty y _:x owl:onDataRange z { DPE(y) ≠ ε and DR(z) ≠ ε } 
ExactCardinality( n DPE(y) DR(z) ) 
_:x rdf:type owl:Restriction _:x owl:minCardinality NN_INT(n) _:x owl:onProperty y { DPE(y) ≠ ε } 
MinCardinality( n DPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:maxCardinality NN_INT(n) _:x owl:onProperty y { DPE(y) ≠ ε } 
MaxCardinality( n DPE(y) ) 
_:x rdf:type owl:Restriction _:x owl:cardinality NN_INT(n) _:x owl:onProperty y { DPE(y) ≠ ε } 
ExactCardinality( n DPE(y) ) 
If G contains this pattern...  ...then DR(_:x) is set to this object property expression. 

_:x rdf:type owl:DataRange _:x owl:oneOf T(SEQ lt_{1} ... lt_{n}) { n ≥ 1 } 
OneOf( lt_{1} ... lt_{n} ) 
_:x rdf:type owl:DataRange _:x owl:oneOf T(SEQ) 
ComplementOf( rdfs:Literal ) 
If G contains this pattern...  ...then CE(_:x) is set to this class expression. 

_:x rdf:type owl:Class _:x owl:unionOf T(SEQ) 
owl:Nothing 
_:x rdf:type owl:Class _:x owl:unionOf T(SEQ y) { CE(y) ≠ ε } 
CE(y) 
_:x rdf:type owl:Class _:x owl:intersectionOf T(SEQ) 
owl:Thing 
_:x rdf:type owl:Class _:x owl:intersectionOf T(SEQ y) { CE(y) ≠ ε } 
CE(y) 
_:x rdf:type owl:Class _:x owl:oneOf T(SEQ) 
owl:Nothing 
3.2.5 Parsing of Axioms
Next, O_{G} is populated with axioms. For clarity, the axiom patterns are split into two tables.
 Table 16 presents the patterns for axioms without annotations.
 Annotated axioms are parsed as follows:
 In case of the patterns for owl:AllDisjointClasses, owl:AllDisjointProperties, owl:AllDifferent, and owl:NegativePropertyAssertion, axiom annotations are defined by ANN(_:x).
 For all other axioms, axiom annotations are obtained by additionally matching patterns from Table 17 in G during axiom matching.
The axioms in G are parsed as follows:
 All annotated axioms are parsed first.
 Only when no pattern for annotated axioms can be matched in G, then the patterns for axioms without annotations are matched.
In either case, each time a triple pattern is matched, the matched triples are removed from G.
If G contains this pattern...  ...then the following axiom is added to O_{G}. 

*:x rdf:type owl:Class  Declaration( Class( *:x ) ) 
*:x rdf:type rdfs:Datatype  Declaration( Datatype( *:x ) ) 
*:x rdf:type owl:ObjectProperty  Declaration( ObjectProperty( *:x ) ) 
*:x rdf:type owl:DatatypeProperty  Declaration( DataProperty( *:x ) ) 
*:x rdf:type owl:AnnotationProperty  Declaration( AnnotationProperty( *:x ) ) 
*:x rdf:type owl:NamedIndividual  Declaration( NamedIndividual( *:x ) ) 
x rdfs:subClassOf y { CE(x) ≠ ε and CE(y) ≠ ε } 
SubClassOf( CE(x) CE(y) ) 
x owl:equivalentClass y { CE(x) ≠ ε and CE(y) ≠ ε } 
EquivalentClasses( CE(x) CE(y) ) 
x owl:disjointWith y { CE(x) ≠ ε and CE(y) ≠ ε } 
DisjointClasses( CE(x) CE(y) ) 
_:x rdf:type owl:AllDisjointClasses _:x owl:members T(SEQ y_{1} ... y_{n}) { n ≥ 2 and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
DisjointClasses( CE(y_{1}) ... CE(y_{n}) ) 
x owl:disjointUnionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2, CE(x) ≠ ε, and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
DisjointUnion( CE(x) CE(y_{1}) ... CE(y_{n}) ) 
x rdfs:subPropertyOf y { OPE(x) ≠ ε and OPE(y) ≠ ε } 
SubPropertyOf( OPE(x) OPE(y) ) 
_:x rdfs:subPropertyOf y _:x owl:propertyChain T(SEQ x_{1} ... x_{n}) { n ≥ 2, OPE(x_{i}) ≠ ε for each 1 ≤ i ≤ n, and OPE(y) ≠ ε } 
SubPropertyOf( PropertyChain( OPE(x_{1}) ... OPE(x_{n}) ) OPE(y) ) 
x owl:equivalentProperty y { OPE(x) ≠ ε and OPE(y) ≠ ε } 
EquivalentProperties( OPE(x) OPE(y) ) 
x owl:propertyDisjointWith y { OPE(x) ≠ ε and OPE(y) ≠ ε } 
DisjointProperties( OPE(x) OPE(y) ) 
_:x rdf:type owl:AllDisjointProperties _:x owl:members T(SEQ y_{1} ... y_{n}) { n ≥ 2 and OPE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
DisjointProperties( OPE(y_{1}) ... OPE(y_{n}) ) 
x rdfs:domain y { OPE(x) ≠ ε and CE(y) ≠ ε } 
PropertyDomain( OPE(x) CE(y) ) 
x rdfs:range y { OPE(x) ≠ ε and CE(y) ≠ ε } 
PropertyRange( OPE(x) CE(y) ) 
x owl:inverseOf y { OPE(x) ≠ ε and OPE(y) ≠ ε } 
InverseProperties( OPE(x) OPE(y) ) 
x rdf:type owl:FunctionalProperty { OPE(x) ≠ ε } 
FunctionalProperty( OPE(x) ) 
x rdf:type owl:InverseFunctionalProperty { OPE(x) ≠ ε } 
InverseFunctionalProperty( OPE(x) ) 
x rdf:type owl:ReflexiveProperty { OPE(x) ≠ ε } 
ReflexiveProperty( OPE(x) ) 
x rdf:type owl:IrreflexiveProperty { OPE(x) ≠ ε } 
IrreflexiveProperty( OPE(x) ) 
x rdf:type owl:SymmetricProperty { OPE(x) ≠ ε } 
SymmetricProperty( OPE(x) ) 
x rdf:type owl:AsymmetricProperty { OPE(x) ≠ ε } 
AsymmetricProperty( OPE(x) ) 
x rdf:type owl:TransitiveProperty { OPE(x) ≠ ε } 
TransitiveProperty( OPE(x) ) 
x rdfs:subPropertyOf y { DPE(x) ≠ ε and DPE(y) ≠ ε } 
SubPropertyOf( DPE(x) DPE(y) ) 
x owl:equivalentProperty y { DPE(x) ≠ ε and DPE(y) ≠ ε } 
EquivalentProperties( DPE(x) DPE(y) ) 
x owl:propertyDisjointWith y { DPE(x) ≠ ε and DPE(y) ≠ ε } 
DisjointProperties( DPE(x) DPE(y) ) 
_:x rdf:type owl:AllDisjointProperties _:x owl:members T(SEQ y_{1} ... y_{n}) { n ≥ 2 and DPE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
DisjointProperties( DPE(y_{1}) ... DPE(y_{n}) ) 
x rdfs:domain y { DPE(x) ≠ ε and CE(y) ≠ ε } 
PropertyDomain( DPE(x) CE(y) ) 
x rdfs:range y { DPE(x) ≠ ε and DR(y) ≠ ε } 
PropertyRange( DPE(x) DR(y) ) 
x rdf:type owl:FunctionalProperty { DPE(x) ≠ ε } 
FunctionalProperty( DPE(x) ) 
x owl:hasKey T(SEQ y_{1} ... y_{n}) { n ≥ 1, CE(x) ≠ ε, and OPEorDPE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
HasKey( CE(x) OPEorDPE(y_{1}) ... OPEorDPE(y_{n}) ) 
x owl:sameAs y  SameIndividual( x y ) 
x owl:differentFrom y  DifferentIndividuals( x y ) 
_:x rdf:type owl:AllDifferent _:x owl:members T(SEQ x_{1} ... x_{n}) { n ≥ 2 } 
DifferentIndividuals( x_{1} ... x_{n} ) 
_:x rdf:type owl:AllDifferent _:x owl:distinctMembers T(SEQ x_{1} ... x_{n}) { n ≥ 2 } 
DifferentIndividuals( x_{1} ... x_{n} ) 
x rdf:type y { CE(y) ≠ ε } 
ClassAssertion( x CE(y) ) 
x *:y z { OPE(*:y) ≠ ε } 
PropertyAssertion( OPE(*:y) x z ) 
_:x rdf:type owl:NegativePropertyAssertion _:x owl:sourceIndividual w _:x owl:assertionProperty y _:x owl:targetIndividual z { OPE(y) ≠ ε } 
NegativePropertyAssertion( OPE(y) w z ) 
x *:y lt { DPE(*:y) ≠ ε } 
PropertyAssertion( DPE(*:y) x lt ) 
_:x rdf:type owl:NegativePropertyAssertion _:x owl:sourceIndividual w _:x owl:assertionProperty y _:x owl:targetValue lt { DPE(y) ≠ ε } 
NegativePropertyAssertion( DPE(y) w lt ) 
*:x rdf:type owl:DeprecatedClass  AnnotationAssertion( owl:deprecated *:x "true"^^xsd:boolean ) 
*:x rdf:type owl:DeprecatedProperty  AnnotationAssertion( owl:deprecated *:x "true"^^xsd:boolean ) 
*:x rdfs:subPropertyOf *:y { AP(*:x) ≠ ε and AP(*:y) ≠ ε } 
SubPropertyOf( AP(*:x) AP(*:y) ) 
*:x rdfs:domain *:y { AP(*:x) ≠ ε } 
PropertyDomain( AP(*:x) *:y ) 
*:x rdfs:range *:y { AP(*:x) ≠ ε } 
PropertyRange( AP(*:x) *:y ) 
If G contains this pattern...  ...then the following axiom is added to O_{G}. 

s *:p o _:x rdf:type owl:Axiom _:x owl:subject s _:x owl:predicate *:p _:x owl:object o { s *:p o is the main triple for an axiom according to Table 17 and G contains possible necessary side triples for the axiom } 
The result is the axiom corresponding to s *:p o (and possible side triples) that additionally contains the annotations ANN(_:x). 
Next, for each blank node or IRI reference x such that x ∉ RIND, and for each annotation Annotation( annotation_{1} ... annotation_{n} AP y ) ∈ ANN(x) with n possibly being equal to zero, the following annotation assertion is added to O_{G}:
AnnotationAssertion( annotation_{1} ... annotation_{n} AP x y )
Finally, the patterns from Table 18 are matched in G, the resulting axioms are added to O_{G}. These patterns are not generated by the mapping from Section 2, but they can be present in RDF graphs that encode OWL DL ontologies. (Note that the patterns from the table do not contain triples of the form *:x rdf:type owl:Class because such triples are removed while parsing the entity declarations, as specified in Section 3.1.2.) Each time a triple pattern is matched, the matched triples are removed from G.
If G contains this pattern...  ...then the following axiom is added to O_{G}. 

*:x owl:complementOf y { CE(*:x) ≠ ε and CE(y) ≠ ε } 
EquivalentClasses( CE(*:x) ComplementOf( CE(y) ) ) 
*:x owl:unionOf T(SEQ) { CE(*:x) ≠ ε } 
EquivalentClasses( CE(*:x) owl:Nothing ) 
*:x owl:unionOf T(SEQ y_{1}) { CE(*:x) ≠ ε and CE(y_{1}) ≠ ε } 
EquivalentClasses( CE(*:x) CE(y) ) 
*:x owl:unionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2, CE(*:x) ≠ ε, and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
EquivalentClasses( CE(*:x) UnionOf( CE(y_{1}) ... CE(y_{n}) ) ) 
*:x owl:intersectionOf T(SEQ) { CE(*:x) ≠ ε } 
EquivalentClasses( CE(*:x) owl:Thing ) 
*:x owl:intersectionOf T(SEQ y_{1}) { CE(*:x) ≠ ε and CE(y_{1}) ≠ ε } 
EquivalentClasses( CE(*:x) CE(y) ) 
*:x owl:intersectionOf T(SEQ y_{1} ... y_{n}) { n ≥ 2, CE(*:x) ≠ ε, and CE(y_{i}) ≠ ε for each 1 ≤ i ≤ n } 
EquivalentClasses( CE(*:x) IntersectionOf( CE(y_{1}) ... CE(y_{n}) ) ) 
*:x owl:oneOf T(SEQ) { CE(*:x) ≠ ε } 
EquivalentClasses( CE(*:x) owl:Nothing ) 
*:x owl:oneOf T(SEQ *:y_{1} ... *:y_{n}) { CE(*:x) ≠ ε } 
EquivalentClasses( CE(*:x) OneOf( *:y_{1} ... *:y_{n} ) ) 
At the end of this process, the graph G MUST be empty.
4 Acknowledgments
The starting point for the development of OWL 2 was the OWL1.1 member submission, itself a result of user and developer feedback, and in particular of information gathered during the OWL Experiences and Directions (OWLED) Workshop series. The working group also considered postponed issues from the WebOnt Working Group.
This document has been produced by the OWL Working Group (see below), and its contents reflect extensive discussions within the Working Group as a whole. The editors extend special thanks to Alan Ruttenberg (Science Commons), Uli Sattler (University of Manchester) and Evren Sirin (Clark & Parsia), for their thorough reviews.
The regular attendees at meetings of the OWL Working Group at the time of publication of this document were: Jie Bao (RPI), Diego Calvanese (Free University of BozenBolzano), Bernardo Cuenca Grau (Oxford University Computing Laboratory), Martin Dzbor (Open University), Achille Fokoue (IBM Corporation), Christine Golbreich (Université de Versailles StQuentin and LIRMM), Sandro Hawke (W3C/MIT), Ivan Herman (W3C/ERCIM), Rinke Hoekstra (University of Amsterdam), Ian Horrocks (Oxford University Computing Laboratory), Elisa Kendall (Sandpiper Software), Markus Krötzsch (FZI), Carsten Lutz (Universität Bremen), Deborah L. McGuinness (RPI), Boris Motik (Oxford University Computing Laboratory), Jeff Pan (University of Aberdeen), Bijan Parsia (University of Manchester), Peter F. PatelSchneider (Bell Labs Research, AlcatelLucent), Sebastian Rudolph (FZI), Alan Ruttenberg (Science Commons), Uli Sattler (University of Manchester), Michael Schneider (FZI), Mike Smith (Clark & Parsia), Evan Wallace (NIST), Zhe Wu (Oracle Corporation), and Antoine Zimmermann (DERI Galway). We would also like to thank past members of the working group: Jeremy Carroll, Jim Hendler, and Vipul Kashyap.
5 References
 [OWL 2 Specification]
 OWL 2 Web Ontology Language: Structural Specification and FunctionalStyle Syntax. Boris Motik, Peter F. PatelSchneider, and Bijan Parsia, eds., 2008
 [RDF Semantics]
 RDF Semantics. Patrick Hayes, Editor, W3C Recommendation, 10 February 2004
 [RFC 2119]
 RFC 2119: Key words for use in RFCs to Indicate Requirement Levels. Network Working Group, S. Bradner. Internet Best Current Practice, March 1997