11 June 2003
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.
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.
<!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>
<!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>
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.
<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>
<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>
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.
<owlx:Class owlx:name="Winery" owlx:complete="false" /> <owlx:Class owlx:name="Region" owlx:complete="false" /> <owlx:Class owlx:name="ConsumableThing" owlx:complete="false" />
<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.
<owlx:Class owlx:name="PotableLiquid" owlx:complete="false"> <owlx:Class owlx:name="#ConsumableThing" /> </owlx:Class>
<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.
<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>
<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>
An individual is minimally introduced by declaring to be a member of a class.
<owlx:Individual owlx:name="CentralCoastRegion"> <owlx:type owlx:name="Region" /> </owlx:Individual>
<Region rdf:ID="CentralCoastRegion" />
The following example is identical in meaning to the definition above.
<owlx:Individual owlx:name="CentralCoastRegion" /> <owlx:Individual owlx:name="#CentralCoastRegion"> <owlx:type owlx:name="Region" /> </owlx:Individual>
<owl:Thing rdf:ID="CentralCoastRegion" /> <owl:Thing rdf:about="#CentralCoastRegion"> <rdf:type rdf:resource="#Region"/> </owl:Thing>
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.
<owlx:ObjectProperty owlx:name="madeFromGrape"> <owlx:domain owlx:class="Wine" /> <owlx:range owlx:class="WineGrape" /> </owlx:ObjectProperty>
<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.
<owlx:Individual owlx:name="LindemansBin65Chardonnay"> <owlx:ObjectPropertyValue owlx:property="madeFromGrape"> <owlx:Individual owlx:name="#ChardonnayGrape" /> </owlx:ObjectPropertyValue> </owlx:Individual>
<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.
<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>
<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.
<owlx:ObjectProperty owlx:name="locatedIn"> <owlx:domain owlx:class="http://www.w3.org/2002/07/owl#Thing" /> <owlx:range owlx:class="#Region" /> </owlx:ObjectProperty>
<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.
<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>
<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.
<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>
<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>
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].
<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>
<owl:Class rdf:ID="VintageYear" /> <owl:DatatypeProperty rdf:ID="yearValue"> <rdfs:domain rdf:resource="#VintageYear" /> <rdfs:range rdf:resource="&xsd;positiveInteger"/> </owl:DatatypeProperty>
In the following example, an idividual of Cabernet Sauvignon wine is defined with reference to Region and Winery individuals.
<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>
<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.
<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>
<VintageYear rdf:ID="Year1998"> <yearValue rdf:datatype="&xsd;positiveInteger">1998</yearValue> </VintageYear>
<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>
<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>
<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>
<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>
<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>
<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>
<owlx:ObjectProperty owlx:name="hasMaker" owlx:functional="true" /> <owlx:ObjectProperty owlx:name="producesWine" owlx:inverseOf="#hasMaker" />
<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>
<owlx:ObjectProperty owlx:name="hasMaker" /> <owlx:ObjectProperty owlx:name="producesWine" owlx:inverseFunctional="true" owlx:inverseOf="#hasMaker" />
<owl:ObjectProperty rdf:ID="hasMaker" /> <owl:ObjectProperty rdf:ID="producesWine"> <rdf:type rdf:resource="&owl;InverseFunctionalProperty" /> <owl:inverseOf rdf:resource="#hasMaker" /> </owl:ObjectProperty>
<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>
<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>
<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>
<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>
<owlx:Class owlx:name="Vintage" owlx:complete="false"> <owlx:ObjectRestriction owlx:property="#hasVintageYear"> <owlx:cardinality owlx:value="1" /> <owlx:ObjectRestriction> </owlx:Class>
<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>
<owlx:Class owlx:name="Burgundy" owlx:complete="false"> <owlx:ObjectRestriction owlx:property="#hasSugar"> <owlx:hasValue owlx:name="#Dry" /> </owlx:ObjectRestriction> </owlx:Class>
<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>
<owlx:Class owlx:name="Wine" owlx:complete="true"> <owlx:Class owlx:name="&vin;Wine" /> </owlx:Class>
<owl:Class rdf:ID="Wine"> <owl:equivalentClass rdf:resource="&vin;Wine"/> </owl:Class>
<owlx:Class owlx:name="TexasThings" owlx:complete="true"> <owlx:ObjectRestriction owlx:property="#locatedIn"> <owlx:allValuesFrom owlx:class="#TexasRegion" /> </owlx:ObjectRestriction> </owlx:Class>
<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>
<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>
<Wine rdf:ID="MikesFavoriteWine"> <owl:sameIndividualAs rdf:resource="#StGenevieveTexasWhite" /> </Wine>
<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>
<WineSugar rdf:ID="Dry" /> <WineSugar rdf:ID="Sweet"> <owl:differentFrom rdf:resource="#Dry"/> </WineSugar>
<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>
<WineSugar rdf:ID="OffDry"> <owl:differentFrom rdf:resource="#Dry"/> <owl:differentFrom rdf:resource="#Sweet"/> </WineSugar>
<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>
<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>
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.
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.
<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>
<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.
<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>
<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.
<owlx:Class owlx:name="WhiteBurgundy" owlx:complete="true"> <owlx:Class owlx:name="#Burgundy" /> <owlx:Class owlx:name="#WhiteWine" /> </owlx:Class>
<owl:Class rdf:ID="WhiteBurgundy"> <owl:intersectionOf rdf:parseType="Collection"> <owl:Class rdf:about="#Burgundy" /> <owl:Class rdf:about="#WhiteWine" /> </owl:intersectionOf> </owl:Class>
The class Fruit given below includes both the extension of SweetFruit and the extension of NonSweetFruit.
<owlx:Class owlx:name="Fruit" owlx:complete="true"> <owlx:UnionOf> <owlx:Class owlx:name="#SweetFruit" /> <owlx:Class owlx:name="#NonSweetFruit" /> </owlx:UnionOf> </owlx:Class>
<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.
<owlx:Class owlx:name="Fruit2" owlx:complete="false"> <owlx:Class owlx:name="#SweetFruit" /> <owlx:Class owlx:name="#NonSweetFruit" /> </owlx:Class>
<owl:Class rdf:ID="Fruit"> <rdfs:subClassOf rdf:resource="#SweetFruit" /> <rdfs:subClassOf rdf:resource="#NonSweetFruit" /> </owl:Class>
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:
<owlx:Class owlx:name="NonConsumableThing" owlx:complete="true"> <owlx:ComplementOf> <owlx:Class owlx:name="#ConsumableThing" /> </owlx:ComplementOf> </owlx:Class>
<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.
<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>
<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>
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.
<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>
<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.
<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>
<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>
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.
<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>
<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.
<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>
<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>
<owlx:PriorVersion owlx:ontology="http://www.example.org/wine-112102.owl" />
<owl:Ontology rdf:about="http://www.example.org/wine"> <owl:priorVersion rdf:resource="http://www.example.org/wine-112102.owl"/> </owl:Ontology>
<owlx:Class owlx:name="&vin;JugWine" owlx:complete="false" owlx:deprecated="true" /> <owlx:ObjectProperty owlx:name="&vin;hasSeeds" owlx:deprecated="true" />
<owl:DeprecatedClass rdf:ID="&vin;JugWine" /> <owl:DeprecatedProperty rdf:ID="&vin;hasSeeds" />