OGSA-DQP comes with a simple command-line client that allows you to create DQP resources, get the imported schemas and run queries.
This is not a fully-functional application. Rather it is intended purely to be used as an aid to demonstrating what DQP can do.
Change into the OGSA-DQP client directory:
$ cd ogsadqp-3.2.1-od30port/client
Build the client:
$ ant compile.axis121 -Dogsadai.dir=$OGSADAI_HOME
$ ant compile.gt4 -Dogsadai.dir=$OGSADAI_HOME
To ask a coordinator to create a DQP resource, run:
$ cd ogsadqp-3.2.1-od30port/client $ ant factory -Ddqp.config.file=CONFIG-FILE -Durl=SERVER-URL -Dresource.id=RESOURCE-ID
Where:
CONFIG-FILE is the name of a DQP factory resource
configuration file. This argument is required.
examples directory for examples consistent with
the OGSA-DQP testbed.
<?xml version="1.0" encoding="utf-8"?> <DQPConfiguration xmlns="http://uk.org.ogsadai/dqp/configuration"> </DQPConfiguration>Empty DQP configuration document: dqp-factory-configuration-empty.xml
SERVER-URL is the URL of the coordinator that exposes the
DQP factory resource. For example, for OGSA-DAI Axis 1.2.1:
http://localhost:8080/dai/services/For example, for OGSA-DAI GT 4.0.5:
http://localhost:8080/wsrf/services/dai/
RESOURCE-ID is the ID of the DQP factory resource. Typically
this is DQPFactoryResource.
For example, for OGSA-DAI Axis 1.2.1:
$ cd ogsadqp-3.2.1-od30port/client $ ant factory -Ddqp.config.file=../examples/test-dqpconfig-axis121.xml \ -Durl=http://localhost:8080/dai/services/ \ -Dresource.id=DQPFactoryResource
For example, for OGSA-DAI GT 4.0.5:
$ cd ogsadqp-3.2.1-od30port/client $ ant factory -Ddqp.config.file=../examples/test-dqpconfig-axis121.xml \ -Durl=http://localhost:8080/wsrf/services/dai/ -Dresource.id=DQPFactoryResource
If all goes well a new DQP resource will be created and the ID of this resource will be printed by the clien.
Run the following in the client directory of
the OGSA-DQP distribution:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=SERVER-URL -Dresource.id=RESOURCE-ID
Where:
SERVER-URL is the URL of the coordinator that exposes the
DQP resource.
RESOURCE-ID is the ID of the DQP data resource
returned when you created it using the client.
For example, for OGSA-DAI Axis 1.2.1:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/dai/services/ \ -Dresource.id=ogsadai-12345
For example, for OGSA-DAI GT 4.0.5:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/wsrf/services/dai/ -Dresource.id=ogsadai-12345
$ cd ogsadqp-3.2.1-od30port/client $ ant query -Durl=SERVER-URL -Dresource.id=RESOURCE-ID -Dclient.query=QUERY
Where:
SERVER-URL is the URL of the coordinator that exposes the
DQP resource.
RESOURCE-ID is the ID of the DQP data resource
returned when you created it using the client.
QUERY is the query to be executed.
For example, for OGSA-DAI Axis 1.2.1:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/dai/services/ \ -Dresource.id=ogsadai-12345 \ -Dclient.query="SELECT goterm_goterm.name FROM \ proteinterm_protein_goterm, goterm_goterm WHERE \ proteinterm_protein_goterm.GOTermIdentifier=goterm_goterm.id \ AND proteinterm_protein_goterm.ORF='YBL037W' \ AND goterm_goterm.name LIKE 'vesicle%';"
For example, for OGSA-DAI GT 4.0.5:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/wsrf/services/dai/ -Dresource.id=ogsadai-12345 \ -Dclient.query="SELECT goterm_goterm.name FROM \ proteinterm_protein_goterm, goterm_goterm WHERE \ proteinterm_protein_goterm.GOTermIdentifier=goterm_goterm.id \ AND proteinterm_protein_goterm.ORF='YBL037W' \ AND goterm_goterm.name LIKE 'vesicle%';"
The query guide provides an overview
of the sorts of SQL queries that OGSA-DQP can handle. A final ;
at the end of the query is vital.
If all goes well, the client will contact the coordinator, which will
execute the query using the specified DQP resource. Note the way that
the example table in the query, person, is identified as
DataTwo_person. OGSA-DQP prefixes the database name
(DataTwo) to the table name as a basic method of schema
conflict resolution.
By default, the client will print the results. The client may be used to output results to a file instead by adding an option
-Dclient.output.file=FILE
Where FILE is the name of a file in which the results
should be saved.
For example, for OGSA-DAI Axis 1.2.1:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/dai/services/ \ -Dresource.id=ogsadai-12345 \ -Dclient.query="SELECT goterm_goterm.name FROM \ proteinterm_protein_goterm, goterm_goterm WHERE \ proteinterm_protein_goterm.GOTermIdentifier=goterm_goterm.id \ AND proteinterm_protein_goterm.ORF='YBL037W' \ AND goterm_goterm.name LIKE 'vesicle%';" \ -Dclient.output.file=myOutput.txt
For example, for OGSA-DAI GT 4.0.5:
$ cd ogsadqp-3.2.1-od30port/client $ ant getschemas -Durl=http://localhost:8080/wsrf/services/dai/ -Dresource.id=ogsadai-12345 \ -Dclient.query="SELECT goterm_goterm.name FROM \ proteinterm_protein_goterm, goterm_goterm WHERE \ proteinterm_protein_goterm.GOTermIdentifier=goterm_goterm.id \ AND proteinterm_protein_goterm.ORF='YBL037W' \ AND goterm_goterm.name LIKE 'vesicle%';" \ -Dclient.output.file=myOutput.txt
| Previous: How clients can use OGSA-DQP | Next: Use the OGSA-DQP GUI client |