Before you start
This tutorial is for readers who want to better understand the development of ontologies, or classifications of concepts, and how they relate to the semantic Web. It is also for readers who want to understand some of the reasoning options made available by the Web Ontology Language (OWL). This tutorial assumes that you are familiar with the concepts behind the Resource Description Framework (RDF), which you can gain by reading Part 3 of this series (see Resources). You should also have general familiarity with XML, but we will not be going deeply into these concepts.
No programming skills are required to complete this tutorial.
It seems you can't turn around on the Web these days without running into a Web site that either offers access to its data through a Web-services-based API or uses data from another site obtained through a Web-services-based API. Considering the advantage of using existing information in your own applications, that's probably not terribly surprising. It was also just a matter of time before someone started combining the data from these disparate systems to create something entirely new. These applications, called mashups, are the latest rage on the Web, from community-based sites to specialized search sites to the ever-present mapping mashups.
Mashups are (almost) all useful, but one thing that they have in common is that they are all developed for a specific set of services, and if one of those services changes, or if the preference for a specific service of a particular type changes, you'll have lots of work to do.
The purpose of this tutorial series (see Resources) is to create a mashup application so smart that users can literally add and remove services at will, and the system will know what to do with them. The series progresses as follows:
Part 1 introduced the concept of mashups, showing how they work and building a simple version of one. Serious performance problems involved in making potentially dozens of Web calls were also discovered.
Part 2 solved some of that problem by using the new pureXML™ capabilities of IBM® DB2® to build an XML cache, which saves the the results of previous requests and also enables you to retrieve specific information.
Ultimately, you will need to use ontologies, or vocabularies that define concepts and their relationships, so in Part 3 that process was started by learning about RDF and RDFS, two key ingredients in the Web Ontology Language (OWL), which is discussed in here Part 4. In Part 5, you will take the ontologies created in Part 4 and use them to enable users to change out information sources.
In Part 6, things get really fun. At this point you have a working application and the framework in place so that the system can use semantic reasoning to understand the services at its disposal. In this part, you give the user control, and enable him or her to map new services into the ontology and to pick and choose the data used for a custom mashup.
Previous parts of this series explained what a mashup is, and how you can use it to combine data from multiple sources. A goal of this series is to provide a system that has built-in intelligence, such as the ability to switch out one service for another without having to know precisely how information is represented beforehand. To do that, you will need a way to define concepts such as bookstore, DVD, price, and so on. Building on the discussion of the Resource Description Framework from Part 3 (see Resources), here in Part 4 you will create an ontology, or classification of concepts, using the Web Ontology Language (OWL).
During the course of this tutorial, you will learn:
- What ontologies are
- What the Web Ontology Language is
- The different species of OWL
- How to create an ontology
- How to create subclasses
- Different types of OWL properties
- How to add information to the ontology to enable reasoning
- OWL-S and what it means for the classification of Web services
During the course of this tutorial, you will build a sample ontology for a bookstore, which will enable you to look at how to switch out one bookstore for another in Part 5.
To follow along with the code in this tutorial, you will need to install and test the following software:
- IBM® DB2® 9 (formerly known as "Viper"): This relational database also includes significant XML capabilities, which you'll need for this tutorial. You can download a trial version of DB2 9: DB2 Enterprise 9 or DB2 Express-C 9, a no-charge version of DB2 Express 9 data server.
- Apache Tomcat or other servlet engine: This tutorial assumes that you will build Web applications using servlets, so you'll need a servlet engine such as Apache Tomcat. If you choose to build the application using another environment, just make sure you have the appropriate software on hand. Download apache-tomcat-5.5.17.zip and install into a directory with no spaces in the directory name.
- Java: Apache Tomcat 5.5, with which this tutorial is built, requires Java 1.5 or higher. Download the J2SE SDK.
- To make things easier, you can use an IDE such as Eclipse or IBM Rational™ Web Developer for your development. You can download Eclipse at Eclipse.org, download a trial version of Rational Web Developer, or use your favorite development environment. We won't do any fancy compilation and deployment.

