Copyright ©2002 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
The World Wide Web as it is currently constituted resembles a poorly mapped geography. Our insight into the documents and capabilities available are based on keyword searches, abetted by clever use of document connectivity and usage patterns. The sheer mass of this data is unmanageable without powerful tool support. In order to map this terrain more precisely, computational agents require machine-readable descriptions of the content and capabilities of web accessible resources. These descriptions must be in addition to the human-readable versions of that information.
The OWL Web Ontology Language is intended to provide a language that can be used to describe the classes and relations between them that are inherent in Web documents and applications.
This document demonstrates the use of the OWL language to
NOTE: Notes to be expanded or or fixed are highlighted on the screen. (Unfortunately, they
don't show up in the versions printed by IE.)
"Tell me what wines I should buy to serve with the following menu. And, by the way, limit them to the following price range."
It would be difficult today to construct a Web agent that would be capable of performing a search for wines on the web that satisfied this query. Similarly, consider actually assigning a software agent the task of making a coherent set of travel arrangements. (For more use cases see the OWL requirements document.)To support this sort of computation, it is necessary to go beyond keywords and specify the meaning of the resources described on the web. This additional layer of interpretation captures the semantics of the data.
OWL provides a language to define Web ontologies. An ontology describes the concepts in a specific domain of discourse. In the case of OWL, an ontology may include
Defined classes and properties can then be used to describe specific Web resources. A great deal of information may be available about an object based on a simple categorization. Due to the properties of the class and its various parent classes, many additional derived characteristics of the instance may be entailed by the semantics of OWL.
One question that comes up when describing yet another XML/Web standard is "What does this buy me that XML and XML Schema don't?" An operational consensus can always be developed over the meaning of a set of XML tags and their contents. There is furious ongoing standards activity doing exactly this. There are two answers to this question.
The Resource Description Framework (RDF) was the first language specified by the W3C for representing semantic information about arbitrary resources. RDF Schema (RDFS) is a W3C candidate recommendation for an extension to RDF to describe RDF vocabularies. RDFS can be used to create ontologies, but it is purposefully lightweight, with less expressive power than OWL.
Like OWL, RDFS includes classes and properties, as well as range and domain constraints on properties. It provides inheritance hierarchies for both classes and properties. Upon its release users began requesting additional features, including data types, enumerations and the ability to define properties more rigorously.
At about the same time as RDFS was being developed, a group of European researchers, funded through the On-To-Knowledge project of the E.U., defined an ontology language called OIL (Ontology Inference Layer). OIL was based on ideas from description logics, frames, and the W3C XML and RDF (including RDFS) languages. OIL was much more powerful than RDFS, but tried to retain some compatability with RDF and RDFS. The basic syntax for OIL was a frame-like syntax, but there was also an RDFS syntax for OIL.
In an attempt to extend the expressive power of RDFS, a group of U.S. researchers, funded through the DAML (DARPA Agent Markup Language) program initiated by the U.S. Defense Advanced Research Projects Agency, defined a language called DAML-ONT. This language was also an ontology language, somewhat similar to OIL, but based much more directly on RDFS. The basic syntax for DAML-ONT was the RDF syntax. A partial axiomatization was provided for DAML-ONT.
Instead of continuing with separate ontology languages for the Semantic Web, a group of researchers, including many of the main participants in both the OIL and DAML-ONT efforts, got together in the Joint US/EU ad hoc Agent Markup Language Committee to create a new web ontology language. This language DAML+OIL builds on both OIL and DAML-ONT, and was submitted to the W3C as a proposed basis for OWL and was subsequently selected as the starting point for OWL.
In addition to ontology languages, various taxonomies and existing ontologies are already in use commercially. In e-Commerce sites they facilitate machine-based communication between buyer and seller, enable vertical integration of markets and allow descriptions to be reused in different marketplaces.
[@@ ref to Deborah VerticalNet]
[@@ ref to one of the medical or drug-related ontologies?]
There exist large taxonomies in use today that would be ripe for extension into the OWL space. For example, the North American Industry Classification System (NAICS) defines a hierarchy of over 1900 elements that identify industry types. A short sample includes:
11 Agriculture, Forestry, Fishing and Hunting 111 Crop Production ... 1113 Fruit and Tree Nut Farming 11131 Orange Groves 11132 Citrus (except Orange) Groves 11133 Noncitrus Fruit and Tree Nut Farming 111331 Apple Orchards 111332 Grape Vineyards ... 42 Wholesale Trade 421 Wholesale Trade, Durable Goods ... 4228 Beer, Wine, and Distilled Alcoholic Beverage Wholesalers 42281 Beer and Ale Wholesalers 42282 Wine and Distilled Alcoholic Beverage WholesalersNAICS is also tied to the International Standard Industrial Classification System (ISIC, Revision 3), developed and maintained by the United Nations. If this taxonomy was captured in an ontology and then tied to our wine ontology, it would be possible to begin searching for suppliers and producers of wine by searching for organizations with NAICS codes 11133, 111332, 4228, and 42282.
There are several ways to think of OWL, depending on your background.
These are approximations. To understand OWL, read on.
In order to provide a consistent set of examples throughout the guide, we have adapted a wine ontology previously developed as a description logic example and tutorial.
In this document we present examples using the OWL XML syntax, assuming XML will be familiar to the largest audience. The standard for interchange of OWL assertions between tools depends on RDF triples. These XML and RDF formats are part of the standard. Other notations have been formulated, in particular a UML version. Appendix A provides links to various primers on related standards.
We consider an ontology to be a specification or model for a particular domain or set of domains. Given a domain, an ontology defines its basic and derived concepts and their interrelationships. As we use the term, an ontology will often include assertions about individuals in addition to classes. That is, the ontology might include a class, DOG, as well as an instance, DOG-45, identifying the particular dog M. Smith owned from 1986 through 2000. The property NAME may be defined as a relation between DOGs and strings, while an instance of the NAME property would exist that connects DOG-45 with the specific value, "Tuxedo".
In order to write down an ontology that can be interpreted unambiguously and used by software agents we require a formal syntax and semantics. OWL provides these necessary underpinnings for ontology construction. See the formal semantics and XML syntax.
A set of OWL assertions loaded into a reasoning system is called a knowledge base (KB). These assertions may be based on a single ontology or multiple distributed ontologies that have been combined using defined OWL mechanisms. The assertions may include various derived facts, facts not literally present in the original textual representation of the ontology, but entailed by the semantics of OWL.
OWL is a component of the Semantic Web activity. This effort aims to make Web resources more readily accessible to automated processes by adding information about the data that describes or provides Web content. Because the Semantic Web deals with web content, it is inherently distributed. We expect OWL ontologies to also be distributed. One consequence of this is that OWL generally assumes an open world assumption. That is, descriptions of resources are not confined to a single file or scope. While concept x may be defined originally in ontology O1, it can be extended in other ontologies. The consequences of these addtional propostions about x are monotonic. New information cannot it cannot negate any previous information. Facts and entailments can only be added, never negated.
Of course it is possible to state contradictions, both explicitly and implicitly. This is something the designer of an ontology needs to be careful about.
Before we can use a set of terms, we need a precise indication of what specific vocabularies are being used. Where do the terms come from? A standard initial component of an ontology includes a set of namespace declarations. These provide a means to unambiguously interpret identifiers and make the rest of the ontology presentation much more readable. A typical OWL ontology begins with a namespace declaration similar to the following.
<rdf:rdf xmlns ="#" xmlns:vin ="#" xmlns:owl ="http://www.w3.org/??/owl#" xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:xsd ="http://www.w3.org/2000/10/XMLSchema#" xmlns:dte ="http://www.w3.org/2003/??/owl-guide-dt#" >
The first two declarations identify the namespace associated with this ontology. The first makes it the default namespace, stating that unprefixed elements and empty URI references refer to the current ontoloyg. The second identifies the namespace of the current ontology with the prefix vin:.
The third namespace declaration says that in this document, elements
prefixed with owl: should be understood as referring to
things drawn from the namespace called
http://www.w3.org/2003/??/owl#
. This is a conventional
OWL declaration, required to introduce the OWL vocabulary.
OWL depends on constructs defined by RDF and RDFS. In this document,
the rdf: prefix is understood to refer to things drawn from
the namespace called
http://www.w3.org/1999/02/22-rdf-syntax-ns#
. The next two
namespace declarations make similar statements about the RDF Schema
(rdfs:) and XML Schema datatype (xsd:) namespaces.
This OWL document is related to a separate document containing XML
Schema datatype definitions. The final declaration says that elements
prefixed with dte: should be understood as referring to
things drawn from the namespace called
http://www.w3.org/2003/??/owl-guide-dt#
, which contains
the datatype definitions for this Guide document.
Once namespaces are established we begin with an assertion that what follows is an ontology.
<owl:Ontology rdf:about="">
This assertion is formulaic. The about attribute will typically be empty, indicating that the subject of this assertion is this document. Otherwise the subject of this assertion is the value specified by the current embedding base (see XML Base). If desired, the ontology may be given a name that is a URN and independent of a particular physical location. [@@ how resolved?]
Having established the fact that we are defining an ontology and provided the necessary namespace mapping, a set of additional tags are provided to handle such critical housekeeping tasks as comments, version control and inclusion of other ontologies.
<owl:Ontology rdf:about=""> <rdfs:comment>An example OWL ontology</rdfs:comment> <owl:versionInfo> $Id: OwlGuide.html,v 1.0 2002/07/17 16:12:00 mksmith $ </owl:versionInfo> <owl:imports rdf:resource="http://www.w3.org/2003/??/owl.owl"/>[@@ Details of imports still pending.]
<rdfs:comment> provides the obvious needed capability to annotate an ontology.
<owl:versionInfo> is a standard tag intended to provide a consistent hook for version control systems working with ontologies. OWL does not specify the structure of the content.
<owl:imports> provides an include-style mechanism. Importing another ontology brings the entire set of definitions provided by that ontology into the knowledge base. In order to make best use of this imported ontology it would normally be coordinated with a namespace declaration. Notice the distinction between these two mechanisms. The OWL namespace declaration provides a convenient means to reference names from the OWL definitions. Conceptually, owl:imports is needed to bring in the knowledge base that defines the ontology relationships required to support any useful entailments.
OWL provides several other mechanisms to tie the current ontology and imported ontologies together (see ontology mapping).
The ontology header definition is closed with the following tag.
</owl:ontology>This prelude is followed by the actual conceptual definitions that make up the ontology and is ultimately closed by
</rdf:rdf>
Most uses of an ontology depend ultimately upon the ability to reason about individuals. In order to do this in a useful fashion we need to have a mechanism to describe the classes that individuals belong to and the properties that they inherit by virtue of class membership. We can always assert specific properties about individuals, but much of the power of ontologies comes from class-based reasoning.
Sometimes we want to emphasize the distinction between a class as an object and the set of elements of the class. We call the set of individuals that are members of a class the extension of the class.
The most basic concepts in an ontology are the roots of various taxonomic trees. Every instance in the OWL world is a member of owl:Thing. Thus each of these user-defined primitive classes is implicitly a subclass of owl:Thing. Root classes are defined by simply declaring a named class.
We first create the classes of WINERY, WINE-REGION, and CONSUMABLE-THING.
<owl:Class rdf:ID="WINERY"/> <owl:Class rdf:ID="WINE-REGION"/> <owl:Class rdf:ID="CONSUMABLE-THING"/>
Note that we have only said that there exist classes that have been given these names, indicated by the 'ID=' syntax. Formally, we know almost nothing about these classes other than their existence, despite the use of familiar English terms as labels. And while the classes exist, they may have no members. For all we know at the moment, these classes might as well have been called XXX, YYY, and ZZZ.
It is important to remember that definitions may be incremental and distributed. We will have more to say about WINERY later.
The syntax ID="WINE-REGION" is used to first introduce a name, as part of its definition. This is the familiar ID attribute defined by XML. The concept of a wine region can now be referred to by the rdf:resource="#WINE-REGION" usage. Another form of reference uses the syntax rdf:about="#US-REGION" to extend the definition of a resource.
This use of the rdf:about="#x" syntax is a critical element in the creation of a distributed ontology. It permits the extension of the imported definition of x without modifying the original resource and supports the incremental construction of a larger ontology.
It is now possible to refer to these defined concepts in other OWL constructs by their given identifier. For the first class, within this document, we can use the relative identifier, #WINERY. Other documents may need to reference this class as well. The most reasonable way to do so is to provide a namespace definition that includes this document as a source:
<rdf:RDF xmlns:vin="http://www.w3.org/2003/??/owl-guide#" ... / >Given this namespace definition, VIN:WINERY can be used to refer to the winery concept defined above. (Remember that namespaces are not really intended to identify actual documents. In the case of an imported ontology, they just need to line up with the namespace definition in that document. We often succumb to the natural inclination to make the namespace and document identical.) More literally, it is always possible to reference the full URI,
http://www.w3.org/2003/??/owl-guide#winery
.
Next we define US-REGION to be a subclass of WINE-REGION and CALIFORNIA-REGION to be a subclass of US-REGION. SubclassOf is the fundamental taxonomic constructor for classes. It is transitive. If X is a subclass of Y and Y a subclassOf Z then X is a subclassOf Z.
The issues surrounding a rigorous definition of geographic part/whole inclusion are many, and are not solved in this example. (An alternate region ontology can be found in Appendix B..) We treat geographic regions as elements of a simple class hierarchy, with the most specific regions as instances. These individual regions will ultimately be used to fill the slots in the wine instance REGION properties.
<owl:Class rdf:ID="US-REGION"> <rdfs:subClassOf rdf:resource="#WINE-REGION"/> </owl:Class> <owl:Class rdf:ID="CALIFORNIA-REGION"> <rdfs:subClassOf rdf:resource="#US-REGION"/> </owl:Class>
An class definition has two parts: a name introduction or reference and a list of restrictions. Each of the immediate contained expressions in the class definition further restricts the members of the defined class. Class members are members of the intersection of the restrictions. The examples above only include one restriction, forcing the new class to be a subClass of some other class.
Now, it is possible to do some simple reasoning. For example, any member of the class CALIFORNIA-REGION is also a member of WINE-REGION, due to the transitive nature of the subclass relation.
We define POTABLE-LIQUID (liquids suitable for drinking) to be a subclass of CONSUMABLE-THING.
<owl:Class rdf:ID="POTABLE-LIQUID"> <rdfs:subClassOf rdf:resource="#CONSUMABLE-THING"/> </Class>In the real world of web-based ontologies, both of these concepts should be defined in a separate ontology that would provide the basic building blocks for a wide variety of food and drink ontologies. We have included in our pedagogic wine ontology a number of other concepts, for example FOOD, EDIBLE-THING, MEAL-COURSE, and SHELLFISH that do not belong in a collection of wine facts.
At this point it is possible to create a simple (and incomplete) definition for the class WINE. WINE is a POTABLE-LIQUID.
<owl:Class rdf:ID="WINE"> <rdfs:subClassOf rdf:resource="#POTABLE-LIQUID"/> <rdfs:label xml:lang="en"> wine </rdfs:label> <rdfs:label xml:lang="fr"> vin </rdfs:label> ... </owl:Class>
The rdfs:label [?? owl:label ???] entry provides an optional human readable textual name for this concept. Presentation tools can make use of it. The "lang" attribute provides support for multiple languages. A label is like a comment and contributes nothing to the logical interpretation of an ontology.
Our wine definition is still very incomplete. We know nothing about wines except that they are things and potable-liquids, but we have sufficient information to create and reason about instances.
We don't want to get deeply philosophical here, but there are obvious issues regarding when a concept is an instance and when it is a class. The fundamental driver is how the ontology is going to be used.
The original ontology had elected to make instances be particular types of wine produced by a particular winery. This does not capture the distinction between wines made in different years.
We added a subclass of WINE, VINTAGE, which has a VINTAGE-YEAR property.
In addition, wineries produce different versions of a single variety of wine. For example, Page Mill Vineyard, in 2000, sold two chardonnay's, Chardonnay Bien Nacido Vineyard and Chardonnay Arey Listwin Vineyard. Of course we can always create PAGE-MILL-WINERY-CHARDONNAY-1 and PAGE-MILL-WINERY-CHARDONNAY-2. But we have no NAME, PRICE, PRIZES, or DESCRIPTION slots for wines. These are the sort of properties that might distinguish these two concepts. Under our current ontology they appear identical.
The point of this digression is to note that the development of an ontology should be firmly driven by use cases.
In addition to classes, we want to be able to describe their members.
We normally think of these as individuals in our universe of things.
owl:Individual is typically used to introduce a new individual.
[@@ Assuming this should be owl:Individual (consistent with Feature
Synopsis), not rdf:Description.]
<owl:Individual rdf:ID="CENTRAL-COAST-LOCATION"> <type rdf:resource="#CALIFORNIA-REGION"/> </owl:Individual>
The definition of an individual does not need to contain any further qualification. The following is identical in meaning to the definition above.
<owl:Individual rdf:ID="CENTRAL-COAST-LOCATION" /> <owl:Individual rdf:about="#CENTRAL-COAST-LOCATION"> <type rdf:resource="#CALIFORNIA-REGION"/> </owl:Individual>
There are a couple of points to be made here. First, we have decided that CENTRAL-COAST-LOCATION is as specific as we need to get in our regional breakdown for this area and have defined it to be an instance as opposed to a class.
Second, there is no requirement that these two statements need to be adjacent to one another, or even in the same file. Web ontologies are designed to be distributed. They can be imported and augmented, creating derived ontologies.
In order to have available a few more basic definitions for the properties introduced in the next sections, we define a branch of the GRAPE taxonomy, with the lone leaf being the Cabernet Sauvignon grape.
<owl:Class rdf:ID="GRAPE"> <owl:Class rdf:ID="WINE-GRAPE"> <rdfs:subClassOf rdf:resource="#GRAPE"/> </owl:Class> <owl:Individual rdf:ID="CABERNET-SAUVIGNON-GRAPE"> <rdf:type rdf:resource="#WINE-GRAPE"/> </owl:Individual>
This world of classes and individuals would be pretty uninteresting if we could only define taxonomies. Properties let us assert general facts about the members of classes and specific facts about individuals.
A property is a binary relation. Two types of properties are distinguished:
<owl:ObjectProperty id="MADE-FROM-GRAPE"> <rdfs:domain rdf:resource="#WINE"/> <rdfs:range rdf:resource="#WINE-GRAPE"/> </owl:ObjectProperty>In OWL, a sequence of statements without an explicit operator represents an implicit conjunction. They apply to their containing element. The property MADE-FROM-GRAPE has a domain of WINE and a range of WINE-GRAPE.
Properties, like classes, can be arranged in a hierarchy.
<owl:ObjectProperty rdf:ID="TASTE"> <rdfs:domain rdf:resource="#WINE"/> <rdfs:range rdf:resource="#WINE-TASTE"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="SUGAR"> <rdfs:subPropertyOf rdf:resource="#TASTE"/> <rdfs:range rdf:resource="#WINE-SUGAR"/> </owl:ObjectProperty>TASTE properties relate wines to the components of their taste, including sweetness, body, and flavor. SUGAR is a subproperty of the TASTE properties, with its range further restricted to WINE-SUGAR.
It is now possible to expand the definition of WINE to include the notion that it is an element of things that stand in a MADE-FROM-GRAPE relation to at least one WINE-GRAPE. As with property definitions, class definitions have multiple subparts that are implicitly conjoined.
<owl:Class rdf:ID="WINE">
<rdfs:subClassOf rdf:resource="#POTABLE-LIQUID"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#MADE-FROM-GRAPE"/>
<minCardinality> 1 </minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#REGION"/>
<owl:minCardinality> 1 </owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
...
</Class>
The first subClassof
defines an un-named class that represents the set of things
with at least one grape-slot. We call these anonymous
classes. Inserting this subclass restriction in the wine
class definition body states that the things that are wines are also
members of this anonymous class. That is, every wine must participate
in at least one grape-slot relation. Additionally, every
wine must come from at least one region. This cliche is
presented in more detail in the section on restrictions.
The more elaborate example below defines the CABERNET-SAUVIGNON class of wines to be red, dry, and made from the Cabernet Sauvignon grape.
<owl:Class rdf:ID="CABERNET-SAUVIGNON"> <rdfs:subClassOf> <rdfs:subClassOf rdf:about="#WINE"/> </rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#COLOR"/> <owl:hasValue rdf:resource="#RED"/> </owl:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#SUGAR"/> <owl:hasValue rdf:resource="#DRY"/> </owl:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#MADE-FROM-GRAPE"/> <owl:hasValue rdf:resource="#CABERNET-SAUVIGNON-GRAPE"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class>
We distinguish properties according to whether they relate resources to resources (object properties) or resources to datatypes (datatype properties). Datatype properties may range over strings or they may make use of simpleTypes defined in accordance with XML Schema datatypes.
Suppose we wanted to restrict vintages (wine-years) to years after
1700. We would create several XML Schema datatype definitions in a
separate file, such as
http://www.w3.org/2002/??/owl-ex-dt.xsd
, which contains:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns="http://www.w3.org/2002/??/owl-ex-dt.xsd"> <xsd:simpleType name="year"> <!-- year is an XMLS datatype based on integer --> <xsd:restriction base="xsd:decimal"/> </xsd:simpleType> <xsd:simpleType name="wineYear"> <!-- wineYear is an XMLS datatype based on year --> <!-- with the added restriction that values must be GEQ 1700 --> <xsd:restriction base="year"> <xsd:minInclusive value="1700"/> </xsd:restriction> </xsd:simpleType> </xsd:schema>
We can reference elements of this file in OWL property definitions
and class restrictions.
[@@ Check syntax for datatype reference. ]
<owl:DatatypeProperty rdf:ID="VINTAGE-YEAR"> <owl:FunctionalProperty /> <rdfs:domain rdf:resource="#WINE"/> <rdfs:range xsd:simpleType="dte:wineYear"/> </owl:ObjectProperty>The VINTAGE-YEAR property relates wines to decimal numbers greater than or equal to 1700.
[@@ Implications for reasoning?]
First we create REGION and MAKER instances, and then we define our first wine instance.
<owl:Individual rdf:ID="SANTA-CRUZ-MOUNTAINS-LOCATION"> <rdf:type rdf:resource="#CALIFORNIA-REGION"/> </owl:Individual> <owl:Individual rdf:ID="SANTA-CRUZ-MOUNTAIN-VINEYARD"> <rdf:type rdf:resource="#WINERY"/> </owl:Individual> <owl:Individual rdf:ID="SANTA-CRUZ-MOUNTAIN-VINEYARD-CABERNET-SAUVIGNON"> <rdf:type rdf:resource="#CABERNET-SAUVIGNON"/> <REGION rdf:resource="#SANTA-CRUZ-MOUNTAINS-LOCATION"/> <MAKER rdf:resource="#SANTA-CRUZ-MOUNTAIN-VINEYARD"/> <SUGAR rdf:resource="#DRY"/> </owl:Individual>This is still incomplete. There are other aspect of the wine flavor that are defined in the full ontology. But the pieces are falling together. We could begin reasoning about what menu items this wine might accompany. We know from the definition above that it is a dry wine. Because it is a Cabernet Sauvignon, we know it is a red wine.
The next few sections describe the predefined property restrictions. Tagging a property with these characteristics provides a powerful mechanism for enhanced reasoning about that property.
A property, P, tagged as transitive satisfies the following axiom:
P(x,y) and P(y,z) iff P(x,z)The concept 'AncestorOf' is transitive, while 'ParentOf' is not. My mother's ancestor is my ancestor, but not my parent.
A property, P, tagged as symmetric satisfies the following axiom:
P(x,y) iff P(y,x)The concept 'SiblingOf' is symmetric, while 'BrotherOf' is not. Bob is Jane's sibling and vice-versa. Bob is Jane's brother, but not vice-versa.
A property, P, tagged as functional satisfies the following axiom:
P(x,y) and P(x,z) -> y = zThus, if
x
is a person, then SocialSecurityNumber might
be a functional property (ideally), while
PhoneNumber would not be(home, work, cell, ...).
A property, P1, tagged as the InverseOf P2 satisfies the following axiom:
P1(x,y) iff P2(y,x)Note that the syntax for InverseOf takes a property name as an argument.
<owl:ObjectProperty rdf:ID="MAKER"> <owl:FunctionalProperty /> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="MADE-BY"> <owl:InverseOf rdf:resource="#MAKER" /> </owl:ObjectProperty>
A property, P, tagged as InverseFunctional satisfies the following axiom:
P(y,x) and P(z,x) -> y = zThink of
x
in the above axiom as defining a unique key in
the database sense. If property P2 is the inverse of P1, and P1 is
functional, then P2 is inverseFunctional.
We have already seen one way to restrict the types of the elements that make up a property. The mechanisms to date have been global in that they apply to all instances of the property. These next two, allValuesFrom and someValueFrom, are local to their containing class definition.
<owl:Class rdf:ID="MEDOC"> <owl:subClassOf rdf:about="#BORDEAUX"/> <owl:subClassOf <owl:Restriction> <owl:onProperty rdf:resource="#REGION"/> <owl:allValuesFrom rdf:resource="#MEDOC-REGION"/> </owl:Restriction> </owl:subClassOf> .... </owl:Class>
A MEDOC is a BORDEAUX from the MEDOC-REGION. Which means that all instances of MEDOC must come from one of the region instances PAUILLAC-LOCATION or MARGAUX-LOCATION, the instances of MEDOC-REGION. The allValuesFrom restriction is on the REGION property of this MEDOC class only.
In fact this definition can be strengthened, since Medoc wines are exactly the set of Bordeaux wines from Medoc. And we will see an example of how to do this later.
We have already seen examples of cardinality constraints. To date, they have been assertions about minimum cardinality. Even more straight-forward is owl:cardinality, which permits the specification of exactly the number of elements in a relation. For example, we define VINTAGE to be a subclass of WINE with exactly one VINTAGE-YEAR.
<owl:Class rdf:ID="VINTAGE"> <rdfs:subClassOf rdf:resource="#WINE"/> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#VINTAGE-YEAR"/> <owl:Cardinality> 1 </owl:Cardinality> </owl:Restriction> </rdfs:subClassOf> </owl:Class>
owl:maxCardinality can be used to specify an upper bound. In combination with owl:minCardinality it is possible to specify a range.
MinCardnality defaults to 0. There is no default value for cardinality or maxCardinality.
In order for ontologies to have the maximum impact, they need to be widely shared. In order to minimize the intellectual effort involved in developing an ontology they need to be re-used. In the best of all possible worlds they need to be composed. For example you might adopt a date ontology from one source and a physical location ontology from another.
It is important to realize that much of the effort of developing an ontology is devoted to hooking together classes and properties in ways that maximize implications. We want simple assertions about class membership to have broad and useful implications. This is the hardest part of ontology development. If you can find an existing ontology that has already undergone extensive use and refinement, it makes sense to adopt it.
It will be challenging to merge a collection of ontologies. Tool support will almost certainly be required to ensure a consistent KB.
In order to tie together a set of component ontologies as part of a third it is frequently useful to be able to indicate that a particular concept in one ontology is equivalent to some concept in a second ontology. This capability must be used with care. It is fairly easy to create necessarily empty sets when combining a set of distributed definitions. If the combined ontologies disagree anywhere (all A's are B's vs. all A's are not B's), including up their class hierarchy, their extensions will be empty.
[@@ Example: waiting see where we end up with these.]
We have already seen that class expressions can be the target of subClassOf constructors. They can also be the target of sameClassAs. Again, this avoids the need to contrive names for every class expression and provides a powerful definitional capability based on satisfaction of a property.
<owl:Class rdf:ID="Gold-Status-Customer"> <owl:sameClassAs> <owl:Restriction> <owl:onProperty rdf:resource="#buy" /> <owl:minCardinality> 2000 </owl:minCardinality> </owl:Restriction> </owl:sameClassAs> </owl:Class>
Gold-Status-Customers are exactly those who made at least 2000 purchases.
This mechanism is similar to that for classes, but declares two individuals to be identical. A classic example would be:
<owl:Individual rdf:ID="EVENING-STAR" /> <owl:Individual rdf:ID="MORNING-STAR" <owl:sameIndividualAs about="#EVENING-STAR" /> </owl:Individual>This brings up another important point. OWL does not have a unique naming assumption. Just because two names are different does not mean they refer to different individuals. In the case above, we asserted identity between two distinct names. But it is just as possible for this sort of identity to be inferred.
Remember the implications that can be derived from a functional property. If P is functional, then
P(x,y) and P(x,z)is not a confict, but simply implies that y = z.
This mechanism provides the opposite effect from sameIndivdualAs.
<owl:Individual rdf:ID="PARIS-FRANCE" /> <owl:Individual rdf:ID="PARIS-TEXAS" <owl:differentIndividualFrom about="#PARIS-FRANCE" /> </owl:Individual>Not that such a confusion is likely, but there will be cases where it is important to ensure distinct identities for weakly specified instances.
OWL provides additional constructors with which to form classes. These constructors can be used to create so-called class expressions. OWL supports the basic set operations, namely intersection, union and complement. These are denoted unionOf, intersectionOf, and complementOf, respectively. Additionally, classes can be enumerated. Class extensions can be stated explicitly by means of the oneOf constructor. And it is possible to assert that classes extensions must be disjoint.
Note that Class expressions can be nested without requiring the creation of names for every intermediate class. This allows the use of set operations to build up complex classes from anonymous classes or classes with value restrictions.
From a semantic point of view classes are interpreted as subsets of a domain. The interpretation of a class maps every defined class to a set of individuals in the domain, the the extension of the class. Since class extensions are sets, OWL provides the means to manipulate class extensions using basic set operators.
The following examples demonstrate the use of the intersectionOf construct.
<owl:Class rdf:ID="WHITE-WINE"> <owl:intersectionOf rdf:parsetype="owl:collection"> <owl:Class rdf:about="#WINE"/> <owl:Restriction> <owl:onProperty rdf:resource="#COLOR"/> <owl:hasValue rdf:resource="#WHITE"/> </owl:Restriction> </owl:intersectionOf> </owl:Class> ... <owl:Class rdf:ID="BURGUNDY"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#SUGAR"/> <owl:hasValue rdf:resource="#DRY"/> </owl:Restriction> </rdfs:subClassOf> <owl:intersectionOf rdf:parsetype="owl:collection"> <owl:Class rdf:about="#WINE"/> <owl:Restriction> <owl:onProperty rdf:resource="#REGION"/> <owl:allValuesFrom rdf:resource="#BOURGOGNE-REGION"/> </owl:Restriction> </owl:intersectionOf> </owl:Class> ... <owl:Class rdf:ID="WHITE-BURGUNDY"> <owl:intersectionOf rdf:parsetype="owl:collection"> <owl:Class rdf:about="#BURGUNDY"/> <owl:Class rdf:about="#WHITE-WINE"/> </owl:intersectionOf> ... </owl:Class>We first define WHITE-WINE to be the intersection of the class WINE and the set of things that are white in color.
Classes can be identified as closed by using the attribute/value, rdf:parsetype="owl:collection" This is an important capability. It permits us to state that WHITE-WINE 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 element of WHITE-WINE. Without this collection parsetype we can know that white wines are wines and white, but not vice-versa. This is an important tool for catagorizing instances.
The class of BURGUNDY wines is defined as those members of WINE that come from the BOURGONE-REGION. We could have declared a new class THINGS-FROM-BOURGONE-REGION and used it as a class in the owl:intersectionOf construct. Since we do not have any other use for THINGS-FROM-BOURGONE-REGION, the declaration above is shorter, clearer and doesn't require the creation of a contrived name.
Finally the class WHITE-BURGUNDY is exactly the intersection of white wines and burgundies. Burgundies in turn are grown in the French region of Bourgogne and are dry wines. Accordingly all individual wines that meet these criteria are part of the class extension of WHITE-BURGUNDY.
The complementOf construct selects all individuals from the domain of discourse that do not belong to a certain class. Usually this refers to a vary large set of individuals:
<owl:Class rdf:ID="NON-ADULTS"> <complementOf rdf:resource="#ADULT"/> <owl:Class>
The class of NON-ADULTS includes as its memebers all individuals that do not belong to the extension of ADULT. This set includes all WINES, REGIONS, etc. It is literally the set difference between owl:Thing and ADULT. Therefore, a typical usage pattern for complementOf is in combination with other set operators:
<owl:Class rdf:ID="MINOR"> <intersectionOf rdf:parsetype="owl:collection"> <owl:Class rdf:about="#PERSON"/> <owl:Class> <complementOf rdf:resource="#ADULT"/> <owl:Class> </intersectionOf> </Class>
This defines the class MINOR to be the intersection of PERSON with the set of all individuals that do not belong to the extension of ADULT.
The following example demonstrates the use of the unionOf construct. It is used exactly like the intersectionOf construct:
<owl:Class rdf:ID="FRUIT"> <unionOf rdf:parsetype="owl:collection"> <owl:Class about="#SWEET-FRUIT" /> <owl:Class about="#NON-SWEET-FRUIT" /> </unionOf> </Class>
The class FRUIT includes both the extension of SWEET-FRUIT and the extension of NON-SWEET-FRUIT.
OWL provides means to define the classes via a direct enumeration its members. This is done using the oneOf constructor. Notably, this definition closes the class extension, so that no other individuals can be declared to belong to the class.
The following statement defines a class WINE-COLOR whose members are the individuals WHITE, ROSE, RED and GREEN:
<owl:Class rdf:ID="WINE-COLOR"> <rdfs:subClassOf rdf:resource="#WINE-PROPERTY"/> <owl:oneOf> rdf:parsetype="owl:collection"> <owl:Thing rdf:about="#WHITE"/> <owl:Thing rdf:about="#ROSE"/> <owl:Thing rdf:about="#RED"/> <owl:Thing rdf:about="#GREEN"/> </owl:oneOf> </owl:Class>
[@@ Is that syntax correct? How does it differ from a sameClassAs/oneOf expression?]
The first thing to understand here is that no other individuals can be a valid WINE-COLOR since the class has been defined by enumeration and closed using the parseType attribute. Each element of the oneOf construct must be a validly declared individual. A individual has to belong to some class. In the above example, each individual was referenced by name. We used owl:Thing as a simple cliche to introduce the reference. Alternatively, we could have referenced the elements of the set according to their specific type, WINE-COLOR, by:
<vin:WINE-COLOR rdf:about="#WHITE" />
Other definitions of individuals are also valid elements of the oneOf construct, for example:
<owl:Individual rdf:about="#WHITE"> <rdf:label> White </rdf:label> </owl:Indivitual>
OWL provides a construct to state that the extensions of classes are disjoint.
The disjointness of a set of classes can be expressed using the owl:disjointWith constructor. It guarantees that an individual that is a member of one class cannot be simultaneously an element of a specified other class.
<owl:Class rdf:ID="NON-SWEET-FRUIT"> <disjointWith rdf:resource="#SWEET-FRUIT"/> </Class> <owl:Class rdf:ID="PASTA"> <rdfs:subClassOf rdf:resource="#EDIBLE-THING"/> <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 first statement ensures that any fruit is either a NON-SWEET-FRUIT or a SWEET-FRUIT. An inconsistency would arise if it were both. (We later define fruit to be the union of these two classes.)
The PASTA example shows the extension to multiple classes.
[@@ What happend to mutual disjointness? Do we have
something like:
<owl:Class rdf:ID="PASTA">
<rdfs:subClassOf rdf:resource="#EDIBLE-THING"/>
<owl:disjointWith>
<owl:oneOf rdf:parsetype="owl:collection">
<owl:Thing rdf:resource="#MEAT"/>
<owl:Thing rdf:resource="#FOWL"/>
<owl:Thing rdf:resource="#SEAFOOD"/>
<owl:Thing rdf:resource="#DESSERT"/>
<owl:Thing rdf:resource="#FRUIT"/>
</owl:oneOf>
</owl:disjointWith>
</owl:Class>
]
hasValue allows us to define classes based on the existence of particular property values. Hence, an individual will be a member of such a class whenever at least one of its property values is equal to the hasValue resource.
<owl:Class rdf:ID="BURGUNDY"> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="#SUGAR"/> <owl:hasValue rdf:resource="#DRY"/> </owl:Restriction> </rdfs:subClassOf> </owl:Class>
As you can see from this example, hasValue can only be used within a property restriction. The property to which the restriction is applied is indicated by the owl:onProperty statement.
Deb McGuinness is currently revising this.
Once an initial domain ontology is available, a large number of applications can be developed that exploit the ontology. In this section, we describe some sample uses in the domain of wines.
A number of sites exist today that call themselves wine portals. Google for example, provides 152,000 matches for the query "wine portal". One of the top matches, a site called "Wine-Portal.com", provides access to a number of sites. Many of sites claiming to be wine portals are mostly informational sites. For example, the "wine portal"'s first featured site called 'cork cuisine' (www.corkcuisine.com/) provides information about matching wines and foods, wines as gifts, etc. Another site billed as "the Internet Wine Portal" ( www.cyberbacchus.com/) provides a nice organization of a lot of wine information on the following topics:
Perusing any of the topic areas, one finds a collection of pages containing information and sometimes services related to the topic. For example, accessories and gifts contains information about what to look for when buying particular wine items and also contains a significant number of online retailers. Another top level area called 'shopping' has a subarea called 'wine shopping' from which a user can find online (or "street shopping") stores (categorized by country). Viewing the source for the site shows no evidence that this site is powered by an ontology, but such a background wine ontology could be used for organization and meta-tagging of the site.
Ontology queries could be used to retrieve wine information as well. Possibly most importantly, necessary and sufficient conditions for membership in a class such as online wine shopping could be stated and then the site could be automatically updated either when a ontology sensitive crawler found a site with the appropriate information or after that crawler identified sites that matched and a validator authorized inclusion of that link on the site.
We have started a wine agent for simple testing and expository purposes. In our initial design, the wine agent's goal is to recommend wines to accompany meal courses. This exploits the DAML ontology found at ...
This section describes the status of this document at the time of its publication. Other documents may supersede this document.
This document is a working document for the use by W3C Members and other interested parties. It may be updated, replaced or made obsolete by other documents at any time.
This document has been produced as part of the W3C Semantic Web Activity, following the procedures set out for the W3C Process. The document has been compiled by the Web Ontology Working Group. The goals of the Web Ontology working group are discussed in the Web Ontology Working Group charter.
A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR/.
To fully understand the OWL syntax and semantics you should be familiar with the basics of the related W3C and IETF standards listed below. A minimal guide to XML and RDF can be found as an appendix to the DAML+OIL Walkthru.
This example was developed by Guus Schrieber [ W3C WG Archive] and presents a more elaborate wine region ontology.
For wine the "production area" is an important feature. There is enormous variation between wine types w.r.t. the grain size of the production area, ranging from a complete country to a particular vineyard. One could distinguish four types of production area's:
In addition, we need to model part-of relationships between the various sorts of production areas:
We would like to be able to derive from our wine KB that a wine from Chateau Margaux is a French wine and that Avignonesi is a Tuscan wine.
MODELING DECISION: at this point we decided to drop the "town" subclass and treat towns as regions. This simplifies the model and is consistent with the fact that a "town" as a wine production area typically stands for an area surrounding the town, which can be larger or smaller that the actual town area. For example, the production area "Montalcino" is in fact a subregion of Tuscany surrounding the village of Montalcino.
This leads to the following model:
<owl:Class rdf:ID="vin:ProductionArea"/ > <owl:Class rdf:ID="vin:Country:"> <rdfs:SubClassOf rdf:resource="vin:ProductionArea"/> </owl:Class> <owl:Class rdf:ID="vin:Region:"> <rdfs:SubClassOf rdf:resource="vin:ProductionArea"/> </owl:Class> <owl:Class rdf:ID="vin:Vineyard:"> <rdfs:SubClassOf rdf:resource="vin:ProductionArea"/> </owl:Class>
vin:ProductionArea rdf:type rdfs:Class. vin:Country rdfs:SubClassOf vin:ProductionArea. vin:Region rdfs:SubClassOf vin:ProductionArea. vin:Vineyard rdfs:SubClassOf vin:ProductionArea.
<owl:ObjectProperty rdf:ID="vin:hasSubArea"> <owl:TransitiveProperty/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:subAreaOf"> <owl:inverseOf rdf:resource="vin:hasSubArea"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:hasRegion"> <rdfs:SubPropertyOf rdf:resource="vin:hasSubArea"/> <owl:allValuesFrom rdf:resource="vin:Region"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:regionOf"> <rdfs:inverseOf rdf:resource="vin:hasRegion"/> <owl:allValuesFrom rdf:resource="vin:Country"/> <owl:cardinality> 1 </owl:cardinality> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:hasSubRegion"> <rdfs:SubPropertyOf rdf:resource="vin:hasSubArea"/> <owl:allValuesFrom rdf:resource="vin:Region"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:subRegionOf"> <rdfs:inverseOf rdf:resource="vin:hasSubRegion"/> <owl:allValuesFrom rdf:resource="vin:Region"/> <owl:cardinality> 1 </owl:cardinality> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:hasVineyard"> <rdfs:SubPropertyOf rdf:resource="vin:hasSubArea"/> <owl:allValuesFrom rdf:resource="vin:Vinyard"/> </owl:ObjectProperty> <owl:ObjectProperty rdf:ID="vin:vineyardRegion"> <rdfs:inverseOf rdf:resource="vin:hasVineyard"/> <owl:allValuesFrom rdf:resource="vin:Region"/> <owl:cardinality> 1 </owl:cardinality> </owl:ObjectProperty>
vin:hasSubArea rdf:type rdfs:Property. vin:hasSubArea rdf:type owl:TransitiveProperty. vin:subAreaOf owl:inverseOf vin:hasSubArea. vin:hasRegion rdfs:SubPropertyOf vin:hasSubArea. vin:hasRegion owl:allValuesFrom vin:Region. vin:regionOf owl:inverseOf vin:hasRegion. vin:regionOf owl:allValuesFrom vin:Country. vin:regionOf owl:cardinality 1. vin:hasSubRegion rdfs:SubPropertyOf vin:hasSubArea. vin:hasSubRegion owl:allValuesFrom vin:Region. vin:subRegionOf owl:inverseOf vin:hasSubRegion. vin:subRegionOf owl:allValuesFrom vin:Region. vin:subRegionOf owl:cardinality 1. vin:hasVineyard rdfs:SubPropertyOf vin:hasSubArea. vin:hasVineyard owl:allValuesFrom vin:Vineyard. vin:vineyardRegion owl:inverseOf vin:hasVineyard.. vin:vineyardRegion owl:allValuesFrom vin:Region. vin:vineyardRegion owl:cardinality 1.
ONTOLOGICAL NOTE: the part-whole relationship described here is well-known in the formal-ontology literature. The typology of part-whole relations by Winston et al. [1] characterizes this as a "place-area" relation. Various authors have criticized and amended this typology. If the formal-ontology community would at some point be able to make a part-whole typology available in OWL, the properties in this wine ontology could be linked to it.
UML NOTE: Below is a UML class diagram for this example. The modeling decisions for this diagram will be discussed in the forthcoming document on the UML presentation syntax. For the moment, note the use of the UML "composition" construct (the darkened diamond), which caries some of the semantics of the place-area relation.