You can make the BridgeDb API available as a local service, so it can be used by other programming languages than Java. See also WaysToRunBridgeDb
Here are step-by-step instructions assuming derby databases as underlying mapping source. See below for information about other possible mapping sources.
Step 1
Download the latest binary snapshot of BridgeDb from http://bridgedb.org/data/snapshot/
Step 2
Download one or more *.pgdb or *.bridge database files (Derby gene or metabolite databases) from http://bridgedb.org/data/gene_database/
Step 3
Locate webservice/gdb.config.template and copy it to gdb.config, and adjust the contents to point to the *.bridge database files you just downloaded
Step 4
Run the start-server.sh script. By default it will look for gdb.config in the current directory. You can optionally specify the config file as an argument to start-server.sh.
Step 5
To test if the service is running correctly, point your browser to http://localhost:8183/. You should a message similar to this:
The server has not found anything matching the request URI
If you have the human database loaded an url like this one will work: http://localhost:8183/Human/xrefs/L/1234
Step 6
See http://svn.bigcat.unimaas.nl/bridgedb/trunk/webservice/contrib for simple examples in various programming languages such as perl and python.
More documentation will follow...
Tip
If a previous instance of the server is already occupying the port, you can see which process that is with
fuser -v -n tcp 8183
Then you can simply kill that process to free the port.
Using other mapping services
In gdb.config you can configure the underlying mapping services using regular BridgeDb? connection strings. By default, the following protocols are loaded:
idmapper-pgdb idmapper-pgdbclient idmapper-text idmapper-jdbc
For example to load a local derby file, specify it in gdb.config like so:
idmapper-pgdb:</path/to/file.bridge>
If you wish to connect to a MySQL database instead, use
idmapper-jdbc:mysql://localhost/<database>?user=<user>&password=<password>
Loading the MySQL Driver
By default, the MySQL driver is not included in the BridgeRest? server at startup. If you want to make use of a MySQL database, you have to add mysql-connector.jar to the classpath. Where you would normally run:
./start_server.sh <port> <location of gdb.config>
You should run instead:
java -cp webservice/lib/mysql-connector-java-5.1.7-bin.jar:dist/bridgedb-webservice.jar org.bridgedb.rest.Server <port> <location of gdb.config>
If a resource in gdb.config point to a mysql database, but you fail to incluse the MySQL driver like this, the server will refuse to start up.
