OGSA-DAI provides a simple command-line client for running requests involving XMLDB data resources. This uses the XMLListCollections, XMLListResources, XPathQuery and DeliverToRequestStatus activities.
![]() | Note |
|---|---|
| OGSA-DAI example clients are intended to allow users to quickly test their deployment as well to provide basic examples of how to construct clients using the client toolkit. They are not intended to be robust applications for use in problem solving. OGSA-DAI offers a toolkit which provides userss with the tools to develop their own clients that use OGSA-DAI services - these clients are the simplest examples built using this toolkit. |
The client takes the following arguments:
-u SERVICES_BASE_URL -
services base URL - this specifies the location of the OGSA-DAI
server. This will typically be of form:
http://HOST:PORT/wsrf/services/dai/where
HOST is the host on which the
OGSA-DAI is running and PORT is the
port on which the container accepts connections.
-e DRER-ID -
a data request execution resource (DRER) ID. This is the ID
of the DRER that will execute the request. Usually this
can be omitted (the default in this case is
DataRequestExecutionResource).
-d DATA-RESOURCE-ID -
a data resource ID. The ID of the data resource that
the client will interact with.
-coll COLLECTION - the name
of a specific sub-collection on which the command is to be applied.
This is optional and if omitted then the base collection is
used as the default.
Run the following,
replacing SERVICES-BASE-URL,
DATA-RESOURCE-ID,
QUERY and, if required
DRER-ID and
COLLECTION.
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID \ -c listCollections [-coll COLLECTION]
For example:
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c listCollections $ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c listCollections -coll someSubCollection
Run the following,
replacing SERVICES-BASE-URL,
DATA-RESOURCE-ID,
QUERY and, if required
DRER-ID and
COLLECTION.
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID \ -c listResources [-coll COLLECTION]
For example:
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c listResources $ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c listResources -coll someSubCollection
Run the following,
replacing SERVICES-BASE-URL,
DATA-RESOURCE-ID,
QUERY and, if required
DRER-ID and
COLLECTION.
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u SERVICES-BASE-URL [-e DRER-ID] -d DATA-RESOURCE-ID \ -c xpath [-coll COLLECTION] [-r DOCUMENT] [-n PREFIX:URN, PREFIX:URN,...] \ -x XPATH
If the optional -r DOCUMENT is
provided then only that document is queried.
XPATH is the query to run.
If the XPath query uses namespaces then these need to be declared
using the
-n PREFIX:URN, PREFIX:URN,...
argument. This maps any namespace prefixes in the query to namespace
URNs.
For example:
$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c xpath -x "//*" $ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c xpath -x "//*" -coll mySubCollection -r myDocument $ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \ -u http://coal.epcc.ed.ac.uk:8080/wsrf/services/dai/ -d MyOwnXMLDBDataResource \ -c xpath -coll someSubCollection -resource myDocument \ -n myprefix:http://org.somecompany.com/XML,myprefix2:http://org.someothercompany.com/SomeOtherXML \ -x "//*/myprefix:SomeElement/myprefix2:SomeOtherElement/"