Usage of the BiVeS Web Service

The BiVeS Web Service expects JSON object sent as a HTTP Post query. This JSON object needs to have the following entries:

  • files: an array of files to be processed with this query (see #files)
  • commands: an array of command to be run on the server (see #commands)

files

Models to be processed using BiVeS are supplied in the files array of the JSON object. Each element my be a link to the model accessible for the web service or plain XML code (in that case the model must not contain imports).

There are two operation modes:

  • single file mode: the files array must be of size one (only submit one single file)
  • comparison mode: the files array must be of size two (submit exactly two files to be compared)

see also sample queries

commands

The commands array contains commands to be executed on the web server. These commands can be divided into the two operation modes of BiVeS:

(list as of version 1.2.3, to get a more up-to-date list of available commands send a GET request to the web service, i.e. access the web service using your web browser)

see also sample queries

Result

As a result the web service returns a JSON object which contains an entry for each command holding the result of it. The key of this entry equals the command you sent to the web service. That means if you send a request such as

{
   "files": [...],
   "commands":
   [
      ...
      "compHierarchyJson",
      ...
   ]
}

you will receive an object like:

{
    ...
    "compHierarchyJson": "...",
    ...
}

There is a special key error that contains errors which occurred during processing of your request (see for example Send an invalid request).

Sample Queries

  • the following queries were run using curl
  • in addition, the output is piped through python -mjson.tool to prettify the JSON result. feel free to drop that.
  • here we use the bives web service hosted at our server: http://bives.sems.uni-rostock.de/bives/

Get the HTML report and the reaction network after comparing two files

curl -d '{
	"files":
	[
		"http://budhat.sems.uni-rostock.de/download?downloadModel=24",
		"http://budhat.sems.uni-rostock.de/download?downloadModel=25"
	],
	"commands":
	[
		"SBML",
		"reactionsDot",
		"reportHtml"
	]
}' http://bives.sems.uni-rostock.de/bives/ | python -mjson.tool

Flatten a CellML model

curl -d '{
	"files":
	[
		"http://models.cellml.org/exposure/385475ef63ff3f2d42e3dcb52f3982d2/MainDVad.cellml"
	],
	"commands":
	[
		"CellML",
		"singleFlatten"
	]
}' http://bives.sems.uni-rostock.de/bives/ | python -mjson.tool

Send an invalid request

  • you for example force SBML comparison but provide SBML models you'll receive an error:
curl -d '{
	"files":
	[
		"http://budhat.sems.uni-rostock.de/download?downloadModel=24",
		"http://budhat.sems.uni-rostock.de/download?downloadModel=25"
	],
	"commands":
	[
		"CellML",
		"compHierarchyJson",
		"reportHtml"
	]
}' http://bives.sems.uni-rostock.de/bives/ | python -mjson.tool
{
    "error": [
        "Error: cellml document does not define a model"
    ]
}
Last modified 3 years ago Last modified on May 11, 2014, 9:47:46 PM
authorship