previous next contents

11 June 2003

Appendix B. OWL Examples in XML Syntax

Examples of OWL document fragments are shown in this appendix. In particular, the examples correspond to the ones in the Guide document [OWL Guide] are listed.

Table of Contents


B.1 The Structure of Ontologies

B.1.1 Namespaces

Since the XML presentation syntax in itself does not rely on the syntax of RDF, namespace declaration of the XML syntax dose not have to include RDF-related namespace such as 'xmlns:rdf' and 'xmlns:rdfs' in contrast to the declaration for the RDF/XML syntax.

Example B1-1: XML Presentation Syntax for owlx:Ontology
<!DOCTYPE Ontology [
    <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY vin  "http://www.example.org/wine#" >
    <!ENTITY food "http://www.example.org/food#" > ]>
<owlx:Ontology owlx:name="http://www.example.org/wine" 
  xmlns:owlx="http://www.w3.org/2003/05/owl-xml">
  
  <!-- OWL statements --> 

</owlx:Ontology> 
RDF/XML Syntax (see also 2.1 in [OWL Guide])
<!DOCTYPE owl [
    <!ENTITY xsd  "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY vin  "http://www.example.org/wine#" >
    <!ENTITY food "http://www.example.org/food#" > ]>
<rdf:RDF 
    xmlns     ="http://www.example.org/wine#" 
    xmlns:vin ="http://www.example.org/wine#"       
    xmlns:food="http://www.example.org/food#"    
    xmlns:owl ="http://www.w3.org/2002/07/owl#"
    xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
> 
  
  <!-- OWL statements --> 

</rdf:RDF> 

B.1.2 Ontology Headers

In the XML presentation syntax, there is no header element, in contrast to the RDF/XML syntax in which owl:Ontology is provided as a construct for the header component.

Example B1-2: XML Presentation Syntax for Header Elements
<owlx:Annotation>
  <owlx:Documentation>An example OWL ontology</owlx:Documentation> 
</owlx:Annotation>
<owlx:PriorVersion owlx:ontology="http://www.example.org/wine-112102.owl" /> 
<owlx:Imports owlx:ontology="http://www.example.org/food.owl"/> 
<owlx:Annotation>
  <owlx:Label>Wine Ontology</owlx:Label> 
</owlx:Annotation>
RDF/XML Syntax (see also 2.2 in [OWL Guide])
<owl:Ontology rdf:about="http://www.example.org/wine"> 
  <rdfs:comment>An example OWL ontology</rdfs:comment>
  <owl:priorVersion rdf:resource="http://www.example.org/wine-112102.owl"/> 
  <owl:imports rdf:resource="http://www.example.org/food.owl"/> 
  <rdfs:label>Wine Ontology</rdfs:label> 
</owl:Ontology> 

B.2 Basic Definitions

B.2.1 Simple Classes and Individuals

(a) Defining Simple Hierarchical Named Classes

As simple (and incomplete) definitions (i.e., axioms), the examples below only indicate the existence of three classes: Winery, Region, and ConsumableThing, each of which is given with a name.

Example B2-1: XML Presentation Syntax for owlx:Class[axiom]
<owlx:Class owlx:name="Winery" owlx:complete="false" />
<owlx:Class owlx:name="Region" owlx:complete="false" />
<owlx:Class owlx:name="ConsumableThing" owlx:complete="false" /> 
RDF/XML Syntax: owl:Class (see also 3.1.1 in [OWL Guide])
<owl:Class rdf:ID="Winery"/> 
<owl:Class rdf:ID="Region"/> 
<owl:Class rdf:ID="ConsumableThing"/>

The next example defines a simple (and incomplete) definition for the class PotableLiquid that is a sub-class of ConsumableThing.

Example B2-2: XML Presentation Syntax for Class[ID] contained by a description model group.
<owlx:Class owlx:name="PotableLiquid" owlx:complete="false">
  <owlx:Class owlx:name="#ConsumableThing" />  
</owlx:Class>
RDF/XML Syntax: rdfs:subClassOf (see also 3.1.1 in [OWL Guide])
<owl:Class rdf:ID="PotableLiquid"> 
  <rdfs:subClassOf rdf:resource="#ConsumableThing" />
</owl:Class>

The owlx:Label element in XML presentation syntax (rdfs:label entry in RDF/XML syntax) provides an optional human readable name for this class. A label is like a comment and contributes nothing to the logical interpretation of an ontology.

Example B2-3: XML Presentation Syntax for owlx:Annotation and owlx:Label
<owlx:Class owlx:name="Wine" owlx:complete="false"> 
  <owlx:Annotation>
    <owlx:Label xml:lang="en">wine</owlx:Label> 
    <owlx:Label xml:lang="fr">vin</owlx:Label> 
  </owlx:Annotation>
  <owlx:Class owlx:name="&food;PotableLiquid" /> 
</owlx:Class> 
RDF/XML Syntax (see also 3.1.1 in [OWL Guide])
<owl:Class rdf:ID="Wine"> 
  <rdfs:subClassOf rdf:resource="&food;PotableLiquid"/> 
  <rdfs:label xml:lang="en">wine</rdfs:label> 
  <rdfs:label xml:lang="fr">vin</rdfs:label> 
</owl:Class> 

(b) Defining Individuals

An individual is minimally introduced by declaring to be a member of a class.

Example B2-4: XML Presentation Syntax for owlx:Individual[axiom]
<owlx:Individual owlx:name="CentralCoastRegion"> 
  <owlx:type owlx:name="Region" />
</owlx:Individual> 
RDF/XML Syntax (see also 3.1.2 in [OWL Guide])
<Region rdf:ID="CentralCoastRegion" /> 

The following example is identical in meaning to the definition above.

Example B2-5: XML Presentation Syntax for owlx:Individual[axiom]
<owlx:Individual owlx:name="CentralCoastRegion" /> 

<owlx:Individual owlx:name="#CentralCoastRegion"> 
  <owlx:type owlx:name="Region" />
</owlx:Individual> 
RDF/XML Syntax: owl:Thing (see also 3.1.2 in [OWL Guide])
<owl:Thing rdf:ID="CentralCoastRegion" /> 

<owl:Thing rdf:about="#CentralCoastRegion"> 
   <rdf:type rdf:resource="#Region"/> 
</owl:Thing>

B.2.2 Simple Properties

(a) Defining Properties

Properties allow to assert general facts about the members of classes and specific facts about individuals. OWL distinguishes two types of properties: object properties and datatype properties.

Example B2-6: XML Presentation Syntax for owlx:ObjectProperty
<owlx:ObjectProperty owlx:name="madeFromGrape"> 
  <owlx:domain owlx:class="Wine" /> 
  <owlx:range owlx:class="WineGrape" /> 
</owlx:ObjectProperty> 
RDF/XML Syntax: owl:ObjectProperty (see also 3.2.1 in [OWL Guide])
<owl:ObjectProperty rdf:ID="madeFromGrape"> 
  <rdfs:domain rdf:resource="#Wine"/>
  <rdfs:range rdf:resource="#WineGrape"/> 
</owl:ObjectProperty>

Given with definitions of the property above as well as the following individual, it is possible to infer that LindemansBin65Chardonnay is a wine, because the domain of madeFromGrape is Wine.

Example B2-7: XML Presentation Syntax for owlx:Individual[axiom]
<owlx:Individual owlx:name="LindemansBin65Chardonnay">
  <owlx:ObjectPropertyValue owlx:property="madeFromGrape">
    <owlx:Individual owlx:name="#ChardonnayGrape" />
  </owlx:ObjectPropertyValue> 
</owlx:Individual>
RDF/XML Syntax: owl:Thing (see also 3.2.1 in [OWL Guide])
<owl:Thing rdf:ID="LindemansBin65Chardonnay">
  <madeFromGrape rdf:resource="#ChardonnayGrape" />
</owl:Thing>

Properties, like classes, can be arranged in a hierarchy. Properties of WineDescriptor relate wines to their color and components of their taste. hasColor is a subproperty of the hasWineDescriptor property, with its range further restricted to WineColor.

Example B2-8: XML Presentation Syntax for owlx:SubPropertyOf
<owlx:Class owlx:name="WineDescriptor" owlx:complete="false" /> 

<owlx:Class owlx:name="WineColor" owlx:complete="false"> 
  <owlx:Class owlx:name="#WineDescriptor" />
</owlx:Class>

<owlx:ObjectProperty owlx:name="hasWineDescriptor"> 
  <owlx:domain owlx:class="Wine" /> 
  <owlx:range owlx:class="WineDescriptor" /> 
</owlx:ObjectProperty> 

<owlx:ObjectProperty owlx:name="hasColor"> 
  <owlx:range owlx:class="WineColor" /> 
</owlx:ObjectProperty> 

<owlx:SubPropertyOf owlx:sub="hasColor">
  <owlx:ObjectProperty owlx:name="hasWineDescriptor" />
</owlx:SubPropertyOf>
RDF/XML Syntax: rdfs:subPropertyOf (see also 3.2.1 in [OWL Guide])
<owl:Class rdf:ID="WineDescriptor" />

<owl:Class rdf:ID="WineColor">
  <rdfs:subClassOf rdf:resource="#WineDescriptor" />
</owl:Class>

<owl:ObjectProperty rdf:ID="hasWineDescriptor">
  <rdfs:domain rdf:resource="#Wine" />
  <rdfs:range  rdf:resource="#WineDescriptor" />
</owl:ObjectProperty>

<owl:ObjectProperty rdf:ID="hasColor">
  <rdfs:subPropertyOf rdf:resource="#hasWineDescriptor" />
  <rdfs:range rdf:resource="#WineColor" />
</owl:ObjectProperty>

In the next example, the locatedIn property that relates things to the regions where the things are located.

Example B2-9: XML Presentation Syntax for owlx:ObjectProperty
<owlx:ObjectProperty owlx:name="locatedIn"> 
  <owlx:domain owlx:class="http://www.w3.org/2002/07/owl#Thing" /> 
  <owlx:range owlx:class="#Region" /> 
</owlx:ObjectProperty> 
RDF/XML Syntax owl:ObjectProperty (see also 3.2.1 in [OWL Guide])
<owl:ObjectProperty rdf:ID="locatedIn">
  <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#Thing" />
  <rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>

The definition of Wine class is then expanded to include the notion of regions, and that a wine is made from at least one WineGrape. As with property definitions, class definitions have multiple subparts that are implicitly conjoined.

Example B2-10: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Wine" owlx:complete="false"> 
  <owlx:Class owlx:name="&food;PotableLiquid" />
  <owlx:ObjectRestriction owlx:property="#madeFromGrape">  
    <owlx:minCardinality owlx:value="1" /> 
  </owlx:ObjectRestriction> 
  <owlx:ObjectRestriction owlx:property="#locatedIn">  
    <owlx:minCardinality owlx:value="1" /> 
  <owlx:ObjectRestriction> 
</owlx:Class>
RDF/XML Syntax: owl:Restriction (see also 3.2.1 in [OWL Guide])
<owl:Class rdf:ID="Wine"> 
  <rdfs:subClassOf rdf:resource="&food;PotableLiquid"/> 
  <rdfs:subClassOf>
    <owl:Restriction> 
      <owl:onProperty rdf:resource="#madeFromGrape"/>
      <owl:minCardinality 
        rdf:datatype="&xsd;NonNegativeInteger">1</owl:minCardinality>
    </owl:Restriction> 
  </rdfs:subClassOf>
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#locatedIn"/> 
      <owl:minCardinality 
        rdf:datatype="&xsd;NonNegativeInteger">1</owl:minCardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

Although the wines produced in specific years are considered vintages, it is problematic, for example, to consider the year 2000 as a vintage. The vintage is not a new variety of wine, but a special subset of the wine produced in the year 2000. However, a vintage can be defined as a separate class, whose instances have a relationship to the Wine they are a vintage of.

Example B2-11: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Vintage" owlx:complete="false"> 
  <owlx:ObjectRestriction owlx:property="#vintageOf">  
    <owlx:minCardinality owlx:value="1" /> 
  </owlx:ObjectRestriction> 
</owlx:Class>

<owlx:ObjectProperty owlx:name="vintageOf">
  <owlx:domain owlx:class="#Vintage" /> 
  <owlx:range owlx:class="#Wine" />
</owlx:ObjectProperty>
RDF/XML Syntax: owl:Restriction (see also the Vintage class in [OWL Guide])
<owl:Class rdf:ID="Vintage"> 
  <rdfs:subClassOf>
    <owl:Restriction> 
      <owl:onProperty rdf:resource="#vintageOf"/>
      <owl:minCardinality 
        rdf:datatype="&xsd;NonNegativeInteger">1</owl:minCardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

<owl:ObjectProperty rdf:ID="vintageOf">
  <rdfs:domain rdf:resource="#Vintage" />
  <rdfs:range  rdf:resource="#Wine" />
</owl:ObjectProperty>  

(b) Properties and Datatypes

OWL distinguishes properties if they relate individuals to individuals (object properties) or individuals to datatypes (datatype properties). Datatype properties may range over strings or they may make use of simple types defined according to XML Schema datatypes [XMLSchema-2].

Example B2-12: XML Presentation Syntax for owlx:Class[axiom] and owlx:DatatypeProperty
<owlx:Class owlx:name="VintageYear" owlx:complete="false" /> 

<owlx:DatatypeProperty owlx:name="yearValue">
  <owlx:domain owlx:class="#VintageYear" /> 
  <owlx:range owlx:datatype="&xsd;positiveInteger" /> 
</owlx:DatatypeProperty> 
RDF/XML Syntax: owl:DatatypeProperty (see also 3.2.2 in [OWL Guide])
<owl:Class rdf:ID="VintageYear" />

<owl:DatatypeProperty rdf:ID="yearValue">
  <rdfs:domain rdf:resource="#VintageYear" />    
  <rdfs:range  rdf:resource="&xsd;positiveInteger"/>
</owl:DatatypeProperty> 

(c) Properties of Individuals

In the following example, an idividual of Cabernet Sauvignon wine is defined with reference to Region and Winery individuals.

Example B2-13: XML Presentation Syntax for owlx:Individual[axiom]
<owlx:Individual owlx:name="SantaCruzMountainsRegion">
  <owlx:type owlx:name="Region" /> 
  <owlx:ObjectPropertyValue owlx:property="locatedIn"> 
    <owlx:Individual owlx:name="#CaliforniaRegion" /> 
  </owlx:ObjectPropertyValue> 
</owlx:Individual>

<owlx:Individual owlx:name="SantaCruzMountainVineyard">
  <owlx:type owlx:name="Winery" /> 
</owlx:Individual> 

<owlx:Individual owlx:name="SantaCruzMountainVineyardCabernetSauvignon">
  <owlx:type owlx:name="CabernetSauvignon" /> 
  <owlx:ObjectPropertyValue owlx:property="locatedIn"> 
    <owlx:Individual owlx:name="#SantaCruzMountainsRegion" /> 
  </owlx:ObjectPropertyValue> 
  <owlx:ObjectPropertyValue owlx:property="hasMaker"> 
    <owlx:Individual owlx:name="#SantaCruzMountainVineyard" /> 
  </owlx:ObjectPropertyValue> 
</owlx:Individual>
RDF/XML Syntax (see also 3.2.3 in [OWL Guide])
<Region rdf:ID="SantaCruzMountainsRegion">
  <locatedIn rdf:resource="#CaliforniaRegion" />
</Region>

<Winery rdf:ID="SantaCruzMountainVineyard" />

<CabernetSauvignon rdf:ID="SantaCruzMountainVineyardCabernetSauvignon" >
  <locatedIn rdf:resource="#SantaCruzMountainsRegion"/>  
  <hasMaker  rdf:resource="#SantaCruzMountainVineyard" />   
</CabernetSauvignon>

Datatype properties can be added to individuals. An instance of VintageYear is created below, and a specific value of type &xsd;positiveInteger (i.e., http://www.w3.org/2001/XMLSchema#positiveInteger) is associated.

Example B2-14: XML Presentation Syntax for owlx:Individual[axiom]
<owlx:Individual owlx:name="Year1998">
  <owlx:type owlx:name="VintageYear" /> 
  <owlx:DataPropertyValue owlx:property="yearValue">
    <owlx:DataValue owlx:datatype="&xsd;positiveInteger">1998</owlx:DataValue> 
  </owlx:DataPropertyValue>
</owlx:Individual> 
RDF/XML Syntax (see also 3.2.3 in [OWL Guide])
<VintageYear rdf:ID="Year1998">
  <yearValue rdf:datatype="&xsd;positiveInteger">1998</yearValue>
</VintageYear> 

B.2.3 Property Characteristics

(a) Transitive Property

Example B2-15: XML Presentation Syntax for owlx:ObjectProperty
<owlx:ObjectProperty owlx:name="locatedIn" owlx:transitive="true">
  <owlx:domain owlx:class="&owl;Thing" /> 
  <owlx:range owlx:class="#Region" />
</owlx:ObjectProperty>

<owlx:Individual owlx:name="SantaCruzMountainsRegion">
  <owlx:type owlx:name="Region" /> 
  <owlx:ObjectPropertyValue owlx:property="locatedIn"> 
    <owlx:Individual owlx:name="#CaliforniaRegion" /> 
  </owlx:ObjectPropertyValue> 
</owlx:Individual>

<owlx:Individual owlx:name="CaliforniaRegion">
  <owlx:type owlx:name="Region" /> 
  <owlx:ObjectPropertyValue owlx:property="locatedIn"> 
    <owlx:Individual owlx:name="#USRegion" /> 
  </owlx:ObjectPropertyValue> 
</owlx:Individual>
RDF/XML Syntax: owl:ObjectProperty (see also 3.3 in [OWL Guide])
<owl:ObjectProperty rdf:ID="locatedIn">
  <rdf:type rdf:resource="&owl;TransitiveProperty" />
  <rdfs:domain rdf:resource="&owl;Thing" />
  <rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>

<Region rdf:ID="SantaCruzMountainsRegion">
  <locatedIn rdf:resource="#CaliforniaRegion" />
</Region>
 
<Region rdf:ID="CaliforniaRegion">
  <locatedIn rdf:resource="#USRegion" />
</Region>

(b) Symmetric Property

Example B2-16: XML Presentation Syntax for owlx:ObjectProperty and owlx:Individual[axiom]
<owlx:ObjectProperty owlx:name="adjacentRegion" owlx:symmetric="true">
  <owlx:domain owlx:class="#Region" /> 
  <owlx:range owlx:class="#Region" />
</owlx:ObjectProperty>

<owlx:Individual owlx:name="MendocinoRegion">
  <owlx:type owlx:name="Region" /> 
  <owlx:ObjectPropertyValue owlx:property="locatedIn"> 
    <owlx:Individual owlx:name="#CaliforniaRegion" /> 
  </owlx:ObjectPropertyValue> 
  <owlx:ObjectPropertyValue owlx:property="adjacentRegion"> 
    <owlx:Individual owlx:name="#SonomaRegion" /> 
  </owlx:ObjectPropertyValue> 
</owlx:Individual>
RDF/XML Syntax: owl:ObjectProperty (see also 3.3 in [OWL Guide])
<owl:ObjectProperty rdf:ID="adjacentRegion">
  <rdf:type rdf:resource="&owl;SymmetricProperty" />
  <rdfs:domain rdf:resource="#Region" />
  <rdfs:range rdf:resource="#Region" />
</owl:ObjectProperty>

<Region rdf:ID="MendocinoRegion">
  <locatedIn rdf:resource="#CaliforniaRegion" />
  <adjacentRegion rdf:resource="#SonomaRegion" />
</Region>

(c) Functional Property

Example B2-17: XML Presentation Syntax for owlx:ObjectProperty
<owlx:Class owlx:name="VintageYear" owlx:complete="false" /> 

<owlx:ObjectProperty owlx:name="hasVintageYear" owlx:functional="true"> 
  <owlx:domain owlx:class="#Vintage" /> 
  <owlx:range owlx:class="#VintageYear" /> 
</owlx:ObjectProperty>
RDF/XML Syntax: owl:ObjectProperty (see also 3.3 in [OWL Guide])
<owl:Class rdf:ID="VintageYear" />

<owl:ObjectProperty rdf:ID="hasVintageYear">
  <rdf:type rdf:resource="&owl;FunctionalProperty" />
  <rdfs:domain rdf:resource="#Vintage" />
  <rdfs:range  rdf:resource="#VintageYear" />
</owl:ObjectProperty>

(d) Inverse Of

Example B2-18: XML Presentation Syntax for owlx:ObjectProperty
<owlx:ObjectProperty owlx:name="hasMaker" owlx:functional="true" /> 
<owlx:ObjectProperty owlx:name="producesWine" owlx:inverseOf="#hasMaker" /> 
RDF/XML Syntax: owl:ObjectProperty (see also 3.3 in [OWL Guide])
<owl:ObjectProperty rdf:ID="hasMaker">
  <rdf:type rdf:resource="&owl;FunctionalProperty" />
</owl:ObjectProperty>
  
<owl:ObjectProperty rdf:ID="producesWine">
  <owl:inverseOf rdf:resource="#hasMaker" />
</owl:ObjectProperty>

(e) Inverse Functional Property

Example B2-19: XML Presentation Syntax for owlx:ObjectProperty
<owlx:ObjectProperty owlx:name="hasMaker" /> 

<owlx:ObjectProperty owlx:name="producesWine" 
        owlx:inverseFunctional="true" 
        owlx:inverseOf="#hasMaker" /> 
RDF/XML Syntax: owl:ObjectProperty (see also 3.3 in [OWL Guide])
<owl:ObjectProperty rdf:ID="hasMaker" />

<owl:ObjectProperty rdf:ID="producesWine">
  <rdf:type rdf:resource="&owl;InverseFunctionalProperty" />
  <owl:inverseOf rdf:resource="#hasMaker" />
</owl:ObjectProperty> 

B.2.4 Property Restrictions

(a) allValuesFrom

Example B2-20: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Wine" owlx:complete="false">
  <owlx:Class owlx:name="&food;PotableLiquid" />  
  <owlx:ObjectRestriction owlx:property="#hasMaker"> 
    <owlx:allValuesFrom owlx:class="#Winery" />
  </owlx:ObjectRestriction> 
</owlx:Class>
RDF/XML Syntax: owl:Restriction (see also 3.4.1 in [OWL Guide])
<owl:Class rdf:ID="Wine">
  <rdfs:subClassOf rdf:resource="&food;PotableLiquid" />
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasMaker" />
      <owl:allValuesFrom rdf:resource="#Winery" />
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

(b) someValuesFrom

Example B2-21: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Wine2" owlx:complete="false">
  <owlx:Class owlx:name="&food;PotableLiquid" />  
  <owlx:ObjectRestriction owlx:property="#hasMaker"> 
    <owlx:someValuesFrom owlx:class="#Winery" />
  </owlx:ObjectRestriction> 
</owlx:Class>
RDF/XML Syntax: owl:Restriction (see also 3.4.1 in [OWL Guide])
<owl:Class rdf:ID="Wine2">
  <rdfs:subClassOf rdf:resource="&food;PotableLiquid" />
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasMaker" />
      <owl:someValuesFrom rdf:resource="#Winery" /> 
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>   

(c) Cardinality

Example B2-22: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Vintage" owlx:complete="false"> 
  <owlx:ObjectRestriction owlx:property="#hasVintageYear"> 
    <owlx:cardinality owlx:value="1" /> 
  <owlx:ObjectRestriction> 
</owlx:Class>
RDF/XML Syntax: owl:Restriction (see also 3.4.2 in [OWL Guide])
<owl:Class rdf:ID="Vintage"> 
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasVintageYear"/>  
      <owl:cardinality 
        rdf:datatype="&xsd;NonNegativeInteger">1</owl:cardinality>
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

(d) hasValue

Example 2-23: XML Presentation Syntax for owlx:ObjectRestriction
<owlx:Class owlx:name="Burgundy" owlx:complete="false"> 
  <owlx:ObjectRestriction owlx:property="#hasSugar">
    <owlx:hasValue owlx:name="#Dry" /> 
  </owlx:ObjectRestriction> 
</owlx:Class>
RDF/XML Syntax: owl:Restriction (see also 3.4.3 in [OWL Guide])
<owl:Class rdf:ID="Burgundy">
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasSugar" />
      <owl:hasValue rdf:resource="#Dry" />
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>

B.3 Ontology Mapping

B.3.1 Equivalent Class

Example 3-1: XML Presentation Syntax for owlx:Class[axiom]
<owlx:Class owlx:name="Wine" owlx:complete="true">
  <owlx:Class owlx:name="&vin;Wine" /> 
</owlx:Class> 
RDF/XML Syntax: owl:equivalentClass (see also 4.1 in [OWL Guide])
<owl:Class rdf:ID="Wine">
  <owl:equivalentClass rdf:resource="&vin;Wine"/>
</owl:Class>
Example 3-2: XML Presentation Syntax for owlx:Class[axiom]
<owlx:Class owlx:name="TexasThings" owlx:complete="true"> 
  <owlx:ObjectRestriction owlx:property="#locatedIn"> 
    <owlx:allValuesFrom owlx:class="#TexasRegion" />
  </owlx:ObjectRestriction> 
</owlx:Class> 
RDF/XML Syntax: owl:equivalentClass (see also 4.1 in [OWL Guide])
<owl:Class rdf:ID="TexasThings"> 
  <owl:equivalentClass>
    <owl:Restriction>
      <owl:onProperty rdf:resource="#locatedIn" />
      <owl:allValuesFrom rdf:resource="#TexasRegion" />
    </owl:Restriction>
  </owl:equivalentClass>
</owl:Class> 

B.3.2 Same Individual

Example 3-3: XML Presentation Syntax for owlx:SameIndividual
<owlx:Individual owlx:name="#MikesFavoriteWine">
  <owlx:type owlx:name="Wine" />
</owlx:Individual> 

<owlx:SameIndividual>
  <owlx:Individual owlx:name="#MikesFavoriteWine" owlx:type="Wine" />
  <owlx:Individual owlx:name="#StGenevieveTexasWhite" /> 
</owlx:SameIndividual>
RDF/XML Syntax: owl:sameIndividualAs (see also 4.2 in [OWL Guide])
<Wine rdf:ID="MikesFavoriteWine"> 
  <owl:sameIndividualAs rdf:resource="#StGenevieveTexasWhite" /> 
</Wine> 

B.3.3 Different Individuals

Example 3-4: XML Presentation Syntax for owlx:DifferentIndividuals
<owlx:Individual owlx:name="Dry"> 
  <owlx:type owlx:name="WineSugar" /> 
</owlx:Individual>

<owlx:Individual owlx:name="Sweet">
  <owlx:type owlx:name="WineSugar" /> 
</owlx:Individual> 

<owlx:DifferentIndividuals>
  <owlx:Individual owlx:name="#Sweet" /> 
  <owlx:Individual owlx:name="#Dry" />
</owlx:DifferentIndividuals>
RDF/XML Syntax: owl:differentFrom (see also 4.3 in [OWL Guide])
<WineSugar rdf:ID="Dry" />

<WineSugar rdf:ID="Sweet">  
  <owl:differentFrom rdf:resource="#Dry"/>  
</WineSugar> 
Example 3-5: XML Presentation Syntax for owlx:DifferentIndividuals
<owlx:Individual owlx:name="OffDry"> 
  <owlx:type owlx:name="WineSugar" /> 
</owlx:Individual>

<owlx:DifferentIndividuals>
  <owlx:Individual owlx:name="#OffDry" /> 
  <owlx:Individual owlx:name="#Dry" />
  <owlx:Individual owlx:name="#Sweet" /> 
</owlx:DifferentIndividuals>
RDF/XML Syntax: owl:differentFrom (see also 4.3 in [OWL Guide])
<WineSugar rdf:ID="OffDry">
  <owl:differentFrom rdf:resource="#Dry"/> 
  <owl:differentFrom rdf:resource="#Sweet"/> 
</WineSugar>
Example 3-6: XML Presentation Syntax for owlx:DifferentIndividuals
<owlx:DifferentIndividuals>
  <owlx:Individual owlx:name="Red"   owlx:type="&vin;WineColor" /> 
  <owlx:Individual owlx:name="White" owlx:type="&vin;WineColor" />
  <owlx:Individual owlx:name="Rose"  owlx:type="&vin;WineColor" /> 
</owlx:DifferentIndividuals>
RDF/XML Syntax: owl:AllDifferent (see also 4.3 in [OWL Guide])
<owl:AllDifferent>
  <owl:distinctMembers rdf:parseType="Collection">
    <vin:WineColor rdf:about="#Red" />
    <vin:WineColor rdf:about="#White" />
    <vin:WineColor rdf:about="#Rose" />
  </owl:distinctMembers>
</owl:AllDifferent>

B.4 Complex Classes

B.4.1 Set Operators

Classes constructed using the set operations are definitions (or axioms), and the members of the class are completely specified by the set operation. In the XML presentation syntax, the modality attribute owlx:complete of owlx:Class[axiom] must be set to true for class definitions using set operators.

(a) Intersection

The class definition below states that WhiteWine is exactly the intersection of the class Wine and the set of things that are white in color. This means that if something is white and a wine, then it is an instance of WhiteWine. Without such a definition it is possible to know that white wines are wines and white, but not vice-versa. This is an important tool for categorizing individuals.

Example 4-1: XML Presentation Syntax for owlx:IntersectionOf
<owlx:Class owlx:name="WhiteWine" owlx:complete="true">
  <owlx:IntersectionOf>
    <owlx:Class owlx:name="#Wine" />
    <owlx:ObjectRestriction owlx:property="#hasColor">
      <owlx:hasValue owlx:name="#White" /> 
    </owlx:ObjectRestriction>
  </owlx:IntersectionOf>
</owlx:Class>
RDF/XML Syntax: owl:intersectionOf (see also 5.1.1 in [OWL Guide])
<owl:Class rdf:ID="WhiteWine">
  <owl:intersectionOf rdf:parseType="Collection">
    <owl:Class rdf:about="#Wine" />
    <owl:Restriction>
      <owl:onProperty rdf:resource="#hasColor" />
      <owl:hasValue rdf:resource="#White" />
    </owl:Restriction>
  </owl:intersectionOf>
</owl:Class>

The following example defines Burgundy that includes exactly those wines that have at least one locatedIn relation to the Bourgogne Region.

Example 4-2: XML Presentation Syntax for owlx:Class[axiom] (with an implicit 'owlx:IntersectionOf'):
<owlx:Class owlx:name="#Burgundy" owlx:complete="true">
  <owlx:Class owlx:name="#Wine" /> 
  <owlx:ObjectRestriction owlx:property="#locatedIn"> 
    <owlx:hasValue owlx:name="#BourgogneRegion" /> 
  </owlx:ObjectRestriction>
</owlx:Class>
RDF/XML Syntax: owl:intersectionOf (see also 5.1.1 in [OWL Guide])
<owl:Class rdf:about="#Burgundy">
  <owl:intersectionOf rdf:parseType="Collection">
    <owl:Class rdf:about="#Wine" />
    <owl:Restriction>
      <owl:onProperty rdf:resource="#locatedIn" />
      <owl:hasValue rdf:resource="#BourgogneRegion" />
    </owl:Restriction>
  </owl:intersectionOf>
</owl:Class>

The next example says that the class WhiteBurgundy is exactly the intersection of white wines and Burgundies.

Example 4-3: XML Presentation Syntax for owlx:Class[axiom]
<owlx:Class owlx:name="WhiteBurgundy" owlx:complete="true"> 
  <owlx:Class owlx:name="#Burgundy" /> 
  <owlx:Class owlx:name="#WhiteWine" /> 
</owlx:Class> 
RDF/XML Syntax: owl:intersectionOf (see also 5.1.1 in [OWL Guide])
<owl:Class rdf:ID="WhiteBurgundy">
  <owl:intersectionOf rdf:parseType="Collection">
    <owl:Class rdf:about="#Burgundy" />
    <owl:Class rdf:about="#WhiteWine" />
  </owl:intersectionOf> 
</owl:Class>

(b) Union

The class Fruit given below includes both the extension of SweetFruit and the extension of NonSweetFruit.

Example 4-4: XML Presentation Syntax for owlx:UnionOf
<owlx:Class owlx:name="Fruit" owlx:complete="true"> 
  <owlx:UnionOf>
    <owlx:Class owlx:name="#SweetFruit" /> 
    <owlx:Class owlx:name="#NonSweetFruit" /> 
  </owlx:UnionOf>
</owlx:Class> 
RDF/XML Syntax: owl:unionOf (see also 5.1.2 in [OWL Guide])
<owl:Class rdf:ID="Fruit">
  <owl:unionOf rdf:parseType="Collection">
    <owl:Class rdf:about="#SweetFruit" />
    <owl:Class rdf:about="#NonSweetFruit" />
  </owl:unionOf>
</owl:Class>

The next example says that the instances of Fruit are a subset of the intersection of sweet and non-sweet fruit, which is expected to be the empty set.

Example 4-5: XML Presentation Syntax for owlx:Class[axiom]
<owlx:Class owlx:name="Fruit2" owlx:complete="false"> 
  <owlx:Class owlx:name="#SweetFruit" /> 
  <owlx:Class owlx:name="#NonSweetFruit" /> 
</owlx:Class> 
RDF/XML Syntax: owl:Class (see also 5.1.2 in [OWL Guide])
<owl:Class rdf:ID="Fruit">
  <rdfs:subClassOf rdf:resource="#SweetFruit" />
  <rdfs:subClassOf rdf:resource="#NonSweetFruit" />
</owl:Class>      

(c) Complement

The complementOf construct selects all individuals from the domain of discourse that do not belong to a certain class. Usually this refers to a very large set of individuals:

Example 4-6: XML Presentation Syntax for owlx:ComplementOf
<owlx:Class owlx:name="NonConsumableThing" owlx:complete="true"> 
  <owlx:ComplementOf>
    <owlx:Class owlx:name="#ConsumableThing" /> 
  </owlx:ComplementOf>
</owlx:Class> 
RDF/XML Syntax: owl:complementOf (see also 5.1.3 in [OWL Guide])
<owl:Class rdf:ID="ConsumableThing" />

<owl:Class rdf:ID="NonConsumableThing">
  <owl:complementOf rdf:resource="#ConsumableThing" />
</owl:Class>

The class of NonConsumableThing above includes as its members all individuals that do not belong to the extension of ConsumableThing. This set includes all Wine(s), Region(s), etc. It is literally the set difference between owlx:Individual (i.e., owl:Thing in the RDF/XML syntax) and ConsumableThing. A typical usage pattern for the complement operator is thus in combination with other set operators:

The next example defines the class NonFrenchWine to be the intersection of Wine with the set of all things not located in France.

Example 4-7: XML Presentation Syntax for owlx:ComplementOf
<owlx:Class owlx:name="NonFrenchWine" owlx:complete="true">
  <owlx:Class owlx:name="#Wine" /> 
  <owlx:ComplementOf>
    <owlx:ObjectRestriction owlx:property="#locatedIn"> 
      <owlx:hasValue owlx:name="#FrenchRegion" /> 
    </owlx:ObjectRestriction>
  </owlx:ComplementOf> 
</owlx:Class>
RDF/XML Syntax: owl:complementOf (see also 5.1.3 in [OWL Guide])
<owl:Class rdf:ID="NonFrenchWine">
  <owl:intersectionOf rdf:parseType="Collection">
    <owl:Class rdf:about="#Wine"/>
    <owl:Class>
      <owl:complementOf>
        <owl:Restriction>
          <owl:onProperty rdf:resource="#locatedIn" />
          <owl:hasValue rdf:resource="#FrenchRegion" />
        </owl:Restriction>
      </owl:complementOf>
    </owl:Class>
  </owl:intersectionOf>
</owl:Class>               

B.4.2 Enumerated Classes

An OWL class can be defined via a direct enumeration of its members by using owlx:OneOf construct. This definition completely specifies the class extension, so that no other individuals can be declared to belong to the class. The following defines a class WineColor whose members are the individuals White, Rose, and Red.

Example 4-8: XML Presentation Syntax for owlx:OneOf [object]
<owlx:Class owlx:name="WineColor" owlx:complete="false">
  <owlx:Class owlx:name="#WineDescriptor" /> 
  <owlx:OneOf>
    <owlx:Individual owlx:name="#White" /> 
    <owlx:Individual owlx:name="#Rose" /> 
    <owlx:Individual owlx:name="#Red" /> 
  </owlx:OneOf>
</owlx:Class>
RDF/XML Syntax: owl:oneOf (see also 5.2 in [OWL Guide])
<owl:Class rdf:ID="WineColor">
  <rdfs:subClassOf rdf:resource="#WineDescriptor"/>
  <owl:oneOf rdf:parseType="Collection">
    <owl:Thing rdf:about="#White"/>
    <owl:Thing rdf:about="#Rose"/>
    <owl:Thing rdf:about="#Red"/>
  </owl:oneOf>
</owl:Class>

In the XML presentation syntax, owlx:EnumeratedClass can also be used for the enumerative class definition as shown below.

Example 4-9: XML Presentation Syntax for owlx:EnumeratedClass
<owlx:Class owlx:name="WineColor" owlx:complete="false">
  <owlx:Class owlx:name="#WineDescriptor" /> 
</owlx:Class>

<owlx:EnumeratedClass owlx:name="WineColor">
  <owlx:Individual owlx:name="#White" owlx:type="WineColor" />
  <owlx:Individual owlx:name="#Rose"  owlx:type="WineColor" />
  <owlx:Individual owlx:name="#Red"   owlx:type="WineColor" />
</owlx:EnumeratedClass>
RDF/XML Syntax: owl:oneOf (see also 5.2 in [OWL Guide])
<owl:Class rdf:ID="WineColor">
  <rdfs:subClassOf rdf:resource="#WineDescriptor"/>
  <owl:oneOf rdf:parseType="Collection">
    <WineColor rdf:about="#White" />
    <WineColor rdf:about="#Rose" />
    <WineColor rdf:about="#Red" />
  </owl:oneOf>
</owl:Class>

B.4.3 Disjoint Classes

The disjointness of a set of classes guarantees that an individual that is a member of one class cannot simultaneously be an instance of a specified other class.

Example 4-10: XML Presentation Syntax for owlx:DisjointClasses
<owlx:Class owlx:name="Pasta" owlx:complete="false">
  <owlx:Class owlx:name="#EdibleThing" /> 
</owlx:Class>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#Pasta" />
  <owlx:Class owlx:name="#Meat" />
</owlx:DisjointClasses>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#Pasta" />
  <owlx:Class owlx:name="#Fowl" />
</owlx:DisjointClasses>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#Pasta" />
  <owlx:Class owlx:name="#Seafood" />
</owlx:DisjointClasses>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#Pasta" />
  <owlx:Class owlx:name="#Dessert" />
</owlx:DisjointClasses>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#Pasta" />
  <owlx:Class owlx:name="#Fruit" /> 
</owlx:DisjointClasses>
RDF/XML Syntax: owl:disjointWith (see also 5.3 in [OWL Guide])
<owl:Class rdf:ID="Pasta">
  <rdfs:subClassOf rdf:resource="#EdibleThing"/>
  <owl:disjointWith rdf:resource="#Meat"/>
  <owl:disjointWith rdf:resource="#Fowl"/>
  <owl:disjointWith rdf:resource="#Seafood"/>
  <owl:disjointWith rdf:resource="#Dessert"/>
  <owl:disjointWith rdf:resource="#Fruit"/>
</owl:Class>

The above Pasta example demonstrates multiple disjoint classes. Note that this only asserts that Pasta is disjoint from all of these other classes. It does not assert, for example, that Meat and Fruit are disjoint. A owlx:DisjointClasses in the XML presentation syntax allows to assert that a set of classes is mutually disjoint. On the other hand, there must be an owl:disjointWith assertion for every pair in the RDF/XML syntax.

A common requirement is to define a class as the union of a set of mutually disjoint subclasses. In the following example, Fruit is defined to be exactly the union of SweetFruit and NonSweetFruit. It must be noted here that these subclasses exactly partition Fruit into two distinct subclasses because they are disjoint.

Example 4-11: XML Presentation Syntax for owlx:DisjointClasses
<owlx:Class owlx:name="SweetFruit" owlx:complete="false">
  <owlx:Class owlx:name="#EdibleThing" /> 
</owlx:Class>

<owlx:Class owlx:name="NonSweetFruit" owlx:complete="false">
  <owlx:Class owlx:name="#EdibleThing" /> 
</owlx:Class>

<owlx:DisjointClasses> 
  <owlx:Class owlx:name="#SweetFruit" />
  <owlx:Class owlx:name="#NonSweetFruit" /> 
</owlx:DisjointClasses>
RDF/XML Syntax: owl:disjointWith (see also 5.3 in [OWL Guide])
<owl:Class rdf:ID="SweetFruit">
  <rdfs:subClassOf rdf:resource="#EdibleThing" />
</owl:Class>

<owl:Class rdf:ID="NonSweetFruit">
  <rdfs:subClassOf rdf:resource="#EdibleThing" />
  <owl:disjointWith rdf:resource="#SweetFruit" />
</owl:Class>

B.5 Ontology Versioning

Example 5-1: XML Presentation Syntax for owlx:PriorVersion
<owlx:PriorVersion owlx:ontology="http://www.example.org/wine-112102.owl" /> 
RDF/XML Syntax: owl:priorVersion (see also 6. in [OWL Guide])
<owl:Ontology rdf:about="http://www.example.org/wine"> 
  <owl:priorVersion rdf:resource="http://www.example.org/wine-112102.owl"/> 
</owl:Ontology> 
Example 5-2: XML Presentation Syntax for owlx:Class[axiom], and owlx:ObjectProperty
<owlx:Class owlx:name="&vin;JugWine" 
  owlx:complete="false" owlx:deprecated="true" />

<owlx:ObjectProperty owlx:name="&vin;hasSeeds" owlx:deprecated="true" />
RDF/XML Syntax: owl:DeprecatedClass and owl:DeprecatedProperty (see also 6. in [OWL Guide])
<owl:DeprecatedClass rdf:ID="&vin;JugWine" />
<owl:DeprecatedProperty rdf:ID="&vin;hasSeeds" />

previous next contents

Valid XHTML 1.0!