Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

The ultimate mashup -- Web services and the semantic Web, Part 1: Use and combine Web services

Explore mashup concepts and build a simple mashup

Nicholas Chase (ibmquestions@nicholaschase.com), Freelance writer, Backstop Media
Nicholas Chase has been involved in Web site development for companies such as Lucent Technologies, Sun Microsystems, Oracle, and the Tampa Bay Buccaneers. Nick has been a high school physics teacher, a low-level radioactive waste facility manager, an online science fiction magazine editor, a multimedia engineer, an Oracle instructor, and the Chief Technology Officer of an interactive communications company. He is the author of several books, including XML Primer Plus (Sams).

Summary:  As Web services grow in popularity, enterprising Web and application developers create new and innovative applications with their data. In addition to single-service applications, developers are creating mashups, applications that combine data from multiple services to create something new. This series chronicles the creation of the ultimate mashup, an application that not only stores data from different mashups but uses semantic technology to enable users to create their own mashups by swapping services, or even by picking and choosing data. It uses Java™ programming and a combination of servlets, JSP, software from the open source Jena project, and DB2's new native XML capabilities. In this part, Nicholas Chase introduces the concept of mashups, shows you how they work and how to build a simple version of one.

View more content in this series

Date:  08 Mar 2007 (Published 22 Aug 2006)
Level:  Intermediate PDF:  A4 and Letter (416 KB | 41 pages)Get Adobe® Reader®

Activity:  36800 views
Comments:  

Before you start

This tutorial is for developers who want to learn more about using and combining Web services from the XML point of view, and how to output that data to the Web. All services discussed in this tutorial are REST services, but the concepts are the same for SOAP services. This tutorial assumes that you are familiar with Java™ programming, XML, Web development, and the basic concepts of Web services. If you need a refresher on these topics, please see Resources for more information.

About this series

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. When you consider 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 to combine 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 they are all developed for a specific set of services. 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 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:

Here in Part 1, I introduce the concept of mashups, showing you how they work and building a simple version of one. You also discover serious performance problems involved in making potentially dozens of Web calls.

In Part 2, you solve some of that problem by using DB2's new pureXML capabilities to build an XML cache, which saves 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 you start that process by learning about RDF and RDFs, two key ingredients in the Web Ontology Language (OWL), which I discuss in Part 4. In Part 5, you take the ontologies created in Part 4 and use them to enable users to change out information sources.

In Part 6, the fun increases. 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, enabling him or her to map new services into the ontology and to pick and choose the data that is used for a custom mashup.


About this tutorial

Over the course of this tutorial, you will learn how to create an application that retrieves and displays Web service information from a generic point of view; in other words, adding new services is practically a matter of configuration rather than programming.

This tutorial teaches you to:

  • Request data from a REST Web service

  • Easily serialize XML data for output or display

  • Create an XML template, and then replace pre-determined elements and attributes with dynamic data

  • Add XML nodes from multiple documents into a single output document

  • Create a system that displays multiple Web services

  • Create a system in which one Web service can provide information based on the output of a second Web service

This tutorial uses the Java language, but the concepts are the same for any programming language or operating system.


Prerequisites

To follow along with the code in this tutorial, you will need to have the following software installed and tested.

  • 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 do anything fancy as far as compilation and deployment are concerned.

In Parts 2, 4, 5, and 6 of the series, you will also need:

1 of 11 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML, Information Management, Java technology, Open source, Web development, SOA and Web services
ArticleID=154966
TutorialTitle=The ultimate mashup -- Web services and the semantic Web, Part 1: Use and combine Web services
publish-date=03082007
author1-email=ibmquestions@nicholaschase.com
author1-email-cc=dwxed@us.ibm.com