W3C

OWL 2 Web Ontology Language:
Primer

W3C Working Draft 11 April 2008

This version:
http://www.w3.org/TR/2008/WD-owl2-primer-20080411/
Latest version:
http://www.w3.org/TR/owl2-primer/
Authors:
Bijan Parsia, University of Manchester
Peter F. Patel-Schneider, Bell Labs Research, Alcatel-Lucent


Abstract

OWL 2 extends the W3C OWL Web Ontology Language with a small but useful set of features that have been requested by users, for which effective reasoning algorithms are now available, and that OWL tool developers are willing to support. The new features include extra syntactic sugar, additional property and qualified cardinality constructors, extended datatype support, simple metamodelling, and extended annotations.
This short primer provides an approachable introduction to OWL 2, including orientation for those coming from other disciplines, an example showing how OWL 2 can be used to represent first simple information and then more complex information, how OWL 2 manages ontologies, and finally the distinctions between the various sublanguages of OWL 2.

Status of this Document

May Be Superseded

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is being published as one of a set of 6 documents:

  1. Structural Specification and Functional-Style Syntax
  2. Model-Theoretic Semantics
  3. Mapping to RDF Graphs
  4. XML Serialization
  5. Profiles
  6. Primer (this document)

Compatibility with OWL 1

The OWL Working Group intends to make OWL 2 be a superset of OWL 1, except for some small bug fixes and changes to the formal semantics of annotations. This means that OWL 2 will be backward compatible, and creators of OWL 1 documents need only move to OWL 2 when they want to make use of OWL 2 features. More details and advice concerning migration from OWL 1 to OWL 2 will be in future drafts.

Multiple Syntaxes

This draft includes, experimentally, versions of each example in four different OWL syntaxes. Javascript is used to control the visibility of each syntax. One of the syntaxes, the "Manchester Syntax" is expected to be documented in a (non-normative) Working Group Note; for now, Manchester Syntax links point to a Working Group Wiki page.

Please Comment By 11 May 2008

The OWL Working Group seeks public feedback on this First Public Working Draft. Please send your comments to public-owl-comments@w3.org (public archive). If possible, please offer specific changes to the text that would address your concern. You may also wish to check the Wiki Version of this document for internal-review comments and changes being drafted which may address your concerns.

No Endorsement

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Patents

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


Contents



1 Introduction

Editor's Note: At the second F2F meeting, the Working Group has decided to simplify the vocabulary of OWL ontologies. In future versions of this specification, the terminals of the functional-style grammar and the RDF vocabulary will be significantly smaller.

The W3C OWL 2 Web Ontology Language (OWL) is a Semantic Web language designed to represent ontologies - information about how individuals are grouped and fit together in a particular domain. OWL can represent rich and complex information about classes of individuals and their properties. OWL is a logical language, where every construct has a well-defined meaning, meanings that fit together to support exact and useful representation of many different kinds of information. OWL groups information into ontologies in the form of documents that can be stored and transmitted across the World Wide Web in the same way that data and other kinds of information are and that can be completely and effectively processed by tools that extract the information implicit in an ontology.

This short primer contains, first, orientations to OWL for various communities, including XML, RDF, databases, and object-oriented programming. The bulk of the primer consists of a running example that illustrates the different kinds of information that can be represented in OWL. The Appendix contains the entire example ontology. The primer then describes how OWL packages information into ontologies and how extra information is associated with parts of an ontology. There are links from the short descriptions of the OWL constructs here to other documents that provide more information on OWL. Finally, the primer describes the various sublanguages of OWL, and what is gained and lost by using them.

OWL is in some respects similar to various existing modeling formalisms and in other respects very different. Some features of OWL may be surprising to people grounded in specific methodologies and the significant advantages of other features may be missed due to unfamiliarity. The key goal of the primer is to help develop insight into OWL, its strengths, and its weaknesses. Users interested in the details of every OWL construct should consult the OWL 2 Structural Syntax. There are also many tutorials available freely on the web, including those bundled with specific OWL ontology development environments.

2 Orientation

OWL is superficially similar to many other technologies, which is not too surprising given the prevalence of XML as a concrete syntax and of the class-object paradigm. People familiar with other technologies are sometimes misled by the similarities and thus very surprised by the differences. In section 2.1, we provide a brief orientation to OWL from a number of prominent technological perspectives. At various points in the tutorial sections of this Primer, we shall highlight aspects of OWL that might be surprising to people coming from these perspectives.

In section 2.2, we briefly discuss some major ways of using OWL in applications.

2.1 Technology Perspectives

Editor's Note: The Working Group is committed to making these technology-specific sections be accessible by users of those technology. We particularly solicit comments on whether this is the case and how to make them moreso.

Editor's Note: Structural issue: Some readers have commented that having these sections up front may be intimidating. The editors are considering move detailed discussion to an appendix -- feedback on this point is welcome.

Editor's Note: There is a proposal for having technology and application tips, notes, and tricks scattered throughout the document, but with optional display. Thus, as with the syntax, different users can configure the document to their tastes and needs.

2.1.1 Resource Description Framework (RDF) and Schema (RDFS)

Of the technologies discussed in this section, RDF(S) is the closest to OWL. They both have roots in logic based knowledge representation; in many ways, RDF(S) can be seen as a subset of OWL; and, perhaps most prominently, the primary exchange syntax for OWL has been RDF/XML. However, there are differences of style, emphasis, and common practice that can make relying on RDF(S) intuitions misleading when working with OWL. For example, while OWL statements and expressions can be encoded as RDF facts (triples), viewing most OWL statements and expressions as collections is not typically a fruitful way of writing or understanding them. Similarly, it is fairly common and effective to work with RDF as a graph data structure or database where the primary focus is on the explicit statements in the graph.

Even when we consider parts of RDFS which support implicit knowledge, such as determining subclass relationships, the relation between the explicit and implicit statements is very direct. Thus, it is easy to conceptualize inference in terms of graph structure manipulation. In contrast, determining implicit knowledge in OWL, including determining subclass relationships and typing and checking consistency of an ontology, requires techniques that are much more akin to theorem proving.

2.1.2 XML

OWL and the XML family of technologies share some common parts: OWL can be expressed in XML languages (such as RDF/XML or the XML syntax for OWL) and thus be manipulated by XML tools. OWL reuses datatypes and datatype derivation facets from XML Schema (and can use certain forms of XML Schema type definitions). Finally, OWL and XML can both be used for conceptual modeling as well as data definition, though they ways they go about it are fairly distinct and OWL is oriented toward more abstract, higher level conceptual modeling than is XML.


OWL is designed to support the discovery of relationships between classes through automated reasoning. OWL also builds in far fewer presumptions about the entities it is describing both generally and in terms of their physical realization in computational systems.

Both OWL and XML Schema support strong abstraction facilities. However XML Schema, is much more concerned with the data organization issues relating to its core mission of validating XML documents.

2.1.3 Databases

Databases (either relational or object-oriented) also store and organize information. However, databases are oriented to environments where all information that an application needs is available, where considerations of data integrity in situations of simultaneous access and update are important, or where very large amounts of data needs to be worked with. OWL is more oriented towards flexible and expressive description of data (or information), and only considers information to be complete if the completeness can be determined from other information.


Ontologies in OWL are much more powerful and flexible than database schemas. Database schemas generally only shape the kinds of information that is associated with objects (or tuples) that belong to a class (or table). Classes in OWL ontologies can do this, but also can provide recognition conditions so that explicit typing is not required in OWL. Of course this flexibility means that determining typing in OWL can require complex inferences.

A final major difference between databases and OWL is that the information stored in a database is derived from the database schema and integrity constraints - if the schema doesn't sanction the storage of certain kinds of information, then that information cannot be stored, and, similarly, if the information violates an integrity constraint it also cannot be stored. OWL, on the other hand, allows arbitrary information to be associated with just about any object - if there is nothing in the ontology forbidding the associated then it is allowable. OWL is thus much more flexible in its information storage.

2.1.4 Object-oriented Programming

Object-oriented programming (OOP) also has object-centered modeling characteristics, and thus has much in common with OWL. However, OOP generally is performed in complete-information contexts, and where the information that can possibly be known about an object is circumscribed by the information in the type of the object. As with databases, the differing stances on completeness and object information is a major difference between OWL and OOP. Similarly OOP classes are much less expressive than OWL classes.

Furthermore, OWL is a strictly declarative and logical language. OWL therefore has none of the operational aspects of OOP, like methods, and similarly reasoning in OWL is strictly logical, with nothing comparing to inheritance, particularly inheritance with exceptions or overriding.

OWL is used in a number of different ways and for a number of different domains -- far too many to enumerate here. But it's worth examining a few examples to get a feel for the sorts of problem OWL has worked well for.

Using all of the expressive power of OWL, effectively, requires a fair bit of skill.

2.1.5 OWL 1

OWL 2 is a backwards compatible revision to the Web Ontology Language (OWL). OWL 2 adds several new constructs to extend the expressivity of OWL including those for qualified cardinality restrictions, role chains, and expressive data predicates. OWL 2 also includes a new XML Serialization (targeted to the XML tool chain, i.e., XSLT, schema languages, etc.) and a set of subsetting profiles with various desirable application and computational properties.

For those interested in OWL 1, it is worth consulting the OWL 1 Overview and Language Guide. As every OWL 1 ontology is also an OWL 2 ontology, the OWL 1 documentation provides a reasonable introduction to OWL 2 (though only through the RDF/XML syntax). There are other OWL 1 documents available from the WebOnt working group webpage.


Editor's Note: A section on the differences between OWL 1 and OWL 2 is forthcoming.

2.2 Application Perspectives

2.2.1 Terminology development and management

Terminologies, controlled vocabularies, taxonomies and the like are used for a range of information retrieval (IR) tasks such as query broadening or supporting faceted access. Predefined terminologies may also be used at data entry either to catalog the entry (for IR support) or to guide the user in a variety of ways. For example, in clinical support systems certain forms or parts of forms may only be displayed when the clinician is to perform specific sorts of procedures, and these procedures can be identified by a combination of terms from a controlled vocabulary.

Developing and maintaining large terminology is time- and skill-intensive, even if the structure of the terminology is relatively simple. OWL can support the process in a number of ways:

OWL has been used to support very large terminologies consisting of hundred of thousands of terms in complex hierarchies. Galen? NCI? SNOMED? Much work has been done using OWL in the Health Care and Life Sciences (HCLS) domain where there is a wealth of experience in developing large scale terminologies.

For terminology development, OWL reasoners have in the past traditionally been used at development time only; i.e., off line from the application. In such cases, the reasoner acts like a "terminology complier", that is, it assembles a complete taxonomy from definitions of terms. The taxonomy is then deployed in the application. For retrieval tasks of relatively stable collections, this has been an acceptable way to cope with the difficulty of reasoning with large ontologies. However, as computing power has increased and OWL reasoners have grown more optimized, there is increasing on line, deployment time use of OWL reasoners in terminological applications. In particular, what is sometimes known as "post coordination" -- that is, the ability of a person at the data entry point to extend the terminology to better fit their situation -- has become more common. Such dynamic terminology extension in critical systems can benefit by the methodological rigor supported by OWL reasoners. Instead of merely coining a term and plopping it somewhere in the taxonomy, end users are encouraged to refine existing terms by specializing their definitions.

To take a simple example, a doctor wishing to record that a patient has an almond allergy might be directed to enter that an almond is a kind of nut. The system then can recognize that the almond allergy is a form of nut allergy and the requisite advice or entry forms presented as usual. Of course in this situation it would be more realistic for the application to be built on, or have access to, a large, broad existing ontology such as OpenCyc which already knew things like almonds are nuts, rather than asking the physician to stop doing medicine and instruct the system in matters relating to almonds.

2.2.2 Conceptual Modeling

As we saw with terminological management, a key benefit of OWL is the support it gives to modeling subject domains, that is, to conceptual modeling. OWL is a capable language for conceptual modeling, for example, it can easily encode most entity-relationship diagrams and many UML diagrams. Once encoded, OWL reasoners can find implicit relations, conflicts, and missing pieces. Since OWL can describe and work with incomplete information it is well suited for high level conceptual work wherein you are not merely abstracting from the physical or logical layers of an information system, but you are still unsure about various aspects of the conceptual structure. OWL allows you to defer various modeling decisions while still making effective use of what you do know.

OWL supports a variety of styles of modeling, e.g., top down or bottom up, iterative or upfront, or refinement oriented vs generalizing. When modeling, a reasoner (and other tools) can provide continual feedback to the model. Indeed, often the absence of any reaction from a reasoner gives valuable information to the modeler (i.e., their model is much less well described than they had thought).

OWL based conceptual models can be used for information integration as well. For example, supposed you are faced with the task of integration two database applications that have radically different schemata but, at least to a first glance, similar conceptual models. By first casting both models into OWL, then aligning parts of the model with each other, one can find hidden relations as well as inconsistencies between the model (or in your understanding of their relations). By exploring things at the conceptual level, you are not distracted by the in principle irrelevant low level implementation details. Since the models have a clear semantics, they can be systematically checked. Instead of tediously verifying correspondences by hand, you can spend your time tweaking the modeling or the alignment.


OWL based conceptual models have been used directly to federate disparate information systems. There are several techniques ranging from treating the conceptual models as high level schemas for an RDF based data store to exploiting the conceptual models to build distributed queries against the data's home systems.

3 Basic Notions

OWL allows us to express information about the world then to draw certain consequences based on this information. There are OWL tools - reasoners - that can automatically compute these consequences. In OWL, we presume that the world is primarily made up of individual entities (typically known as individuals or objects). Individuals are related to each other and to data values via properties. Using OWL, we can group individuals that share certain characteristics into classes.

OWL is part of the Semantic Web, so names in OWL are international resource identifiers (IRIs). As IRIs are long, we will use a compact way of writing them in OWL, consisting of a prefix and a reference separated by a colon. There are various syntaxes for OWL available, which serve various purposes: When OWL information is transferred around in the Web, it is written in an XML dialect.

The Manchester syntax [OWL 2 Manchester Syntax] is an OWL syntax that is designed to be easier for non-logicians to read. The Functional-Style syntax [OWL 2 Specification] is designed to be easier for specification purposes and for reasoning tools to use. The OWL XML syntax is an XML syntax for OWL defined by an XML schema [OWL 2 Specification]. The RDF/XML syntax for OWL is just RDF/XML, with a particular translation for the OWL constructs [OWL 2 RDF Mapping] . There are tools that can translate between the different syntaxes for OWL.

The running example and the entire example ontology in the appendix can be viewed an any of the four different syntaxes, by default the Manchester syntax is the only one shown.

The buttons below can be used to show or hide all four syntaxes.

Suppose we want to represent information about a particular family. (We do not intend this example to be representative of the sorts of domains OWL should be used for, or as a canonical example of good modeling with OWL, or a correct representation of the rather complex, shifting, and politically explosive domain of families. Instead, we intend it to be a rather simple exhibition of various features of OWL.) We first need to determine what individuals there are in a family, and how they are related to each other and what data values are associated with them. We can then proceed by writing down all this information in OWL.

So if we have a family with parents John and Mary and children Susan and Bill we could set up individuals and write all these facts down, along with age facts as follows.

Individual: f:John
Facts: f:hasWife f:Mary,
f:hasSon f:Bill,
f:hasDaughter f:Susan,
f:hasAge 33
Individual: f:Mary
Facts: f:hasSon f:Bill,
f:hasDaughter f:Susan,
f:hasAge 31
Individual: f:Bill
Facts: f:hasAge 13
Individual: f:Susan
Facts: f:hasAge 8

We could also write down information about the sex of people by providing them with a gender, which is either male or female.

Individual: f:John Facts: f:hasGender f:male
Individual: f:Mary Facts: f:hasGender f:female
Individual: f:Bill Facts: f:hasGender f:male
Individual: f:Susan Facts: f:hasGender f:female Individual: f:male
Individual: f:female

However, all we have done so far is written down the basic facts about a particular family. In a sense, we have used just the "RDF" portion of OWL that is tagging individuals as instances of named classes and relating them to other individuals by properties. While this is already quite useful, OWL also lets you describe how families work in general.


So let's switch gears and think how families work in general. (This is the process of knowledge representation. Like all processes representing information about the world, certain simplifying assumptions must be made, and since this is a primer we are going to be simplifying a lot.) For starters, the individuals in families are all people, so we should have a class of people, with name Person. Below you will find information about several properties. wife is a relationship between Persons, i.e., both the domain and range of wife is Person, as are both son and daughter. age is a relationship from a Person to an integer.


Class: f:Person
ObjectProperty: f:hasWife Domain: f:Person Range: f:Person
ObjectProperty: f:hasSon Domain: f:Person Range: f:Person
ObjectProperty: f:hasDaughter Domain: f:Person Range: f:Person
DataProperty: f:hasAge Domain: f:Person Range: integer

From this information we (or a reasoner) can conclude that John belongs to Person, because, for example, the domain of wife is Person and John has a wife. We can also directly state that an individual belongs to a class.

Individual: f:John Types: f:Person

There is more that can be said even about just this little part of familial relationships. For example, the inverse of the wife property is husband. As well, son and daughter are specializations of the child relationship. Further, no individual can be both a son and a daughter, so these properties are disjoint. Individuals have at most one age, so age is a functional data property. Individuals participate in at most one wife relationship and no individual is its own wife, so wife is functional, inverse functional, and irreflexive. (It is also possible to specify that a property is reflexive, but this is not commonly done because the property is then reflexive for all individuals.) As well, wife is asymmetric. Note that we have added more information about several properties. It is perfectly acceptable in OWL to have information about a property (or class, or individual) occur in several places.

ObjectProperty: f:hasHusband Inverses: f:hasWife
ObjectProperty: f:hasChild Domain: f:Person range f:Person
ObjectProperty: f:hasSon SubPropertyOf: f:hasChild
ObjectProperty: f:hasDaughter SubPropertyOf: f:hasChild
DisjointObjectProperties: f:hasSon f:hasDaughter
DataProperty: f:hasAge Characteristics: Functional
ObjectProperty: f:hasWife Characteristics: Functional, InverseFunctional, Irreflexive, Asymmetric

What we have said about families and about our particular family has a number of consequences. For example, because husband is the inverse of wife, Mary's husband is John. Complete OWL reasoning tools can efficiently determine whether a particular consequence follows from the information available.

So far we have written down quite a bit of information about familial properties, but we have only used a single class: Person. OWL has a rich language for defining classes in terms of other classes, but also in terms of the relations its instances may or must have to other individuals. So we might have classes for men, women, and parents, each of which is a specialization of Person.

Class: f:Man SubClassOf: f:Person
Class: f:Woman SubClassOf: f:Person
Class: f:Parent SubClassOf: f:Person

We can do much more in OWL with classes than just provide generalizations for them. OWL can provide partial or complete information about what is required to belong to a class. (The constructs used to provide information about classes are called descriptions in OWL.) For example, saying that people have exactly one age and one gender, that is either male or female]] provides (partial) information about people. Not only saying that every individual that belongs to Man also belongs to Person, but also saying that every Person that has gender male belongs to man, and similarly for Woman, provides complete information about what it takes to belong to these two classes. We can also say that every Person that has at least one child that is a Person belongs to Parent.

ObjectProperty: f:hasGender
Class: f:Person SubClassOf: f:hasAge exactly 1 and f:hasGender exactly 1 and f:hasGender only {f:female , f:male}
Class: f:Man EquivalentTo: f:Person and f:hasGender value f:male
Class: f:Woman EquivalentTo: f:Person and f:hasGender value f:female
Class: f:Parent EquivalentTo: f:Person and f:hasChild min 1 f:Person

Complete definitions enable many consequences in OWL. For example, from the above John belongs to Man and Parent. Some of the consequences can surprise users, so some OWL tools provide (rudimentary) facilities for showing how a consequence was determined.

In OWL, descriptions can be used just about anywhere a class name can be used. So, for example, we could provide more information about the wife, son, and daughter properties by giving them more specific domains and ranges.

ObjectProperty: f:hasWife Domain: f:Man Range: f:Woman
ObjectProperty: f:hasSon Domain: f:Parent Range: Person that f:hasGender value f:male
ObjectProperty: f:hasDaughter Domain: f:Parent Range: Person that f:hasGender value f:female

In this case, we could just as well have used Man and Woman for the ranges of son and daughter. This would provide exactly the same information to OWL, and OWL reasoners can determine this.

It may seem that there is a circularity in defining Parent as people with at least one child and also making it be the domain of child. In OWL, however, there is no problem. The two bits of information are simply different ways of saying the same thing.

OWL can also represent information about certain groupings of data values, called data ranges. For example, we might have Teenager as those people whose age is an integer that is at least 13 but less than 20, Adult as those people whose age is at least 21, and Child as those people whose age is in the complement of adult ages.

Class: Teenager EquivalentClass: Person and hasAge some integer[>= 13 , < 20]
Class: Adult EquivalentClass: Person and hasAge some integer[>= 21]
Class: Child EquivalentClass: Person and not ( hasAge some integer[>= 21] )

From this, Bill belongs to Teenager, but not Adult. Both John and Mary belong to Adult, but not to Teenage. Mary belongs to neither Adult nor to Teenage.

OWL uses built-in datatypes taken from XML Schema datatypes [XML Schema Datatypes], e.g., xsd:integer, to construct data ranges. Other useful datatypes include xsd:string and xsd:decimal.

4 More Expressive Modeling

So far we have seen OWL used as little more than a data structuring language. OWL is considerably more expressive than data structuring languages, in several useful ways. Some of this added expressive power illustrates the differences between OWL and other formalisms and why we have to understand how OWL is different.

In the example so far, we knew quite a bit of information. We knew, for example, that John's (only) age was 47. OWL is designed to deal with incomplete information, so it is quite common in OWL not to know, for example, the ages of all individuals belonging to Person, as just below.

Individual: f:Jeff
Facts: f:hasWife f:Emily,
f:hasChild f:Ellen,
f:hasChild f:Jack,
f:hasAge 77

It is a consequence of the above that Jeff belongs to Adult and not to Teenager. However, it cannot be determined whether Emily or Jack belong to Adult or Teenager, even though they both must have an age.

It is also possible to provide partial information about values, as in saying that Ellen's age is between 15 and 21, inclusive, that Emily's age is either 39 or 49, or even that Jack's age is not 53.


Individual: f:Emily Types: f:hasAge some {39 , 49}
Individual: f:Ellen Types: f:hasAge some integer[ 15, 21 ]
Individual: f:Jack Facts: not f:hasAge "53"^^integer

From this it is possible to determine that Emily belongs to Adult, even though we don't know her exact age, but we cannot determine that Ellen belongs to either Adult or Teenager. On the other hand, we could have a class YoungChild that was neither Adult nor Teenager. Ellen would then not belong to this class.

Class: f:YoungChild EquivalentTo: f:Person and not ( f:Teenager or f:Adult )

There are many sources of incompleteness in OWL, some of which may be surprising to some readers. For example, although it may seem to be the case that Jeff has exactly two children, this is not the case, nor is it the case that Jeff has at most one child that belongs to Man. Formally, the following is not a consequence of the above information.

(not in complete ontology)
Individual: f:Jeff Types: f:hasChild exactly 2
Individual: f:Jeff Types: f:hasChild max 1 f:Man

These do not follow because there is nothing saying that Jack and Ellen are the only children of Jeff, and OWL does not make any assumptions that something that has not been said is not true. It is possible to state that Jeff has no other children, and this can be done in a number of ways. One way that is often used for this purpose is to directly say that Jeff has exactly 2 children, which should certainly be adequate to infer that Jeff has exactly 2 children.

Individual: f:Jeff Types: f:hasChild exactly 2

However, even this is not adequate to infer that Jeff has only one child that belongs to Man. We have not stated that Jack and Ellen are different people, and there is nothing said so far that implies that they are not the same. Again OWL does not make the assumption that different names are names for different individuals. (This "unique names assumption" would be particularly dangerous in the Semantic Web, where names may be coined by different organizations at different times unknowingly referring to the same individual.) If Jack and Ellen are the same, then there could be another child of John, and this child could belong to Man.

One might think that Jack and Ellen are different because they have different genders, and people have exactly one gender. Unfortunately, we have not stated that male and female are different. We could just state that male and female are different, and have this imply that Jack and Ellen are different, but let's add in a reasonable collection of information about which individuals are different. Note that we don't really have to do this for John's family as their different ages imply that they are all different. Similarly the wifes and their husbands were already known to be different, because we already stated that wife is irreflexive.

DifferentIndividuals: f:John f:Mary f:Bill f:Susan
DifferentIndividuals: f:Jeff f:Emily f:Jack f:Ellen f:Susan
Individual: f:male DifferentFrom: f: female

It is also possible to state that two names refer to (denote) the same individual. For example, we can say that John and Jack are the same individual.

Individual: f:John SameAs: f:Jack

From the above we can conclude that Man and Woman are disjoint, i.e., that they can never have individuals belonging to both of them, because every Person has exactly one gender and individuals that belong to Man have a different gender (male) from those that belong to Woman (female). However, we can also use OWL to state that classes are disjoint. This is most often done for classes that lack complete conditions for belonging to the class. (These classes are called primitive classes.) So, for example, for ReligiousMarriage and CivilMarriage, we have to directly state their disjointness, and here we also say that Marriage is the union of the two.

Class: f:CivilMarriage
Class: f:ReligiousMarriage DisjointWith: f:CivilMarriage
Class: f:Marriage EquivalentTo: f:ReligiousMarriage or f:CivilMarriage

As it is common to have this situation of a class that is the union of a number of disjoint classes, OWL provides a shorthand method for saying this all at once.

(not in complete ontology)
Class f:Marriage DisjointUnionOf: f:ReligiousMarriage f:CivilMarriage

In OWL we can have transitive properties, i.e., properties like hasAncestor, which also is a generalization of the inverse of the hasChild property, and is also irreflexive.

ObjectProperty: f:hasAncestor Characteristics: Transitive, Irreflexive
ObjectProperty: f:hasChild SubPropertyOf: inverseOf f:hasAncestor

From the above information, we can now conclude that Bill has Jeff as an ancestor, and that Bill is not his own ancestor.

(not in complete ontology)
Individual: f:Bill
Facts: f:hasAncestor f:Jeff
not f:hasAncestor f:Bill

There are yet other kinds of information that we can provide about properties. We can have a spouse property as a symmetric and irreflexive generalization of wife.

ObjectProperty: f:hasSpouse Characteristics: Symmetric, Irreflexive
ObjectProperty: f:hasWife SubPropertyOf: f:hasSpouse

Although we haven't directly so stated, we can conclude that spouse is also a generalization of husband, because spouse is a symmetric generalization of the inverse of husband.

We could enrich our example to include a loves property as a generalization of the wife property. (Thus turning our simplied view of familial relationships into an idealistic one as well.)

ObjectProperty: f:loves Domain: f:Person
ObjectProperty: f:hasWife SubPropertyOf: f:loves

Because loves is not symmetric, we cannot conclude that loves is a generalization of husband. We have also not specified whether loves is reflexive or not, so some people may love themselves. We could have Narcissist, those people who love themselves, and add some more information about loves relationships>

Class: f:Narcissist EquivalentTo: f:Person that f:loves Self
Individual: f:Jeff Facts: f:loves f:Jeff
Individual: f:Bill Types: not f:Narcissist

From this we can conclude that Jeff belongs to Narcissist and that, of course, Bill does not.

In OWL we can also say some things about how properties combine, using chains of object properties. For example, we can say that sons and daughters are the same for both spouses, i.e., the sons and daughters of an individual include those of their spouse.

SubObjectProperty: f:hasSpouse o f:hasSon f:hasSon
SubObjectProperty: f:hasSpouse o f:hasDaughter f:hasDaughter

We can now conclude that Emily has the same sons and daughters as Jeff:

(not in complete ontology)
f:Emily f:hasChild f:Jack
f:Emily f:hasChild f:Ellen

It is also possible to provide conflicting information to OWL. For example, we could say that John has no children who belong to Woman, which conflicts with John having Susan as a daughter. An ontology with conflicting information allows all sorts of bad consequences - many OWL tools will detect inconsistent ontologies and provide some sort of repair mechanism.

(not in complete ontology)
Individual: f:John f:hasChild max 0 f:Woman

In the presence of conflicting information, determining consequences in OWL breaks down, so it is generally not a good idea to have conflicting information. There is no notion that OWL tools have to reject conflicting information. However, most OWL tools will at least provide some mechanisms to identify conflicting information and allow users to resolve the conflict.

5 Ontology Management

The information we have stated so far falls into two categories. We have stated general information about classes and properties related to familial relationships and particular information about two linked families. In OWL general information about a topic is almost always gathered into an ontology that is then used by various applications. We can also provide a name for OWL ontologies, which is generally the place where the ontology document is placed in the web. Particular information about a topic can also be placed in an ontology, if it is used by different applications.

Ontology: <http://example.com/owl/families>

We place OWL ontologies into OWL documents, which are then placed into local filesystems or on the World Wide Web. Aside from containing an OWL ontology, OWL documents also contain information about transforming the short names used in OWL ontologies (e.g., f:Person) into IRIs, by providing the expansion for prefixes. The IRI is then the concatention of the prefix expansion and the reference.

In our example ontology we have used two prefixes, f and xsd. The latter prefix has been used in compact names for XML Schema datatypes, whose IRIs are fixed by the XML Schema recommendation. We thus must use the standard expansion for xsd, which is http://www.w3.org/2001/XMLSchema#. The expansion we pick for the other prefix will affect the names of the classes, properties, and individuals in our ontology, as well as the name of the ontology itself. If we are going to put the ontology on the web, we should pick an expansion that is in some part of the web that we control, both so that we are not using someone else's names by accident. (Here we use a made-up name that no one controls.) The two XML-based syntaxes need namespaces for built-in names and also use XML entities for namespaces.

Namespace: f = <http://example.com/owl/families#>
Namespace: g = <http://example.com/owl2/families#>
Namespace: dc = <http:...#>

It is also common in OWL to reuse general information in other ontologies. Instead of requiring the copying of this information, OWL allows the importation of the contents of entire ontologies in other ontologies, using imports statements, as follows:

Import: http://example.com/owl2/families

As the Semantic Web and ontology construction is distributed it is common for ontologies to use different names for the same concept, property, or individual. Several constructs in OWL can be used to state that different names refer to the same class, property, or individual, so, for example, we could tie the names used in our ontology to the names used in an imported ontology as follows:

SameIndividual: f:male g:masculine
SameIndividual: f:female g:feminine
EquivalentClasses: f:Adult g:Grownup
EquivalentObjectProperties: f:hasChild g:child
EquivalentDataProperties: f:hasAge g:age

In many cases we want to associate information with parts of our OWL ontology. OWL provides annotations for this purpose. An OWL annotation simply associates property-value pairs with parts of an ontology, or the entire ontology itself. This information is not really part of the logical meaning of an ontology.

So, for example, we could add author information to one of the facts in our ontology and to one of the classes.

Individual f:John Facts: Annotations: dc:author Individual(f:peter) dc:creationDate "2008-01-10"^^xsd:date rdfs:comment "A simple fact about John" f:hasWife f:Mary Class: f:Person Annotations: dc:author Individual(f:peter) dc:creationDate "2008-01-10"^^xsd:date rdfs:label "Person":en rdfs:label "Persona":it rdfs:comment "The class of people"

To help with managing ontologies, OWL has the notion of declarations. The basic idea is that each class, property, or individual is supposed to be declared in an ontology, and then it can be used in that ontology and ontologies that import that ontology.

In the Manchester syntax, declarations are implicit. Constructs that provide information about a class, property, or individual implicitly declare that class, property, or individual if needed. The other syntaxes have explicit declarations.

6 Remaining Constructs

There are a few other kinds of things that can be said in OWL, but that do not fit into this example, including the following:

Details on these constructs can be found in the OWL 2 Structural Specification and Functional Syntax document [OWL 2 Specification].

7 Using OWL

Editor's Note: Give a worked example. I was thinking some policy both background knowledge and underlying the formalisms. Or perhaps a Galenesque example.

8 OWL Tools

Editor's Note: Different sorts of OWL tools. Maybe some discussion of using XML tooling or RDF tooling. Reasoner services. Whatev

9 OWL Profiles

As we have seen, reasoning in OWL can be complicated. The full story of reasoning in OWL is beyond the scope of this primer, but there are some implications of reasoning that deserve treatement here.

If we did not place further restrictions on what we can say in OWL, e.g., classes, properties, and even bits of syntax can be used as individuals as in the Semantic Web language RDF, reasoning becomes formally undecidable. Nevertheless, there is some utility in being able to do this, so there is a mode of using OWL, called OWL Full that allows all this. The price, of course, is that reasoning tools are hard to write and are necessarily incomplete.

There are a set of reasonable restrictions, however, that make reasoning in OWL decidable, and for which, moreover, there exist effective reasoning tools. This mode of using OWL is called OWL DL.

To allow effective reasoning tools, OWL DL limits the kinds of things that can be said about certain properties. Properties are said to be composite if they or their inverses are transitive or have a property chain as a subproperty. Properties that are composite or have a composite property as a specialization of themselves or their inverses are not allowed to be functional, inverse functional, irreflexive, asymmetric, or disjoint with any other property; nor are they allowed to participated in cardinality or self conditions. As well, there is a complex condition on how object property chains are constructed to prevent loops related to object property chains. OWL DL tools should recognize whether these conditions are violated in an ontology.


OWL DL allows the same name to be used for any or all of a class, a property, and an individual. However, the different aspects of this name are not tied to one another, so that if, for example, we said, perhaps by accident that Person and Man were the same individual, they would not also be equivalent classes.

SameIndividual: f:Person f:Man

The above would not allow the conclusion of:

EquivalentClasses: f:Person f:Man

OWL Full is formally stronger than OWL DL in this area (and in a few other areas) so in OWL Full this conclusion could be drawn.

Reasoning in OWL DL is still difficult, and can take a very long time in the worst case. Certain profiles of OWL DL have been identified that guarantee better worst-case performance for reasoning. The document on OWL profiles [OWL 2 Profiles] identifies and chacterizes several of these profiles that have been shown to be useful in practice. Staying within one of these profiles limits what we can say, but this tradeoff can often be desirable when writing large ontologies, particularly for important applications.

10 What to Do Next

This short primer can only scratch the surface of OWL. There are many longer and more involved tutorials on OWL and how to use OWL tools that can be found by searching on the Web. Reading one of these primers and using a tool to build an OWL ontology is probably the best way to learn more about OWL.

This short primer is also not a normative definition of OWL. The normative definition of the OWL syntax as well as informative definitions of each OWL construct can be found in the OWL 2 Structural Specification and Functional Syntax document [OWL 2 Specification].

For those interested in more formal documents, the formal meaning of OWL 2 can be found in the OWL 2 Semantics document [OWL 2 Semantics], and the mapping between OWL syntax and RDF triples can be found in the OWL 2 Mapping to RDF Graphs document [OWL 2 RDF Mapping].

11 Appendix: OWL Features

Here is a list of the various OWL features. The features presented in this primer are linked to from this list.

Ontologies Object Properties Descriptions
ontology names domain intersection
namespaces range union
annotations functional complement
Classes inverse functional sets
subclassof reflexive object property some
equivalent (2-way, N-way) irreflexive object property only
disjoint (2-way, N-way) symmetric object property min
Dataranges asymmetric object property max
built-in datatypes transitive object property exact
datatype restrictions specialization object property value
complement equivalent (2-way, N-way) object property self
sets disjoint (2-way, N-way) data property some
Individuals object property chains data property all
same (2-way, N-way) Data Properties data property min
different (2-way, N-way) domain data property max
types range data property exact
object property facts functional data property value
negative object property facts specialization
data property facts equivalent (2-way, N-way)
negative data property facts disjoint (2-way, N-way)

12 Appendix: The Complete Example

Here we include the complete example OWL ontology. The ontology here is ordered in a commonly-used ordering, with ontology information first, followed by information aabout properties, then classes, then individuals. Extra annotations have been added (not YET) to help explain the ontology.

Namespace: = <http://example.com/owl/families#> Namespace: f = <http://example.com/owl/families#> Namespace: g = <http://example.com/owl2/families.owl#> Namespace: dc = <http://purl.org/dc/elements/1.1/> Ontology: <http://example.com/owl/families> Import: <http://example.com/owl2/families.owl> ObjectProperty: hasWife Characteristics: Functional, InverseFunctional, Irreflexive, Asymmetric Domain: Person, Man Range: Person, Woman SubPropertyOf: hasSpouse, loves ObjectProperty: hasHusband Inverses: hasWife ObjectProperty: hasSon Domain: Person, Parent Range: Person, Person that hasGender value male SubPropertyOf: hasChild DisjointObjectProperties: hasSon hasDaughter SubObjectProperty: f:hasSpouse o f:hasSon f:hasSon ObjectProperty: hasDaughter Domain: Person, Parent Range: Person, Person that hasGender value female SubPropertyOf: hasChild SubObjectProperty: f:hasSpouse o f:hasDaughter f:hasDaughter ObjectProperty: hasGender ObjectProperty: hasChild Domain: Person Range: Person SubPropertyOf: inverseOf hasAncestor ObjectProperty: hasAncestor Characteristics: Transitive, Irreflexive ObjectProperty: hasSpouse Characteristics: Symmetric, Irreflexive ObjectProperty: loves Domain: Person DataProperty: hasAge Characteristics: Functional Domain: Person Range: integer Class: Person SubClassOf: hasAge exactly 1 and hasGender exactly 1 and hasGender only {female , male} Class: Man SubClassOf: Person EquivalentTo: Person that hasGender value male Class: Woman SubClassOf: Person EquivalentTo: Person that hasGender value female Class: Parent SubClassOf: Person EquivalentTo: Person that hasChild min 1 Class: Teenager EquivalentTo: Person that hasAge some integer[>= 13 , < 20] Class: Adult EquivalentTo: Person that hasAge some integer[>= 21] Class: Child EquivalentTo: Person and not (hasAge some integer[>= 21]) Class: YoungChild EquivalentTo: Person and not (Teenager or Adult) Class: Marriage EquivalentTo: CivilMarriage or ReligiousMarriage Class: ReligiousMarriage DisjointWith: CivilMarriage Class: CivilMarriage Class: Narcissist EquivalentTo: Person that loves Self Individual: male DifferentFrom: female Individual: female Individual: John Types: Person Facts: hasWife Mary, hasSon Bill, hasDaughter Susan, hasAge 33, hasGender male SameAs: Jack Individual: Mary Facts: hasSon Bill, hasDaughter Susan, hasAge 31, hasGender female Individual: Bill Types: not (Narcissist) Facts: hasAge 13, hasGender male Individual: Susan Facts: hasAge 8, hasGender female Individual: Jeff Types: hasChild exactly 2 Facts: hasWife Emily, hasChild Ellen, hasChild Jack, hasAge 77, loves Jeff Individual: Emily Types: hasAge some {39 , 49} Individual: Ellen Types: hasAge some integer[>= 15 , <= 21] Individual: Jack Facts: not hasAge "53"^^integer DifferentIndividuals: f:John f:Mary f:Bill f:Susan DifferentIndividuals: f:Jeff f:Emily f:Jack f:Ellen f:Susan SameIndividual: f:male g:masculine SameIndividual: f:female g:feminine EquivalentClasses: f:Adult g:Grownup EquivalentObjectProperties: f:hasChild g:child EquivalentDataProperties: f:hasAge g:age

13 Acknowledgments

Editor's Note: There'll be a list of everyone whose comments resulted in a change to a draft of the text.

14 References

[OWL 2 Profiles]
OWL 2 Web Ontology Language:Profiles Bernardo Cuenca Grau, Boris Motik, Zhe Wu, Achille Fokoue, Carsten Lutz. W3C Working Draft, 11 April 2008, http://www.w3.org/TR/2008/WD-owl2-profiles-20080411/. Latest version available at http://www.w3.org/TR/owl2-profiles/.
[OWL 2 Manchester Syntax]
OWL 2 Web Ontology Language: Manchester Syntax. Matthew Horridge and Peter F. Patel-Schneider and others, 2008.
[OWL 2 RDF Mapping]
OWL 2 Web Ontology Language:Mapping to RDF Graphs Bernardo Cuenca Grau, Boris Motik. W3C Working Draft, 11 April 2008, http://www.w3.org/TR/2008/WD-owl2-mapping-to-rdf-20080411/. Latest version available at http://www.w3.org/TR/owl2-mapping-to-rdf/.
[OWL 2 Semantics]
OWL 2 Web Ontology Language:Model-Theoretic Semantics Bernardo Cuenca Grau, Boris Motik. W3C Working Draft, 11 April 2008, http://www.w3.org/TR/2008/WD-owl2-semantics-20080411/. Latest version available at http://www.w3.org/TR/owl2-semantics/.
[OWL 2 Specification]
OWL 2 Web Ontology Language:Structural Specification and Functional-Style Syntax Boris Motik, Peter F. Patel-Schneider, Ian Horrocks. W3C Working Draft, 11 April 2008, http://www.w3.org/TR/2008/WD-owl2-syntax-20080411/. Latest version available at http://www.w3.org/TR/owl2-syntax/.
[OWL 2 XML Syntax]
OWL 2 Web Ontology Language:XML Serialization Bernardo Cuenca Grau, Boris Motik, Peter Patel-Schneider. W3C Working Draft, 11 April 2008, http://www.w3.org/TR/2008/WD-owl2-xml-serialization-20080411/. Latest version available at http://www.w3.org/TR/owl2-xml-serialization/.
[XML Schema Datatypes]
XML Schema Part 2: Datatypes Second Edition. Paul V. Biron and Ashok Malhotra, eds. W3C Recommendation 28 October 2004.
[OWL Web Ontology Language Overview]
OWL Web Ontology Language Overview. W3C Recommendation 10 Feb 2004. McGuinness, van Harmelen, eds.
[OWL Web Ontology Language Guide]
OWL Web Ontology Language Guide. W3C Recommendation 10 Feb 2004. Smith, Welty, McGuinness eds.
[OWL Web Ontology Language Reference]
OWL Web Ontology Language Reference. W3C Recommendation 10 Feb 2004. Dean, Schreiber, eds.
[OWL Web Ontology Language Semantics and Abstract Syntax]
OWL Web Ontology Language Semantics and Abstract Syntax. W3C Recommendation 10 Feb 2004. Patel-Schneider, Hayes, Horrocks, eds.
[OWL Web Ontology Language Test Cases]
OWL Web Ontology Language Test Cases. W3C Recommendation 10 Feb 2004. Carroll, De Roo, eds.
[OWL Web Ontology Language Use Cases and Requirements]
OWL Web Ontology Language Use Cases and Requirements. W3C Recommendation 10 Feb 2004. Heflin, ed.