help  | cite

Java Web Service Client

The Java web service client library makes it easy to run queries in BovineMine directly from Java programs. You can use this libray to construct any query you could run from web interface and fetch the results in as either tables of values, or JSON data structures (see
Like all our code, these client libraries are open-source, licensed under the LGPL. For information on the API visit our wiki pages, and for Javadoc please visit the API documentation (paying special attention to the classes in the org.intermine.pathquery and org.intermine.webservice.client packages).

  • Prerequisites

    All you need to is java 1.5+ and our package (download) which contains the client library and all dependencies.

  • Getting Started

    You can get example Java web service API code either from a Template Query or the QueryBuilder:
    • From the QueryBuilder - after creating or editing a query, click the "Java" link in the Actions section below the query details.
    • From a Template Query form - click the "Java" link below the template form.
  • Run the program

    You can run the program either from the command line or within an IDE (e.g. Eclipse). To run the program in your favorite IDE, make sure to import all the libs from the distribution package. To run from command line:
    1. Unzip the distribution package (see above):
      > unzip
    2. In the intermine-client-x.x directory that has been created make a new directory called bovinemine (this is the package name in the generated Java).
      > cd java-intermine-webservice-client
      > mkdir bovinemine
    3. Save the source code in a Java source file (*.java) in the bovinemine directory. The file name and the class name have to be the same. The generated class names might be duplicated (if you have generated code for a query before) - feel free to change them if necessary. For example, the default query class name is QueryClient, so:
      > cp [downloaded-file] bovinemine/
    4. Run the script from the command line under the package directory:
      > sh bovinemine.QueryClient