Skip to end of metadata
Go to start of metadata

RESTful Model Access (RMA)

RESTful Model Access (RMA) is an HTTP service designed along RESTful principles to allow access to data in the Allen Institute API. Data model queries support JSON, XML and CSV formats. They can include join, filter, sort, page and eager loading of associations. RMA can also pipe results to perform compound queries and connect to data services. RMA services support JSON and XML formats.

RESTful Resources

The path to the RMA service is /api/v2/data. Other models may be substituted for Organism, such as Gene, Chromosome, or Structure. Model names are always capitalized and singular. The number following the model is a resource id. Valid result formats include JSON (.json), XML (.xml) and CSV (.csv)

Prototype
http://api.brain-map.org/api/v2/data/[Model]/[Model.id].[json|xml|csv]
Examples

Use a browser or other HTTP client to access:

http://api.brain-map.org/api/v2/data/Organism/1.xml
http://api.brain-map.org/api/v2/data/Gene/15.xml
http://api.brain-map.org/api/v2/data/Chromosome/12.json
http://api.brain-map.org/api/v2/data/Structure/4005.xml

Use the keyword query rather than an id to search across all resources in a model.

http://api.brain-map.org/api/v2/data/Organism/query.xml

Use the keyword describe to retrieve information about the available associations for a model. .json format is also available.

http://api.brain-map.org/api/v2/data/Gene/describe.xml

Use the keyword enumerate to retrieve information about all available models and associations. .json format is also available.

http://api.brain-map.org/api/v2/data/enumerate.xml

Use the keyword query without a model or id if the needed information is specified elsewhere in the url. The part after the question mark is explained throughout this document.

http://api.brain-map.org/api/v2/data/query.xml?include=model::Gene[id$eq15]
Response

JSON, XML and CSV formats are supported. For example:

<Response success="true" id="0" start_row="0" num_rows="1" total_rows="1">
<organisms>
<organism>
<id>1</id>
<name>Homo Sapiens</name>
<ncbitaxonomyid>9606</ncbitaxonomyid>
</organism>
</organisms>
</Response>

  • No labels