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.
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)
Use a browser or other HTTP client to access:
Use the keyword query rather than an id to search across all resources in a model.
Use the keyword describe to retrieve information about the available associations for a model. .json format is also available.
Use the keyword enumerate to retrieve information about all available models and associations. .json format is also available.
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.
JSON, XML and CSV formats are supported. For example:
Resources in the models are associated with other resources. Display this additional information using the include= parameter:
Retrieve details for the Chromosome with ID=12 and include its associated organism:
The associated information will be nested in the response:
The include= parameter is discussed in more detail in the RMA Path Syntax section.
Use the criteria parameter to refine the query.
The following criteria will find chromosome resources from the organism with NCBI taxonomy id 9606 (which happens to be Homo Sapiens).
The criteria= parameter is discussed in more detail in the RMA Path Syntax section.
Only, Except and Tabular
Use the only= or except= parameters to restrict the attributes returned in the response. By default the results include all literal attributes of the resource. These options can be applied to model stages, but not service or pipe stages.
Use tabular= to restrict the attributes and also return them in a tabular format. Use 'as' to alias an attribute name. This option is recommended for accessing data in applications where sorting and paging are used in a tabular, spreadsheet-like display. This option can be applied to model stages, but not service or pipe stages. The csv format is required to be tabular and it defaults to displaying all attributes of the model. If associated models are referenced in the tabular= option, they should be present in a criteria= option as well. The tabular= option masks include= for serialization purposes.