Version: 1.1.1

org.biomoby.client.rdf.builder
Class ServiceInstanceRDF

java.lang.Object
  extended by org.biomoby.client.rdf.builder.ServiceInstanceRDF

public class ServiceInstanceRDF
extends Object

Author:
Eddie Kawas

This class was created to present a way to retrieve a service instances' RDF using just a service name and authority.

For questions, comments, or bugs

email me at edward.kawas@gmail.com


Constructor Summary
ServiceInstanceRDF()
          Default Constructor: Uses the default mobycentral
ServiceInstanceRDF(Registry reg)
          Constructor:
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model createRDFModel(com.hp.hpl.jena.rdf.model.Model model, MobyService[] services, boolean useLSIDs)
           
 String findService(String domain, String serviceName)
          method that retrieves the RDF describing a specific service instance based on the parameters domain, serviceName.
 String findService(String authorURI, String name, boolean useLSIDs)
          PRE: name is either a valid name or null POST: If authorURI is a valid authority, then a RDF containing all of the service instances will be returned.
 String findService(String domain, String serviceName, String url, String uri, boolean useLSIDs)
          method that retrieves the RDF describing a specific service instance based on the parameters domain, serviceName, url and uri.
 String getLatestLSID(String uri, String name, String lsid)
           
static void main(String[] args)
           
 String serializeModel(com.hp.hpl.jena.rdf.model.Model model)
           
 boolean serviceInstanceExists(String uri, String name)
          PRE: None POST: If a service instance exists such that it has a name of name and an authoring URI of uri true is returned, otherwise false is returned.
 boolean serviceInstanceExists(String uri, String name, String lsid)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceInstanceRDF

public ServiceInstanceRDF()
                   throws MobyException
Default Constructor: Uses the default mobycentral

Throws:
MobyException - if there is a problem communicating with the registry

ServiceInstanceRDF

public ServiceInstanceRDF(Registry reg)
                   throws MobyException
Constructor:

Parameters:
reg - the registry to use
Throws:
MobyException - if there is a problem communicating with the registry
Method Detail

getLatestLSID

public final String getLatestLSID(String uri,
                                  String name,
                                  String lsid)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

serviceInstanceExists

public final boolean serviceInstanceExists(String uri,
                                           String name)
PRE: None

POST: If a service instance exists such that it has a name of name and an authoring URI of uri true is returned, otherwise false is returned.

Parameters:
uri - - the authors uri
name - - the name of the service instance
Returns:
true if a service instance exists with authority uri, and name name, otherwise false is returned.

serviceInstanceExists

public final boolean serviceInstanceExists(String uri,
                                           String name,
                                           String lsid)

serializeModel

public final String serializeModel(com.hp.hpl.jena.rdf.model.Model model)
Parameters:
model - a jena model
Returns:
a string of RDF/XML-ABBREV representing the RDF model

createRDFModel

public final com.hp.hpl.jena.rdf.model.Model createRDFModel(com.hp.hpl.jena.rdf.model.Model model,
                                                            MobyService[] services,
                                                            boolean useLSIDs)
Parameters:
model - an RDF model to add the services.
services - an array of MobyService objects.
useLSIDs - if true then the LSID for the service is added to the RDF model otherwise it is not.
Returns:
the model with service signatures contained within.

findService

public final String findService(String authorURI,
                                String name,
                                boolean useLSIDs)
PRE: name is either a valid name or null

POST: If authorURI is a valid authority, then a RDF containing all of the service instances will be returned. If authorURI and name are valid then a single RDF containing just the service instance identified by name is returned.

Parameters:
authorURI - - the authority to query
name - - the name of the service instance if applicable or null.
useLSIDs - whether or not we should include lsids
Returns:
a string representing either all of services defined by authorURI, (if name is null) or a single service instances' rdf if name and authorURI are valid. If name and/or authorURI are invalid an empty rdf document is returned.

findService

public final String findService(String domain,
                                String serviceName)
method that retrieves the RDF describing a specific service instance based on the parameters domain, serviceName.

PRE: None.

POST: The RDF describing the service with parameters domain, serviceName is created.

Parameters:
domain - - the authoring domain of the service instance in question.
serviceName - - the name of the service instance in question.
Returns:
- the string representation of the RDF describing the service instance based on the parameters given.

findService

public final String findService(String domain,
                                String serviceName,
                                String url,
                                String uri,
                                boolean useLSIDs)
method that retrieves the RDF describing a specific service instance based on the parameters domain, serviceName, url and uri.

PRE: None.

POST: The RDF describing the service with parameters domain, serviceName, url and uri is created.

Parameters:
domain - - the authoring domain of the service instance in question.
serviceName - - the name of the service instance in question.
url - - the URL of the endpoint of the BioMoby registry that you would like to query. If null, the mobycentral registry is queried.
uri - - the URI of the BioMoby registry that you would like to query. If null, the mobycentral registry is queried.
useLSIDs - - whether or not the returned RDF document should contain an LSID. Set this to false to retrieve RDF that service providers should have.
Returns:
- the string representation of the RDF describing the service instance based on the parameters given.

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010