OWL 101

OWL 101

Introduction

OWL (or Web Ontology Language) is the ontology (think "schema") language of the Semantic Web. It is one of the core Semantic Web standards you must be familiar with, along with RDF and SPARQL.

Its two primary uses are:

  1. Fast and flexible data modeling
  2. Efficient automated reasoning

This lesson gives a high level introduction to OWL and is suitable for beginners. A more detailed nuts & bolts lesson on creating your first ontology will come next.

Objectives

After completing this lesson, you will know:

  • The four main kinds of modern computing languages, and which kind OWL is
  • Three advantages of OWL over other languages of its kind
  • A few of the tools available for creating ontologies using OWL

Prerequisites

Today's Lesson

Four main types of computer languages are in use today.

  1. Imperative languages, such as C/C++, Java, Javascript, Lisp, and Perl. These languages are designed to let you easily provide a sequence of instructions that tell the computer how to do something. For example, these languages might be used to tell a computer how to compute the 100th digit of PI, how to draw a monster on the screen, or how to process an online book order.
  2. Query languages, such as SQL and XQuery. These languages assume the existence of a database of some sort and are simply used to ask for a specific piece of information.
  3. Data languages, such as XML, HTML, and JSON. These languages don't do anything, and they don't ask for anything. They are simply a standard format for conveying data from one machine or person to another.
  4. Modeling languages, such as XSD, UML, and (in a way) SQL. These languages don't necessarily do anything or ask for anything, and they don't really convey any actual data. Rather, they say something about data.

OWL falls into the last category—it is a modeling language.

Although OWL is a modeling language in the classical sense, it has many advantages compared to the modeling languages that came before it.

Advantage 1: OWL is Expressive

Legacy languages such as XSD, UML, and SQL are adequate for listing a number of classes and properties and building up some simple hierarchical relationships. For example, SQL allows you to build a new table for each class, add a new column for each property, and specify some basic relationships using foreign keys.

However, SQL does not easily allow you to represent subclass relationships (e.g., "all Electronic Book Orders are a kind of Financial Transaction").

More expressive languages such as UML make static subclasses easy, but even they cannot easily represent dynamic relationships (e.g., "All Financial Transactions of Less than $1000 are Tax Free Transactions").

One of the distinguishing features of OWL is that it can be used to express extremely complicated and subtle ideas about your data.

Advantage 2: OWL is Flexible

Currently, most of the technologies that employ data modeling languages are designed using a rigid "Build the Model, then Use the Model" mindset.

For example, suppose you want to change a property in a relational database. You had previously thought that the property was single-valued, but now it needs to be multi-valued. For almost all modern relational databases, this change would require you to delete the entire column for that property and then create an entirely new table that holds all of those property values plus a foreign key reference.

This is not only a lot of work, but it will also invalidate any indices that deal with the original table. It will also invalidate any related queries that your users have written. In short, making that one change can be very difficult and complicated. Often, such changes are so troublesome that they are simply never made.

By contrast, all data modeling statements (along with everything else) in OWL are RDF triples and are therefore incremental, by their very nature. Enhancing or modifying a data model after the fact can be easily accomplished by modifying the relevant triple. Most OWL-based technologies take advantage of OWL's flexibility by supporting such straightforward changes.

Advantage 3: OWL is Efficient

OWL allows you to use your data model to support many different kinds of reasoning tasks. This powerful ability to support data reasoning allows developers to minimize the data that are explicitly stored and to minimize the complexity of the queries needed to retrieve those data.

However, on today's computers, certain kinds of reasoning can be performed far faster than other kinds of reasoning. OWL therefore comes with a number of built-in "profiles" that allow you to trade off the kinds of reasoning you would like to do against your individual performance goals.

OWL Tools

Many software packages are now available for creating ontologies using OWL.

  • Stanford University's Protégé, a free, open-source ontology editor
  • TopBraid Composer from TopQuadrant
  • Any text editor you have lying around

Unlike some other languages, which always look the same, OWL actually can be "written down" in many different ways. OWL—as with all RDF—can be expressed in a canonical OWL/XML format as well as RDF/XML format. It can also be expressed in more human readable formats such as TRIG, Manchester, Turtle, and Functional-Style.

Details on the OWL syntax standards as well as some examples of how to switch dynamically between various syntaxes can be found on the W3C website.

Conclusion

OWL's expressiveness, flexibility, and efficiency make it an ideal modeling language for creating web ontologies that represent exceptionally complex and refined ideas about data. In the next lesson, RDFS vs. OWL we'll compare RDFS and OWL and discuss when should you use one vs. the other.