Ruby Web Service Client

The Ruby web service client library makes it easy to run queries in SynBioMine using the InterMine API directly from Ruby programs. You can use the Ruby library to construct any query you could run from web interface and fetch the results in a number of structured formats, including reified objects, and native Ruby data structures such as lists and hashes.


  • Prerequisites

    You should install the Ruby webservice client library module to get started. You can install it directly from: RubyGems. This is a public repository of thousands of modules. To install the InterMine Ruby client library make sure you have rubygems installed, and then type the following command into a shell:

    > gem install intermine

    This module is pure Ruby with only one external dependency (json). The client library has been tested on Linux, Windows and Mac OS X, and like all our code is open-source, licensed under the LGPL.For information on the API visit our wiki pages.

    For more detailed documentation please see here: http://rubydoc.info/gems/intermine

  • Examples of using the downloaded script

    On each Template Query page and the QueryBuilder there is a link to get Ruby code to run that particular query using the web service API. Just click the link, save the generated Ruby script in a file and execute it. You can use the generated code as a starting point for your own programs.

    You can run the downloaded script by running the following command in a shell:

    > ruby path/to/downloaded/script.rb

    If you get an error saying LoadError: no such file to load -- "intermine/service" or similar, then see Prerequisites above. Feel free to edit the script - these are designed to be spring-boards to help you get where you want to get to. For further documentation, please read the detailed API documentation at http://rubydoc.info/gems/intermine

    For a good reference to getting started in Ruby, visit The official Ruby site, or Learn to Program.