|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Central
An interface to the Moby Registry.
The Moby Registry (or Moby Central) is used to do various transactions, including registering new Data and Service types, querying for these types, registering new Services, or querying for available services given certain input/output or service type constraints.
The main purpose of this interface is to express the Moby Registry functionality in Java language, and to hide complexity of the parameters required by the Moby Registry. The Moby Registry gets most parameters as small XML documents while this interface defines the same parameters as various Java method signatures.
For details describing and explaining the methods see the original documentation at http://biomoby.org.
Field Summary | |
---|---|
static String |
DATA_TYPES_RESOURCE_NAME
A name of an ontology describing registered data types. |
static String |
FULL_RESOURCE_NAME
A name of an ontology describing all registered entities. |
static String |
HAS
A relationship type expressing a contaiment (as string). |
static String |
HASA
A relationship type expressing a contaiment (as string). |
static int |
iHAS
A relationship type expressing a contaiment (as integer). |
static int |
iHASA
A relationship type expressing a contaiment (as integer). |
static int |
iISA
A relationship type expressing a straight inheritance (as integer). |
static String |
ISA
A relationship type expressing a straight inheritance (as string). |
static String |
NAMESPACES_RESOURCE_NAME
A name of an ontology describing registered service types. |
static String |
SERVICE_INSTANCES_RESOURCE_NAME
A name of an ontology describing registered service types. |
static String |
SERVICE_TYPES_RESOURCE_NAME
A name of an ontology describing registered service types. |
Method Summary | |
---|---|
String |
call(String methodName,
String inputXML)
Call Moby registry's method with given XML as input and return whatever you get back. |
MobyService[] |
findService(MobyService pattern)
Find services matching whatever is non-empty in the given 'pattern'. |
MobyService[] |
findService(MobyService pattern,
String[] keywords)
Find service matching both all non-empty fields in the 'pattern' and the 'keywords'. |
MobyService[] |
findService(MobyService pattern,
String[] keywords,
boolean includeChildrenServiceTypes,
boolean includeParentDataTypes)
Find service matching both all non-empty fields in the 'pattern' and the 'keywords', and take into account also the whole ontology tree. |
MobyService[] |
findService(String serviceType)
Find services of the given type and its sub-types. |
MobyService[] |
findService(String[] keywords)
Find services by given keywords. |
boolean |
getCacheMode()
Reports whether server responses are being cached or not. |
MobyDataType |
getDataType(String dataTypeName)
Get definition of the given data type. |
Map<String,String> |
getDataTypeNames()
Get the list of all registered data types. |
Map<String,String> |
getDataTypeRelationships(String dataTypeName)
Get all relationships of the given 'dataTypeName'. |
String[] |
getDataTypeRelationships(String dataTypeName,
String relationshipType)
Get all relationships of type 'relationshipType' for the given 'dataTypeName'. |
MobyDataType[] |
getDataTypes()
|
MobyNamespace[] |
getFullNamespaces()
Get the list of all registered namespaces, with all their attributes. |
Map<String,String> |
getNamespaces()
Deprecated. Replaced by getFullNamespaces() that gives
more information for the same price. |
String[] |
getProviders()
Get the list of all providers (each provider is represented by an authority's URI. |
String |
getRegistryEndpoint()
Return an endpoint (a stringified URL) representing a Moby registry that an instance of this implementation is connected to. |
String |
getRegistryNamespace()
Return a namespace (a URI) used by a Moby registry that an instance of this implementation is connected to. |
InputStream |
getResource(String resourceName)
First get (from a BioMoby registry) a URL for the given 'resourceName' and then retrieve a document from this URL. |
MobyResourceRef[] |
getResourceRefs()
Get URLs (and content types) of RDF documents describing various BioMoby ontologies. |
Map<String,String> |
getServiceNames()
Deprecated. Replaced by getServiceNamesByAuthority() . The reason is that this method
returns a random result if there are more services with the
same name but belonging to different authorities. |
Map<String,String[]> |
getServiceNamesByAuthority()
Get a list of all authorities - and for each of them a list of their registered service names. |
String[] |
getServiceTypeRelationships(String serviceTypeName,
boolean expand)
Get all ISA relationships of the given 'serviceTypeName'. |
Map<String,String> |
getServiceTypes()
Get the list of all registered service types. |
String |
getServiceWSDL(String serviceName)
Get WSDL defining a service given by its name. |
String |
getServiceWSDL(String serviceName,
String authority)
Get WSDL defining a service given by its name and its authority. |
void |
registerDataType(MobyDataType dataType)
Register new data type. |
void |
registerNamespace(MobyNamespace namespace)
Register new namespace. |
void |
registerService(MobyService service)
Register a new service. |
void |
registerServiceType(MobyServiceType serviceType)
Register new service type. |
void |
setCacheMode(boolean shouldCache)
Set whether the server responses should cached or not to speedup multiple calls for the same data. |
boolean |
setDebug(boolean enabled)
Ask the implementation to create more verbose logs or messages about what is going on. |
void |
unregisterDataType(MobyDataType dataType)
Unregister given Moby data type. |
void |
unregisterNamespace(MobyNamespace namespace)
Unregister given Moby namespace. |
void |
unregisterService(MobyService service)
Unregister given Moby service. |
void |
unregisterServiceType(MobyServiceType serviceType)
Unregister given Moby service type. |
Field Detail |
---|
static final String ISA
static final String HASA
static final String HAS
static final int iISA
static final int iHASA
static final int iHAS
static final String SERVICE_TYPES_RESOURCE_NAME
getResourceRefs()
.
static final String SERVICE_INSTANCES_RESOURCE_NAME
getResourceRefs()
.
static final String DATA_TYPES_RESOURCE_NAME
getResourceRefs()
.
static final String NAMESPACES_RESOURCE_NAME
getResourceRefs()
.
static final String FULL_RESOURCE_NAME
getResourceRefs()
. The contents returned by this method for
this ontology name is a concatenation of all other ontologies.
Method Detail |
---|
Map<String,String> getServiceNames() throws MobyException
getServiceNamesByAuthority()
. The reason is that this method
returns a random result if there are more services with the
same name but belonging to different authorities.
MobyException
- if communication with the Moby Registry failsMap<String,String[]> getServiceNamesByAuthority() throws MobyException
This method is a better replacement for the deprecated method
getServiceNames()
.
MobyException
- if communication with the Moby Registry failsString[] getProviders() throws MobyException
MobyException
- if communication with the Moby Registry failsMap<String,String> getServiceTypes() throws MobyException
MobyException
- if communication with the Moby Registry failsString[] getServiceTypeRelationships(String serviceTypeName, boolean expand) throws MobyException
serviceTypeName
- is a service type name whose
relationships should be looked atexpand
- 'true' causes that all related type names are
returned, 'false' means that only first-level neighbour is returned
MobyException
- if communication with the Moby Registry failsMap<String,String> getNamespaces() throws MobyException
getFullNamespaces()
that gives
more information for the same price.
MobyException
- if communication with the Moby Registry failsMobyNamespace[] getFullNamespaces() throws MobyException
MobyException
- if communication with the Moby Registry failsMap<String,String> getDataTypeNames() throws MobyException
MobyException
- if communication with the Moby Registry failsMobyDataType getDataType(String dataTypeName) throws MobyException, NoSuccessException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if 'dataTypeName' was not foundMobyDataType[] getDataTypes() throws MobyException, NoSuccessException
MobyException
NoSuccessException
Map<String,String> getDataTypeRelationships(String dataTypeName) throws MobyException
dataTypeName
- is an ontology term specifying whose
relationships should be looked at
ISA
, HASA
, and HAS
. The
values (of type String) are data type names.
MobyException
- if communication with the Moby Registry failsString[] getDataTypeRelationships(String dataTypeName, String relationshipType) throws MobyException
dataTypeName
- is an ontology term specifying whose
relationships should be looked atrelationshipType
- is one from the set ISA
,
HASA
, and HAS
.
MobyException
- if communication with the Moby Registry failsString getServiceWSDL(String serviceName, String authority) throws MobyException, NoSuccessException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if such service was not foundString getServiceWSDL(String serviceName) throws MobyException, NoSuccessException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if such service was not foundgetServiceWSDL(String,String)
void registerDataType(MobyDataType dataType) throws MobyException, NoSuccessException, PendingCurationException
If the same data type is already registered, it is overwritten.
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if registration failed
PendingCurationException
void unregisterDataType(MobyDataType dataType) throws MobyException, NoSuccessException, PendingCurationException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if unregistration failed
PendingCurationException
void registerServiceType(MobyServiceType serviceType) throws MobyException, NoSuccessException, PendingCurationException
If the same service type is already registered, it is not overwritten but an exception is raised.
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if registration failed
PendingCurationException
void unregisterServiceType(MobyServiceType serviceType) throws MobyException, NoSuccessException, PendingCurationException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if unregistration failed
PendingCurationException
void registerNamespace(MobyNamespace namespace) throws MobyException, NoSuccessException, PendingCurationException
If the same namespace is already registered, it is overwritten.
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if registration failed
PendingCurationException
void unregisterNamespace(MobyNamespace namespace) throws MobyException, NoSuccessException, PendingCurationException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if unregistration failed
PendingCurationException
void registerService(MobyService service) throws MobyException, NoSuccessException, PendingCurationException
If the same service type is already registered, it is not overwritten but an exception is raised.
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if registration failed
PendingCurationException
void unregisterService(MobyService service) throws MobyException, NoSuccessException, PendingCurationException
MobyException
- if communication with the Moby Registry fails
NoSuccessException
- if unregistration failed
PendingCurationException
MobyService[] findService(String serviceType) throws MobyException
MobyException
- if communication with the Moby Registry failsMobyService[] findService(String[] keywords) throws MobyException
MobyException
- if communication with the Moby Registry failsMobyService[] findService(MobyService pattern) throws MobyException
MobyException
- if communication with the Moby Registry failsMobyService[] findService(MobyService pattern, String[] keywords) throws MobyException
MobyException
MobyService[] findService(MobyService pattern, String[] keywords, boolean includeChildrenServiceTypes, boolean includeParentDataTypes) throws MobyException
includeChildrenServiceTypes
- - if true (which is default)
then it discovers also services that are child types (more
specific) than the service type in 'pattern'includeParentDataTypes
- - if true (which is default) then
it finds services that operate not only on the input/output
data types defined in 'pattern', but also any ontolological
parent types of that data types
MobyException
String call(String methodName, String inputXML) throws MobyException
Meant for debugging and may be deprecated anytime...
MobyException
boolean setDebug(boolean enabled)
enabled
- true if debug mode should be enabled, false otherwise
void setCacheMode(boolean shouldCache)
shouldCache
- if set to false, any previously cached documents should be deletedboolean getCacheMode()
String getRegistryEndpoint()
String getRegistryNamespace()
MobyResourceRef[] getResourceRefs() throws MobyException
There are five possible ontology names:
SERVICE_TYPES_RESOURCE_NAME
,
DATA_TYPES_RESOURCE_NAME
,
NAMESPACES_RESOURCE_NAME
,
SERVICE_INSTANCES_RESOURCE_NAME
,
FULL_RESOURCE_NAME
.
MobyException
- if communication with the Moby Registry failsInputStream getResource(String resourceName) throws MobyException
The document is in RDF and represents some (or all) entities registered in the BioMoby registry.
resourceName
- is an ontology name (must be one of these:
SERVICE_TYPES_RESOURCE_NAME
, DATA_TYPES_RESOURCE_NAME
, NAMESPACES_RESOURCE_NAME
,
SERVICE_INSTANCES_RESOURCE_NAME
, FULL_RESOURCE_NAME
)
MobyException
- if communication with the Moby Registry
fails, or if communication with the resource URL fails
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |