![]() |
BioModels Web ServicesAvailable featuresWith BioModels Web Services, users can access the up-to-date resources in BioModels Database without installing a local copy of the database. There are a range of available features for searching and retrieving models. Furthermore, some features can help users to extract interesting parts from a large model and construct them into a submodel. For any comments or new feature enquiries, please feel free to contact us. The WSDL (Web Services Description Language) defines and describes the available features in an XML format file. This enables third-party sofware to automate parsing all available features of BioModels Web Services. Comparing with WSDL, Javadoc is API documentation which provides more information to the developers. DownloadWe provide two versions of the library for querying BioModels Database Web Services. These are available for download from the SourceForge project download page (latest release: 1.12):
These are the dependencies only needed by light-weight library.
Note: you can find the latest version of each of these packages on their official web site. Java 1.5 (or newer) is required in order to use the library. Basics - Getting StartedFirst, download the library we provide. Assuming that you downloaded the biomodels-wslib_standalone.jar, let's write a simple HelloBioModels.java to test if it works on your environment.
import uk.ac.ebi.biomodels.*;
public class HelloBioModels
{
public static void main(String args[]) throws Exception
{
BioModelsWSClient client = new BioModelsWSClient();
/* uncomment when a proxy is needed
client.setProperty("http.proxyHost", "your.http.proxy.host");
client.setProperty("http.proxyPort", "yourHttpProxyPort");
client.setProperty("socks.proxyHost", "your.socks.proxy.host");
client.setProperty("socks.proxyPort", "yourSocksProxyPort");
*/
System.out.println(client.helloBioModels());
}
}
Then, compile HelloBioModels.java javac -classpath path/to/biomodelswslib-standalone.jar HelloBioModels.java Run it. java -classpath .:path/to/biomodelswslib-standalone.jar HelloBioModels If you get the result as following... Hello BioModels ...this means the BioModels Database Web Services library was properly loaded. How to deal with the returned java.util.TreeMap?The methods which returns java.util.TreeMap are usually used to fetch related models by given reference. For instance: java.util.TreeMap getSimpleModelsByChEBIIds(java.lang.String[] ChEBIIds) In the TreeMap, the reference identifier is used as the key value. And the object stored in TreeMap is an java.util.List object with all related models in the uk.ac.ebi.biomodels.SimpleModel object. The following example GetSimpleModelsByChEBIIds.java can illustrate this.
import uk.ac.ebi.biomodels.*;
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.Iterator;
public class GetSimpleModelsByChEBIIds
{
public static void main(String args[]) throws Exception
{
BioModelsWSClient client = new BioModelsWSClient();
/* uncomment when a proxy is needed
client.setProperty("http.proxyHost", "your.http.proxy.host");
client.setProperty("http.proxyPort", "yourHttpProxyPort");
client.setProperty("socks.proxyHost", "your.socks.proxy.host");
client.setProperty("socks.proxyPort", "yourSocksProxyPort");
*/
TreeMap resultSet = client.getSimpleModelsByChEBIIds(new String[]{"CHEBI:15355", "CHEBI:27897"});
Iterator iter = resultSet.keySet().iterator();
while (iter.hasNext())
{
String ChEBIId = (String) iter.next();
System.out.println(ChEBIId + "\t\t");
ArrayList modelList = (ArrayList) resultSet.get(ChEBIId);
Iterator modelsIter = modelList.iterator();
while (modelsIter.hasNext())
{
SimpleModel model = (SimpleModel) modelsIter.next();
System.out.println("\t" + model.getId()
+ "\t\t" + model.getName()
+ "\t\t" + model.getPublicationId()
+ "\t\t" + model.getLastModificationDate());
}
}
}
}
Compile it, as did for HelloBioModels.java. The result should be:
CHEBI:15355
BIOMD0000000002 Edelstein1996_EPSP_AChSpecies 8983160 2007-01-04T23:01:47
CHEBI:27897
BIOMD0000000062 bhartiya2003 tryptophan operon 12787031 2007-02-22T23:11:55
|