Guide to OWL 2 for OWL 1 users

Aus Semantic-Web-Grundlagen

Wechseln zu: Navigation, Suche

Authors: Pascal Hitzler, Markus Krötzsch, Sebastian Rudolph.

This document is written for those who are familiar with OWL 1 and require an introduction to the differences between OWL 1 and OWL 2. The list of changes below is fairly complete but not exhaustive. It reflects the status of the discussions on OWL 2 as of 8th of April, 2009.

We assume that namespaces are declared as e.g. done in the OWL 2 Primer.

Inhaltsverzeichnis

Overview of Changes

OWL 2 is backward-compatible to OWL 1. In particular, OWL 1 expressed in RDF syntax remains valid OWL 2.

The types of changes can be categorized as follows.

  • New syntaxes: A new syntax, called the functional-style syntax, is the main syntax used in the OWL 2 documents. The user-friendly Manchester syntax is an update of the OWL 1 abstract syntax. The OWL 2 RDF syntax is backward compatible to OWL 1. In addition, there is an XML serialisation.
  • New species: OWL 2 Full and OWL 2 DL correspond roughly to OWL 1 Full and OWL 1 DL, respectively. Instead of an OWL Lite species, the OWL 2 documents specify three OWL 2 profiles, which are sublanguages designed for increased efficiency of reasoning.
  • Changes to type separation: Type separation requirements from OWL 1 are relaxed. Some changes in the semantics accommodate this. In particular, this allows for some simple metamodelling.
  • New syntactic sugar: New syntax has been introduced which essentially provides macros for some things which can be expressed in OWL 1, but only in a rather verbose way.
  • Language enhancements: New syntax has been introduced which exceeds the expressivitiy of OWL 1.

In the following, we focus on the language enhancements and on the new syntactic sugar, but we also say more about the other changes. We list the changes in more detail and explain them by examples.

Syntaxes

The following syntaxes can be found in the OWL 2 documents.

All examples given in the following are be provided in all of these syntaxes - in fact for RDF we give both the RDF/XML syntax and the RDF Turtle syntax.

Profiles

OWL 2 has two major dialects, OWL 2 DL and OWL 2 Full, and their relationship and underlying motivations are essentially the same as in OWL 1.

In addition, OWL 2 specifies three profiles, which are sublanguages which are defined by syntactic restrictions. They have favourable computational properties and are easier to implement. While they have restricted expressivity, they are sufficient for a variety of applications.

  • OWL 2 EL was designed with large biohealth ontologies in mind, such as SNOMED-CT, the NCI thesaurus, and Galen. Common characteristics of such ontolgoies include complex structural descriptions (e.g., defining certain body parts in terms of what parts they contain and are contained in or propagating diseases along part-subpart relations), huge numbers of classes, the heavy use of classification to manage the terminology, and the application of the resulting terminology to vast amounts of data.
  • OWL 2 QL emerged from research on database integration. Implementationally, it can be realized on top of standard relational database technology (e.g., SQL) simply by expanding queries in the light of class axioms. This means it can be tightly integrated with RDBMSs and benefit from their robust implementations and multi-user features. Furthermore, it can be implemented without having to "touch the data", so really as a translational/preprocessing layer. Expressively, it can represent key features of Entity-relationship and UML diagrams (at least those with functional restrictions).
  • OWL 2 RL is aimed at applications that require scalable reasoning without sacrificing too much expressive power. It is designed to accommodate OWL 2 applications that can trade the full expressivity of the language for efficiency, as well as RDF(S) applications that need some added expressivity.

OWL 1 Lite has no direct counterpart in OWL 2, although the abovementioned profiles follow the spirit of the original motivation behind the creation of OWL 1 Lite. OWL 1 Lite users are advised to use any of the abovementioned profiles or to use OWL 2 DL, depending on the specifics of their ontology.

Type Separation, Metamodelling and Declarations

Type separation as required in OWL 1 DL has been relaxed for OWL 2 DL. For OWL 2 DL, it is only required that the sets of IRIs used as object, data, and annotation properties are disjoint, and also that the sets of IRIs used as classes and datatypes are disjoint. This means that, for example, an IRI may be used both as a class and as an individual.

An example of such usage would be the following, which states that Mary is a mother, and that mother is a female role.

 Functional Style Syntax:
 ClassAssertion( :Mother :Mary ) 
 ClassAssertion( :FemaleRole :Mother ) 
 RDF/XML Syntax:
 <Mother rdf:about="Mary"/>
 <FemaleRole rdf:about="Mother"/>
 RDF Turtle Syntax:
 :Mary rdf:type :Mother .
 :Mother rdf:type :FemaleRole .
 Manchester Syntax:
 Individual: Mary
   Types: Mother
 Individual: Mother
   Types: FemaleRole
 OWL/XML Syntax:
 <ClassAssertion>
     <Class IRI="Mother"/>
     <NamedIndividual IRI="Mary"/>
 </ClassAssertion>
 <ClassAssertion>
     <Class IRI="FemaleRole"/>
     <NamedIndividual IRI="Mother"/>
 </ClassAssertion>

Note that in the first statement, Mother is used as a class, while in the second it is used as an individual. In this sense, FemaleRole acts as a metaclass for the class Mother.

In OWL 1, a document containing these two statements would be an OWL 1 Full document, but not an OWL 1 DL document. In OWL 2 DL, however, this is allowed. It must be noted, though, that the OWL 2 DL semantics accommodates this by understanding the class Mother and the individual Mother as two different views on the same IRI, i.e. they are interpreted semantically as if they were distinct. This style of metamodelling is often referred to as punning.

In OWL 2, classes, object properties, datatype properties, annotation properties and datatypes must explicitly be declared as such, unless the corresponding declaration is assumed to be implicitly present. The latter holds for pre-defined classes like owl:Thing, pre-defined datatypes, and pre-defined properties. It is also possible, but not required, to declare individuals.

Disjoint Classes

OWL 2 provides a syntactic shortcut for declaring several classes to be mutually disjoint. The following states that the classes Mother, Father and YoungChild are disjoint.

 Functional Style Syntax:
 DisjointClasses( :Mother :Father :YoungChild )
 RDF/XML Syntax:
 <owl:AllDisjointClasses>
   <owl:members rdf:parseType="Collection">
     <owl:Class rdf:about="Mother"/>
     <owl:Class rdf:about="Father"/>
     <owl:Class rdf:about="YoungChild"/>
   </owl:members>
 </owl:AllDisjointClasses>
 RDF Turtle Syntax:
 _:x rdf:type    owl:AllDisjointClasses ;
     owl:members ( :Mother :Father :YoungChild ) .
 Manchester Syntax:
 DisjointClasses: Mother Father YoungChild
 OWL/XML Syntax:
 <DisjointClasses>
     <Class IRI="Father"/>
     <Class IRI="Mother"/>
     <Class IRI="YoungChild"/>
 </DisjointClasses>

This is already expressible in OWL 1 by declaring each two of the occurring classes as disjoint.

OWL 2 also allows to state that a class is the union of disjoint classes. The following states that the class Parent is the disjoint union of the classes Mother and Father.

 Functional Style Syntax:
 DisjointUnion( :Parent :Mother :Father ) 
 RDF/XML Syntax:
 <owl:Class rdf:about="Parent">
   <owl:disjointUnionOf rdf:parseType="Collection">
     <owl:Class rdf:about="Mother"/>
     <owl:Class rdf:about="Father"/>
   </owl:disjointUnionOf>
 </owl:Class>
 RDF Turtle Syntax:
 :Parent owl:disjointUnionOf ( :Mother :Father ) .
 Manchester Syntax:
 Class: Parent
   DisjointUnionOf: Mother Father
 OWL/XML Syntax:
 <DisjointUnion>
   <Class IRI="Parent"/>
   <Class IRI="Mother"/>
   <Class IRI="Father"/>
 </DisjointUnion>

This is also already expressible in OWL 1 by stating separately that Parent is the union of Mother and Father, and that Mother and Father are disjoint classes.

Property Characteristics

OWL 2 allows the specification of further property characteristics, in addition to transitivity, symmetry, functionality and inverse functionality which are already present in OWL 1. The additional characteristics are the following.

  • Reflexivity indicates that every individual is related to itself via such a property.
  • Irreflexivity indicates that no individual is related to itself via such a property.
  • Asymmetry indicates that if A is related to B via such a property, then B is never related to A via this property.

These must not be used for data properties.

 Functional Style Syntax:
 ReflexiveObjectProperty( :hasRelative )
 IrreflexiveObjectProperty( :parentOf )   
 AsymmetricObjectProperty( :parentOf )
 RDF/XML Syntax:
 <owl:ReflexiveProperty rdf:about="hasRelative"/>
 <owl:ObjectProperty rdf:about="parentOf">
   <rdf:type rdf:resource="&owl;IrreflexiveProperty"/>
   <rdf:type rdf:resource="&owl;AsymmetricProperty"/>
 </owl:ObjectProperty>
 RDF Turtle Syntax:
 :hasRelative rdf:type owl:ReflexiveProperty .
 :parentOf    rdf:type owl:IrreflexiveProperty ,
                       owl:AsymmetricProperty .
 Manchester Syntax:
 ObjectProperty: hasRelative
   Characteristics: Reflexive
 Objectproperty: parentOf
   Characteristics: Irreflexive, Asymmetric
 OWL/XML Syntax:
 <ReflexiveObjectProperty>
   <ObjectProperty IRI="hasRelative"/>
 </ReflexiveObjectProperty>
 <IreflexiveObjectProperty>
   <ObjectProperty IRI="parentOf"/>
 </IreflexiveObjectProperty>
 <AsymmetricObjectProperty>
   <ObjectProperty IRI="parentOf"/>
 </AsymmetricObjectProperty>

Keys

In OWL 2 a collection of (data or object) properties can be assigned as a key to a class expression. This means that each named instance of the class expression is uniquely identified by the set of values which these properties attain in relation to the instance.

A simple example of this would be the identification of a person by her social security number.

 Functional Style Syntax:
 HasKey( :Person :hasSSN )
 RDF/XML Syntax:
 <owl:Class rdf:about="Person">
   <owl:hasKey rdf:parseType="Collection">
     <owl:ObjectProperty rdf:about="hasSSN">
   </owl:hasKey>
 </owl:Class>
 RDF Turtle Syntax:
 :Person owl:hasKey ( :hasSSN ) .
 Manchester Syntax:
 HasKey: Person hasSSN
 OWL/XML Syntax:
 <HasKey>
   <Class IRI="Person"/>
   <ObjectProperty IRI="hasSSN"/>
 </HasKey>

Disjoint Properties

In OWL 2, properties can be declared to be disjoint, which means that two individuals cannot be connected by both of two properties which are declared to be disjoint. The following states that a son of a person cannot also be a daughter of the same person.

 Functional Style Syntax:
 DisjointObjectProperties( :hasSon :hasDaughter )
 RDF/XML Syntax:
 <owl:ObjectProperty rdf:about="hasSon">
   <owl:propertyDisjointWith rdf:resource="hasDaughter"/>
 </owl:ObjectProperty>
 RDF Turtle Syntax:
 :hasSon owl:propertyDisjointWith :hasDaughter .
 Manchester Syntax:
 DisjointProperties: hasSon hasDaughter
 OWL/XML Syntax:
 <DisjointObjectProperties>
   <ObjectProperty IRI="hasSon"/>
   <ObjectProperty IRI="hasDaughter"/>
 </DisjointObjectProperties>

Similarly, more than two properties can be declared to be mutually disjoint.

 Functional Style Syntax:
 DisjointObjectProperties( :hasSon :hasDaughter :hasParent)
 RDF/XML Syntax:
 <owl:AllDisjointProperties>
   <owl:members rdf:parseType="Collection">
     <owl:Class rdf:about="hasSon"/>
     <owl:Class rdf:about="hasDaughter"/>
     <owl:Class rdf:about="hasParent"/>
   </owl:members>
 </owl:AllDisjointProperties>
 RDF Turtle Syntax:
 _:x rdf:type    owl:AlldisjointProperties ;
     owl:members ( :hasSon :hasDaughter :hasParent ) .
 Manchester Syntax:
 DisjointProperties: hasSon hasDaughter hasParent
 OWL/XML Syntax:
 <DisjointObjectProperties>
   <ObjectProperty IRI="hasSon"/>
   <ObjectProperty IRI="hasDaughter"/>
   <ObjectProperty IRI="hasParent"/>
 </DisjointObjectProperties>

Predefined Properties

OWL 2 provides a number of predefined properties which are analogous to the predefined classes owl:Thing and owl:Nothing.

  • owl:topObjectProperty connects all possible pairs of individuals.
  • owl:bottomObjectProperty does not connect any pair of individuals.
  • owl:topDataProperty connects all possible individuals with all literals.
  • owl:bottomDataProperty does not connect any individual with a literal.

Inverse Properties

While OWL 1 allows to state that some property is the inverse of another property, in OWL 2 we can refer to the inverse of a property without naming it. The following example states that hasFather is a subproperty of the inverse of the property hasChild.

 Functional Style Syntax:
 SubObjectPropertyOf( 
   :hasFather 
   ObjectInverseOf( :hasChild ) 
   )
 RDF/XML Syntax:
 <owl:ObjectProperty rdf:about="hasFather">
   <rdfs:subPropertyOf>
     <owl:ObjectProperty>
       <owl:inverseOf rdf:resource="hasChild"/>
     </owl:ObjectProperty>
   </rdfs:subPropertyOf>
 </owl:ObjectProperty>
 RDF Turtle Syntax:
 :hasFather rdfs:subPropertyOf _:x .
 _:x        owl:inverseOf      :hasChild .
 Manchester Syntax:
 ObjectProperty: hasFather
   SubPropertyOf: inverse hasChild
 OWL/XML Syntax:
 <SubObjectPropertyOf>
   <ObjectProperty IRI="hasFather"/>
   <InverseObjectProperty>
     <ObjectProperty IRI="hasChild"/>
   </InverseObjectProperty>
 </SubObjectPropertyOf>

Property Chains

Property chains are probably the most distinguished addition made to OWL in the revision. They allow to relate properties to concatenations of several other properties. A typical example for this is to state that the brother of one's father is one's uncle.

 Functional Style Syntax:
 SubObjectPropertyOf( 
    ObjectPropertyChain ( :hasFather :hasBrother ) 
    :hasUncle 
    )
 RDF/XML Syntax:
 <rdf:Description>
   <owl:propertyChain rdf:parseType="Collection">
     <owl:ObjectProperty rdf:resource="hasFather"/>
     <owl:ObjectProperty rdf:about="hasBrother"/>
   </owl:propertyChain>
   <rdfs:subPropertyOf rdf:resource="hasUncle"/>
 </rdf:Description>
 RDF Turtle Syntax:
 _:x rdfs:subPropertyOf :hasUncle ;
     owl:propertyChain  ( :hasFather :hasBrother ) .
 Manchester Syntax:
 ObjectProperty: hasUncle
   SubPropertyChain: hasFather o hasBrother
 OWL/XML Syntax:
 <SubObjectPropertyOf>
   <PropertyChain>
     <ObjectProperty IRI="hasFather"/>
     <ObjectProperty IRI="hasBrother"/>
   </PropertyChain>
   <ObjectProperty IRI="hasUncle"/>
 </SubObjectPropertyOf>

Property chains can also extend over more than two properties.

 Functional Style Syntax:
 SubObjectPropertyOf( 
    ObjectPropertyChain ( 
       :hasFather 
       :hasParent 
       ObjectInverseOf( :sonOf ) 
       ) 
    :hasUncle 
    )
 RDF/XML Syntax:
 <rdf:Description>
   <owl:propertyChain rdf:parseType="Collection">
     <owl:ObjectProperty rdf:resource="hasFather"/>
     <owl:ObjectProperty rdf:resource="hasParent"/>
     <owl:ObjectProperty>
       <owl:inverseOf rdf:resource="sonOf"/>
     </owl:ObjectProperty>
   </owl:propertyChain>
   <rdfs:subPropertyOf rdf:resource="hasUncle"/>
 </rdf:Description>
 RDF Turtle Syntax:
 _:x rdfs:subPropertyOf :hasUncle ;
     owl:propertyChain  ( :hasFather :hasParent _:y ) .
 _:y owl:inverseOf      :sonOf .
 Manchester Syntax:
 ObjectProperty: hasUncle
   SubPropertyChain: hasFather o hasParent o inverse sonOf
 OWL/XML Syntax:
 <SubObjectPropertyOf>
   <PropertyChain>
     <ObjectProperty IRI="hasFather"/>
     <ObjectProperty IRI="hasParent"/>
     <InverseObjectProperty>
       <ObjectProperty IRI="sonOf"/>
     </InverseObjectProperty>
   </PropertyChain>
   <ObjectProperty IRI="hasUncle"/>
 </SubObjectPropertyOf>

Qualified Cardinality Restrictions

Cardinality restrictions are already known from OWL 1. The kind of cardinality restriction present in OWL 1 is called an unqualified cardinality restriction. OWL 2 furthermore allows to express qualified cardinality restrictions where an additional qualifying class expression is used: in this case, the cardinality restriction only applies to individuals that are connected by the object property expression and are instances of the qualifying class expression.

The following example states that every person has exactly one male parent.

 Functional Style Syntax:
 SubClassOf( 
    :Person 
    ObjectExactCardinality( 1 :hasParent :Male ) 
    )
 RDF/XML Syntax:
 <owl:Class rdf:about="Person">
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="hasParent"/>
       <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">
         1
       </owl:qualifiedCardinality>
       <owl:onClass rdf:resource="Male">
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 RDF Turtle Syntax:
 :Person rdfs:subClassOf          _:x .
 _:x     rd:type                  owl:Restriction ;
         owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
         owl:onProperty           :hasParent ;
         owl:onClass              :Male .
 Manchester Syntax:
 Class: Person
   SubClassOf: hasParent exactly 1 Male
 OWL/XML Syntax:
 <SubClassOf>
   <Class IRI="Person"/>
   <ObjectExactCardinality owl:cardinality="1">
     <ObjectProperty IRI="hasParent"/>
     <Class IRI="Male"/>
   </ObjectExactCardinality>
 </SubClassOf>

The following example states that a happy father has at least one female child.

 Functional Style Syntax:
 SubClassOf( 
    :HappyFather 
    ObjectMinCardinality( 1 :hasChild :Female ) 
    )
 RDF/XML Syntax:
 <owl:Class rdf:about="HappyFather">
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="hasChild"/>
       <owl:minQualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">
         1
       </owl:minQualifiedCardinality>
       <owl:onClass rdf:resource="Female">
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 RDF Turtle Syntax:
 :HappyFather rdfs:subClassOf             _:x .
 _:x          rd:type                     owl:Restriction ;
              owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
              owl:onProperty              :hasChild ;
              owl:onClass                 :Female .
 Manchester Syntax:
 Class: HappyFather
   SubClassOf: hasChild min 1 Female
 OWL/XML Syntax:
 <SubClassOf>
   <Class IRI="HappyFather"/>
   <ObjectMinCardinality owl:cardinality="1">
     <ObjectProperty IRI="hasChild"/>
     <Class IRI="Female"/>
   </ObjectExactCardinality>
 </SubClassOf>

Cardinality restrictions can also be used with datatype properties. The following example states that every person has exactly one number assigned to it as age.

 Functional Style Syntax:
 SubClassOf( 
    :Person 
    ObjectExactCardinality( 1 :hasAge xsd:integer ) 
    )
 RDF/XML Syntax:
 <owl:Class rdf:about="Person">
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="hasAge"/>
       <owl:qualifiedCardinality rdf:datatype="&xsd;nonNegativeInteger">
         1
       </owl:qualifiedCardinality>
       <owl:onDataRange rdf:datatype="&xsd;integer">
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 RDF Turtle Syntax:
 :Person rdfs:subClassOf          _:x .
 _:x     rd:type                  owl:Restriction ;
         owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
         owl:onProperty           :hasAge ;
         owl:onDataRange          xsd:integer .
 Manchester Syntax:
 Class: Person
   SubClassOf: hasAge exactly 1 xsd:integer
 OWL/XML Syntax:
 <SubClassOf>
   <Class IRI="Person"/>
   <DataExactCardinality owl:cardinality="1">
     <DataProperty IRI="hasAge"/>
     <Datatype IRI="&xsd;integer"/>
   </ObjectExactCardinality>
 </SubClassOf>

Self-Restriction

Using the self-restriction it is possible to state that some individuals are connected to themselves under a given object property. The following example defines the class NarcisticPerson by a self-restriction on the property loves: the class contains exactly those individuals which love themselves.

 Functional Style Syntax:
 ExquivalentClasses  
   :NarcisticPerson 
   ObjectHasSelf( :loves ) 
   )
 RDF/XML Syntax:
 <owl:Class rdf:about="NarcisticPerson">
   <owl:equivalentClass>
     <owl:Restriction>
       <owl:onProperty rdf:resource="loves"/>
       <owl:hasSelf rdf:datatype="&xsd;boolean">
         true
       </owl:hasSelf>
     </owl:Restriction>
   </owl:equivalentClass>
 </owl:Class>
 RDF Turtle Syntax:
 :NarcisticPerson owl:equivalentClass _:x .
 _:x              rdf:type            owl:Restriction ;
                  owl:onProperty      :loves ;
                  owl:hasSelf         "true"^^xsd:boolean .
 Manchester Syntax:
 Class: NarcisticPerson
   EquivalentTo: loves Self
 OWL/XML Syntax:
 <EquivalentClasses>
   <Class IRI="NarcisticPerson"/>
   <ObjectHasSelf>
     <ObjectProperty IRI="loves"/>
   </ObjectHasSelf>
 </EquivalentClasses>

Negative Property Assertions

Negative property assertions are used to state that two individuals are not connected by a given object property. The following example states that Susan is not Bill's daughter.

 Functional Style Syntax:
 NegativeObjectPropertyAssertion( :hasDaughter :Bill :Susan )
 RDF/XML Syntax:
 <owl:NegativePropertyAssertion>
   <owl:sourceIndividual rdf:about="Bill">
   <owl:assertionProperty rdf:about="hasDaughter">
   <owl:targetIndividual rdf:about="Susan">
 </owl:NegativePropertyAssertion>
 RDF Turtle Syntax:
 _:x rdf:type              owl:NegativePropertyAssertion ;
     owl:sourceIndividual  :Bill ;
     owl:assertionProperty :hasDaughter ;
     owl:targetIndividual  :Susan .
 Manchester Syntax:
 Individual: Bill
   Facts: not hasDaughter Susan
 OWL/XML Syntax:
 <NegativeObjectPropertyAssertion>
   <ObjectProperty IRI="hasDaughter"/>
   <NamedIndividual IRI="Bill"/>
   <NamedIndividual IRI="Susan"/>
 </NegativeObjectPropertyAssertion>

Negative property assertions can also be used with datatype properties, as in the following example.

 Functional Style Syntax:
 NegativeDataPropertyAssertion( :hasAge :Jack "53"^^xsd:integer )
 RDF/XML Syntax:
 <owl:NegativePropertyAssertion>
   <owl:sourceIndividual rdf:about="Jack"/>
   <owl:assertionProperty rdf:about="hasAge"/>
   <owl:targetValue rdf:datatype="&xsd;integer">
     53
   </owl:targetValue>
 </owl:NegativePropertyAssertion>
 RDF Turtle Syntax:
 _:x rdf:type              owl:NegativePropertyAssertion ;
     owl:sourceIndividual  :Jack;
     owl:assertionProperty :hasAge ;
     owl:targetValue       "53"^^xsd:integer .
 Manchester Syntax:
 Individual: Jack
   Facts: not hasAge "53"^^xsd:integer
 OWL/XML Syntax:
 <NegativeDataPropertyAssertion>
   <DataProperty IRI="hasAge"/>
   <NamedIndividual IRI="Jack"/>
   <Literal datatypeIRI="&xsd;integer">53</owl:Literal>
 </NegativeDataPropertyAssertion>

Datatypes

Parts of the following may change in the final version of OWl 2. In particular, owl:rational and rdf:XMLLiteral support is at risk and owl:dateTime remains to be finalised.

OWL 2 provides a much richter datatype support than OWL 1. It also provides the use of constraining facets which allow to further restrict datatype values.

Most of the supported datatypes are XML Schema datatypes. OWL 2 furthermore provides support of the following new datatypes.

  • owl:real - the set of all real numbers
  • owl:rational - the set of all rational numbers
  • rdf:text: a string enriched with a language tag
  • rdf:XMLLiteral: borrowed from RDF
  • xsd:dateTimeStamp: based on xsd:dateTime but requires the specification of a time zone

The supported datatypes in OWL 2 are the following. Detailed descriptions can be found in the structural specification document.

  • Numbers: owl:real, owl:rational, xsd:double, xsd:float, xsd:decimal, xsd:integer, xsd:nonNegativeInteger, xsd:nonPositiveInteger, xsd:positiveInteger, xsd:negativeInteger, xsd:long, xsd:int, xsd:short, xsd:byte, xsd:unsignedLong, xsd:unsignedInt, xsd:unsignedShort, xsd:unsignedByte.
  • Strings: ref:text, xsd:string, xsd:normalizedString, xsd:token, xsd:language, xsd:Name, xsd:NCName, xsd:NMTOKEN
  • Boolean values: xsd:boolean
  • Binary data: xsd:hexBinary, xsd:base64Binary
  • IRIs: xsd:anyURI
  • Time instants: xsd:dateTime, xsd:dateTimeStamp
  • XML literals: rdf:XMLLiteral

Constraining facets can be used to restrict datatype values. The following constraining facets can be used.

  • Numbers and time instants: xsd:minInclusive, xsd:maxInclusive, xsd:minExclusive, xsd:maxExclusive
  • Strings and IRIs: xsd:minLength, xsd:maxLength, xsd:length, xsd:pattern
  • Binary data: xsd:minLength, xsd:maxLength, xsd:length

The following is an example for the use of datatype facets. It states that teenagers are between 13 and 19 years old (both inclusive).

 Functional Style Syntax:
 SubClassOf(
    :Teenager
   ObjectSomeValuesFrom( :hasAge
       DatatypeRestriction( xsd:integer
          xsd:minInclusive "13"^^xsd:integer
          xsd:maxInclusive "19"^^xsd:integer
       )
    )
 )
 RDF/XML Syntax:
 <owl:Class rdf:about="Teenager">
   <rdfs:subClassOf>
     <owl:Restriction>
       <owl:onProperty rdf:resource="hasAge"/>
       <owl:someValuesFrom>
         <rdfs:Datatype>
           <owl:onDataType rdf:resource="&xsd;integer"/>
           <owl:withRestrictions rdf:parseType="Collection">
             <xsd:minExclusive rdf:datatype="&xsd;integer">
               12
             </xsd:minExclusive>
             <xsd:maxInclusive rdf:datatype="&xsd;integer">
               19
             </xsd:maxInclusive>
           </owl:withRestrictions>
         </rdfs:Datatype>
       </owl:someValuesFrom>
     </owl:Restriction>
   </rdfs:subClassOf>
 </owl:Class>
 RDF Turtle Syntax:
 :Teenager rdfs:subClassOf      _:x .
 _:x       rdf:type             owl:Restriction ;
           owl:onProperty       :hasAge ;
           owl:someValuesFrom   _:y .
 _:y       rdf:type             rdfs:Datatype ;
           owl:onDatatype       xsd:integer ;
           owl:withRestrictions ( _:z1 _:z2 ) .
 _:z1      xsd:minInclusive     "13"^^xsd:integer .
 _:z2      xsd:maxInclusive     "19"^^xsd:integer .
 Manchester Syntax:
 Class: Teenager
   SubClassOf: hasAge some integer[<= 13 , >= 19]
 OWL/XML Syntax:
 <SubClassOf>
   <Class IRI="Teenager"/>
   <DataSomeValuesFrom>
     <DataProperty IRI="hasAge"/>
     <DatatypeRestriction>
       <Datatype IRI="&xsd;integer"/>
       <FacetRestriction facet="&xsd:minInclusive">
         <Literal datatypeIRI="&xsd;integer">13</owl:Literal>
       </FacetRestriction>
       <FacetRestriction facet="&xsd:maxInclusive">
         <Literal datatypeIRI="&xsd;integer">19</owl:Literal>
       </FacetRestriction>
     </DatatypeRestriction>
   </DataSomeValuesFrom>
 </SubClassOf>

Annotation Properties

OWL 2 provides extended support of annotation properties. They can be used for providing annotations for an ontology, an axiom, or an IRI - they can also be used for annotating annotations. Annotation properties do not affect the formal meaning of an ontology.

The following is an annotation which assigns a human-readable comment to the IRI Person.

 Functional Style Syntax:
 AnnotationAssertion( rdfs:label :Person "Represents the set of all people." )
 RDF/XML Syntax:
 <owl:Class rdf:about="Person">
   <rdfs:label rdf:datatype="&xsd;string">Represents the set of all people.</rdfs:label>
 </owl:Class>
 RDF Turtle Syntax:
 :Person rdfs:label "Represents the set of all people." .
 Manchester Syntax:
 Class: Person
   Annotations: rdfs:label "Represents the set of all people."
 OWL/XML Syntax:
 <AnnotationAssertion>
   <AnnotationProperty IRI="&rdfs;label"/>
   <IRI>Person</IRI>                       
   <Literal datatypeIRI="&xsd;string">Represents the set of all people.</owl:Literal>
 </AnnotationAssertion>

The following is an example of an axiom with an annotation.

 Functional Style Syntax:
 SubClassOf( 
   Annotation( rdfs:label "States that every man is a person." )
   :Man 
   :Person 
 )
 RDF/XML Syntax:
 <owl:Class rdf:about="Man">
   <rdfs:subClassOf rdf:resource="Person"/>
 </owl:Class>
 <owl:Axiom>
   <owl:subject rdf:resource="Man"/>
   <owl:predicate rdf:resource="&rdfs;subClassOf"/>
   <owl:object rdf:resource="Person"/>
   <rdfs:label>States that every man is a person.</rdfs:label>
 </owl:Axiom>
 RDF Turtle Syntax:
 :Man rdfs:subClassOf :Person .
 _:x  rdf:type       owl:Axiom ;
      owl:subject    :Man ;
      owl:predicate  rdfs:subClassOf ;
      owl:object     :Person ;
      rdfs:label     "States that every man is a person."^^xsd:string .
 Manchester Syntax:
 Class: Man
   SubClassOf: Annotations: rdfs:label "States that every man is a person." Person
 OWL/XML Syntax:
 <SubClassOf>
   <Annotation>
       <AnnotationProperty IRI="&rdfs;label"/>
       <Literal datatypeIRI="xsd:string">"States that every man is a person."</Literal>
   </Annotation>
   <Class IRI="Man"/>
   <Class IRI="Person"/>
 </SubClassOf>

It is furthermore possible to assign domain and range to an annotation property; this is done similarly as for object and datatype properties. Similarly, it is possible to specify that some annotation property is a subproperty of another annotation property.

Further Reading

For an introduction to OWL 2 starting from first principles, see our textbook: Hitzler, Krötzsch, Rudolph, Foundations of Semantic Web Technologies, Chapman & Hall/CRC, August 2009. ISBN 9781420090505.

You may also want to consult the OWL 2 specification and accompanying documents.

Persönliche Werkzeuge