 | Level: Intermediate Michel Mitri (mitrimx@jmu.edu), Associate Professor, James Madison University Nicholas Chase (ibmquestions@nicholaschase.com), Freelance writer, Backstop Media
17 Oct 2006 Updated 08 Mar 2007 This series details the creation of a mashup application that gives control over the data displayed back to the user. Now that you know how to create an ontology that defines the concepts represented by a service, you can enable users to choose which service they want to use.
In this tutorial
The purpose of this tutorial series 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 began as you learned about RDF and RDFS, two key ingredients in the Web Ontology Language (OWL), which is discussed in 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, 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 that is used for a custom mashup. In this tutorial, you will encode information about individual services in an OWL file. You will then use the Jena API to extract that information and utilize it to make a REST request. Finally, you convert the REST response into the generic form, displaying it on the HTML page as before.
Objectives - Load and manipulate an ontology
- Programmatically extract individuals from an ontology
- Access properties their values from an ontology or other RDF document
- Transform an arbitrary REST result into a generic ontological individual
- Display ontology information in HTML
Prerequisites
This tutorial is for developers who wish to learn how to utilize an ontology using an API -- specifically, in this case, the Jena API -- as well as those who just want to see how ontologies and other semantic concepts might be used in a real-world application. It takes the ontology you built in Parts 3 and 4 and integrates it into the mashup you built in Part 1, in order to give the user a choice of services for use in the application.
This tutorial assumes that you are familiar with the concepts of XML, Resource Description Framework (RDF), ontologies, and the Web Ontology Language (OWL). It also uses the Java programming language, but if you are just looking for a conceptual idea of how this might be done, that's not important. If you need a refresher on any of these concepts (except for Java, of course) see the previous parts of this series. You can find links to them (and to good resources for Java) in the Resources of this tutorial.
System requirements
You will need JavaScript enabled in your browser. 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. You won't be doing anything fancy as far as compilation and deployment are concerned.
Duration
2 hours
Formats html, pdf
|  | |  |