SOAPclientForOpenCalais

A SOAP Client for Open Calais

This document shows you how to write a simple, console-based Java SOAP client to access the Open Calais web service. The concepts presented in this tutorial are also useful when you write a SOAP client for any other web service.

Introduction- The Calais Web Service

According to http://opencalais.mashery.com/Overview "The Calais web service automatically attaches rich semantic metadata to the content you submit – in well under a second. Using natural language processing, machine learning and other methods, Calais categorizes and links your document with entities (people, places, organizations, etc.), facts (person ‘x’ works for company ‘y’), and events (person ‘z’ was appointed chairman of company ‘y’ on date ‘x’). The metadata results are stored centrally and returned to you as industry-standard RDF constructs accompanied by a Globally Unique Identifier (GUID). Using the Calais GUID, any downstream consumer is able to retrieve this metadata via a simple call to Calais.

This metadata gives you the ability to build maps (or graphs or networks) linking documents to people to companies to places to products to events to geographies to … whatever. You can use those maps to improve site navigation, provide contextual syndication, tag and organize your content, create structured folksonomies, filter and de-duplicate news feeds or analyze content to see if it contains what you care about. And, you can share those maps with anyone else in the content ecosystem. "

How does it work?

From a programmer's point of view, you construct a SOAP request and send it to the web service remote endpoint. The web service replies with the output in Resource Description Framework.

Prerequisites

NetBeans IDE (preferably 6.0 + ), Web and Java EE installation

JDK 1.6.0 +

Cursory Knowledge of RDF

Cursory knowledge of the Semantic web

Cursory knowledge of Web Services

Creating the SOAP Client for Open Calais

Create a Java application project. In this project, create a web service client that consumes the Open Calais enlighten service.

In the New Project wizard, create a Java application project. Name it contextualizer. Accept all default settings--it should create a Main class.

More Exercises

What we obtained is RDF and not human readable. It does not show the amazing things that can be done with the power of Open Calais. However, we have now done the "back office" job. Next, you can try to:

Use this RDF to obtain the returned information in a useful format.

Build an application called "contextualiser" (hence I chose this name for the Java application here) which returns contextual information about the query text.

Knowledge about RDF is necessary to draw relevant information from the RDF output. The following tools/libraries can be helpful:

Endnotes

The main objective of this tutorial was to show how you could create a JAX-WS client that interacts with the Open Calais Web Service. However, the concepts can also be used to write a client to interact with any other Web-Service instead.