Instructions for using the Matchmaker Client API
 
 
  1. Overview
  2. Download & Installation
  3. OWLSMatchmakerClient
    1. Publishing in the OWL-S/UDDI Matchmaker
    2. Querying the OWL-S/UDDI Matchmaker
    3. Removing an Advertisement
  4. Users behind Firewall

Overview

The Matchmaker Client allows your application to interact with the OWL-S/UDDI matchmaker.
 

Download and Installation

Click here to download the matchmaker client api.

Dependences:

  • Java 1.5 or higher
  • Apache Ant (version 1.6.5 or higher is recommended)
  • To run tests you also need Apache Ant with JUnit extension installed

Contents of the Downloaded file:

  • src/ - source code
  • test/ - unit tests source code
  • docs/ - documentation
  • docs/api - javadocs for matchmaker client
  • lib/ - third party libraries
  • matchmaker-client.jar - matchmaker client API jar file
  • build.xml - build file for compiling the owlsapi.jar file and running tests
  • README
  • license.txt

Running the tests

Matchmaker client comes with all necessary libraries included. The build script is provided that allows you to compile the matchmaker client and to run the JUnit test.
  • To compile go to the directory where you installed the software and on the command line type the following command:
    ant jar

  • You can run tests to verify that the installation is correct and that the OWL-S UDDI matchmaker was installed correctly. These test cases assume that matchmaker was installed on the localhost on the port 8080.
    To run tests use the following command:
    ant run-tests

    Please note that you must be connected to the internet to be able to run tests successfully.

OWLSMatchmakerClient

OWLSMatchmakerClient class provides methods to interact with the OWL-S/UDDI Matchmaker. The OWLSMatchmakerClient internally used UDDI API's UDDIProxy class to interact with UDDI registry. You can gain access to the internal UDDI proxy using the getUDDIProxy() method. Ideally you would use OWLSMatchmakerClient for OWLS related operation and the UDDIProxy for UDDI related operations.

The following System properties has to be set before calling any operation in the OWLSMatchmakerClient

inquiryURL
URL of the UDDI's inquiry port - System.setProperty("inquiryURL", "<inquiry-url>")
publishURL
URL of the UDDI's publish port - System.setProperty("publishURL", "<publish-url>")
username
User ID with publishing authority - System.setProperty("UDDIusername","<username>");
password
password of the username - System.setProperty("UDDIpassword","<password>");

You can find a usefull example of the source code setting these properties in the following file: test/EDU/cmu/Atlas/matchmaker/client/TestOWLSMatchmakerClient.java
 

Publishing in the OWLS/UDDI Matchmaker

OWLS Profiles can be registered using OWLSMatchmakerClient's publish method. The method take an OWLS Profile URL as input and give BusinessDetail as output, similar to the UDDI publish method. The following code snippet shows how to register an OWLS Profile. (Note: For brevity purpose we have ignored the try-catch blocks)

 

//Setting information about UDDI registry
System.setProperty("inquiryURL", "http://localhost:8080/juddi/inquiry");
System.setProperty("publishURL", "http://localhost:8080/juddi/publish");
System.setProperty("UDDIusername", "juddi");
System.setProperty("UDDIpassword", "password");

//Creating a new matchmaker client
OWLSMatchmakerClient mc = new OWLSMatchmakerClient();

//registering the OWLS Profile
BusinessDetail bd = mc.register("http://www.daml.ri.cmu.edu/iswcdemo/navn/BravoAirProfile.owl");

 

Querying the OWLS/UDDI Matchmaker

The queries in OWLSMatchmakerClient API are represented using CapabilitySearch class. You can query the OWLS/UDDI Matchmaker by either directly using the CapabilitySearch object or using an OWLS Profile URL. When queried using a URL, the client API maps OWLS Profile to CapabilitySearch based on a mapping similar to the OWLS UDDI Mapping. The following code snippets show both ways to query OWLS/UDDI Matchmaker.

Using OWLS Profile URL:

  //Setting information about UDDI registry
System.setProperty("inquiryURL", "http://localhost:8080/juddi/inquiry");
System.setProperty("publishURL", "http://localhost:8080/juddi/publish");
System.setProperty("UDDIusername", "juddi");
System.setProperty("UDDIpassword", "password");

//Creating a new matchmaker client
OWLSMatchmakerClient mc = new OWLSMatchmakerClient();

MatchmakerResultList mrl = mc.query("http://www.daml.ri.cmu.edu/iswcdemo/navn/BravoAirProfile.owl");

Using CapabilitySearch object:

 

//Creating a CapabilitySearch object
CapabilitySearch capabilitySearch = new CapabilitySearch();

//Adding the URLs of ontologies used by the query (i.e. ontologies used by the query's inputs and outputs)
capabilitySearch.addImportURL("http://www.daml.ri.cmu.edu/iswcdemo/navn/BravoAirProfile.owl");

//Adding the concept that represent the input
capabilitySearch.addInput("http://www.daml.ri.cmu.edu/iswcdemo/navn/BravoAirConcept.owl#Airport");

//Adding the concept that represent the output
capabilitySearch.addOutput("http://www.daml.ri.cmu.edu/iswcdemo/navn/BravoAirConcept.owl#ETicket");

//Setting information about UDDI registry
System.setProperty("inquiryURL", "http://localhost:8080/juddi/inquiry");
System.setProperty("publishURL", "http://localhost:8080/juddi/publish");
System.setProperty("UDDIusername", "juddi");
System.setProperty("UDDIpassword", "password");

//Creating a new matchmaker client
OWLSMatchmakerClient mc = new OWLSMatchmakerClient();

//Use the capability object to query
MatchmakerResultList mrl = mc.query(capabilitySearch);

 

Removing an Advertisement

You can unregister an advertisement using the URL of the advertisement or using the URI of the Profile.

 

//Set information about UDDI registry. See above code snippets for details.

//Creating a new matchmaker client
OWLSMatchmakerClient mc = new OWLSMatchmakerClient();

//Use the capability object to query
RemoveProfileResult rpr = mc.removeProfile(capabilitySearch);

 

Users behind Firewall

Users behind firewall may face problems loading ontologies and interacting with the OWLS/UDDI Matchmaker caused by Jena and UDDI API respectively. Users have to specify their proxy information explicitly to Jena and UDDI API to solve these problems.

Setting proxy information in Jena
Jena can be set use to a proxy by setting the following system properties in the command line. They can also be set from your application code using the System.setProperty method.

To use a socks proxy include the following in the command line:
-DsocksProxyHost=<your-proxy-domain-name-or-ip-address>

To use an http proxy include the following on the command line:
-DproxySet=true -DproxyHost=<your-proxy> -DproxyPort=<your-proxy-port-number>

For more details please visit http://cvs.sourceforge.net/viewcvs.py/jena/jena2/readme.html?rev=1.35

Setting proxy information in UDDI API:

Setting the following system properties in your application code to use UDDI API behind a firewall.
System.setProperty("http.proxyHost","<your-proxy-domain-name-or-ip-address>");
System.setProperty("http.proxyPort","<your-proxy-port-number>");