Use the RMA path syntax to describe a path connecting associated models in the schema. It is used in the include= and criteria= URL parameters. Please note that the path syntax does not support spaces between operators and values, but values enclosed in single quotes can include them (i.e. name$eq’value with spaces’).
The RMA Path specifies a set of associations from a resource. The simplest form is a comma-separated list of association names. Association names are lower case and may be singular or plural depending on the type of association.
probes,organism,chromosome
Indicate multiple levels of association with nested parentheses. Follow multiple associations from a model by using commas.
probes(orientation,predicted_sequence)
Filter the resources that are included in the query results using square brackets following an association. Operators include equal ($eq), not equal ($ne), like ($li), greater than ($gt), less than ($lt), greater or equal ($ge) less or equal ($le) in ($in) and case-insensitive like ($il).
genes[acromym$eq'ABAT']
The left hand side of the filter is an attribute name. It may be qualified with a lower case plural table name to resolve ambiguity using the form table.attribute. At times the model name in a filter may not match the association name due to inheritance.
predicted_sequence[sequences.sequence_length$eq948]
The right hand side may be a number, a string or a qualified attribute or association name. Strings should be enclosed in single quotes, but the quotes may be omitted when there is no ambiguity. The asterisk (*) is treated as a wildcard for the like and ilike string comparison operators.
genes[chromosome.name$eq'X'] ontologies[name$il'*human*']
A filter without an operator or a right hand side is treated as an existence test. It removes records with null values for an attribute. In many cases an _id attribute can be used to test whether any associated resources exist.
probes[orientation_id]
Apply multiple filters to a set of resources using extra filter clauses in square brackets. The effect is a boolean ‘and’.
chromosome[organism_id$eq1][name$ne'X'][name$ne'Y']
Use filters without any association at the start of the criteria field of a query URL to filter resources from the model in the URL.
http://api.brain-map.org/api/v2/data/Organism/query.xml?criteria=[name$il'*human*'][id$ne15] http://api.brain-map.org/api/v2/data/Gene/query.xml?criteria=[acronym$il'abat']&include=organism
The double colon (::) operator can be used to change the axis of an RMA query. The five defined axes are attribute::, model::, service::, pipe:: and rma::. The double colon axis operator is combined with an id to create a single step along the axis. Examples include service::differential, pipe::list, model::Gene, and rma::options. Each axis behaves slightly differently. They can be used in combination to form a service pipeline.
The model axis begins an API data query. The right hand side of a model step is a model name. Use the model axis is used in combination with steps along the attribute axis and filters to form a complete model stage.
model::Gene,probes(orientation,predicted_sequence)
Use the rma axis to modify the RMA query. The right hand side of an rma step is the name of the option. An rma::criteria step will cause following attribute steps to specify what associations are used in retrieving the data. An rma::include step will cause following attribute steps to specify what associations are displayed in the message response body. Use an rma::options step to specify sorting, paging and ordering options.
model::Gene,rma::criteria,organism[name$il'Homo Sapiens'],rma::include,probes,chromosome,rma::options[num_rows$eq10]
The above request will find human genes (the criteria), display the genes along with the probes and chromosome (the includes) ten genes at a time (the options). Options specified on the URL as described above are treated as steps on the rma axis.
The service and pipe axes are discussed in depth in the following section. They are used in combination with the other axes to create multiple stage service pipelines.
The attribute:: axis is the assumed axis used for the RMA path syntax, but it is almost never used explicitly.
Learn about Connected Services and Pipes with comprehensive guides and examples from Allen Institute for Brain Science.
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_correlation[set$eqrna_seq_genes][probes$eq1090294][structures$eq'CBC']
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_correlation[set$eqrna_seq_exons][probes$eq279330730][structures$eq'CBC']
Retrieve exon_microarray_genes correlation values for structure with the acronym, "CBC".
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_correlation[set$eqexon_microarray_genes][probes$eq9463][structures$eq'CBC']
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_correlation[set$eqexon_microarray_exons][probes$eq280550735][structures$eq'CBC']
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_differential[set$eq'rna_seq_genes'][structures1$eqDFC][structures2$eqMFC]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_differential[set$eq'rna_seq_genes'][structures1$eqDFC][structures2$eqMFC]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_differential[set$eq'exon_microarray_exons'][structures1$eqDFC][structures2$eqMFC]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_differential[set$eq'exon_microarray_genes'][structures1$eqDFC][structures2$eqMFC]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_expression[set$eq'rna_seq_genes'][probes$eq1090294]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_expression[set$eq'rna_seq_exons'][probes$eq279330730]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_expression[set$eq'exon_microarray_genes'][probes$eq9463]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_expression[set$eq'exon_microarray_exons'][probes$eq280550735]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_microarray_correlation[probes$eq1048426][structures$eqSG]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_microarray_differential[structures1$eqMZ][structures2$eqCP]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_human_microarray_expression[probes$eq1053223,1053224][donors$eq12566][structures$eq11587]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_mouse_agea[seed_age$eq'E18.5'][map_age$eq'E15.5'][seed_point$eq4200,2380,2360] [map_threshold$eq0.467,0.657][seed_threshold$eq0.811,0.924]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::dev_mouse_correlation[row$eq13267][structures$eq'NP'][ages$eq'P14','P28']
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::gbm_correlation[probes$eq3551][structures$eqGBM]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::gbm_differential[structures1$eqGBM][structures2$eqCTpan]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::gbm_expression[probes$eq3551][donors$eq703393][structures$eqGBM]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::gbm_ish_differential[structures1$eqCTpnn][structures2$eqIT]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::gbm_ish_expression[structures$eqCTpnn][threshold$eq0,100000]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::human_microarray_correlation[probes$eq1048426][structures$eq'FL']
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::human_microarray_differential[structures1$eq4005][structures2$eq4006]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::human_microarray_expression[probes$eq1014952][donors$eq9861,10021][structures$eq4079]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_agea[set$eqmouse_coronal][seed_age$eqP56][map_age$eqP56][seed_point$eq6800,4200,5600] [correlation_threshold1$eq0.84][correlation_threshold2$eq0.93]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_correlation[set$eqmouse][row$eq68918934] http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_correlation[set$eqmouse_coronal][row$eq357096]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_differential[set$eq'mouse'][structures1$eq8][structures2$eq315] http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_differential[set$eq'mouse_coronal'][structures1$eq8][structures2$eq315]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_connectivity_correlation[row$eq112162251][structures$eqTH][hemisphere$eqright][num_rows$eq100][transgenic_lines$eq0,177838259]
Search for injection sites near a set of 3-D coordinates, ranking the results by their distance from the coordinates.
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_connectivity_injection_coordinate[seed_point$eq6600,5400,4800][transgenic_lines$eq0]
Search by injection structures, ranking the results the results by signal in the target structures.
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_connectivity_injection_structure[injection_structures$eqTH][injection_hemisphere$eqRight][target_domain$eqVIS][target_hemisphere$eqRight][transgenic_lines$eq0]
Displays all SectionDataSets with projection signal density >= 0.1 at the seed point. This service also returns the path along the most dense pixels from the seed point to the center of each injection site.
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::mouse_connectivity_target_spatial[seed_point$eq6600,5400,4800][start_row$eq25][num_rows$eq50]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::nhp_lmd_microarray_correlation[probes$eq30357][structures$eqBN]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::nhp_lmd_microarray_differential[structures1$eqHF][structures2$eqBN]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::nhp_lmd_microarray_expression[probes$eq15815]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::nhp_macro_microarray_correlation[probes$eq49067][structures$eqBN]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::nhp_macro_microarray_differential[structures1$eqHF][structures2$eqBN]
http://api.brain-map.org/api/v2/data/query.xml?criteria=
service::nhp_macro_microarray_expression[probes$eq15815]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::tbi_correlation[structures$eqHIP][probes$eq499304660]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::tbi_differential[structures1$eqFWM][structures2$eqTCx]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::tbi_expression[donors$eq309335438][structures$eqPCx][probes$eq499304660]
http://api.brain-map.org/api/v2/data/query.xml?criteria= service::text_search[query_string$eq'abat'][k$eqGene]
The output from the previous pipeline stage in json format.
A comma separated list made up of the values found according to the path is assigned to the variable. More than one variable may be assigned in a single list pipe.
A pipe may not be used at the beginning or end of a query pipeline. Pipe::list may be used between model and service stages in any combination. The scope of a variable in a pipe::list stage is from the pipe to the end of the pipeline. Prefix a pipe list variable with a dollar sign ($) to reference it. Use the $in operator when referencing a pipeline variable set by pipe::list because the output is a list.
pipe::list[gene_ids$eq'id'][probe_ids$eq'probes/probe/id']
http://api.brain-map.org/api/v2/data/query.json?criteria=
model::Organism[name$il'*sapiens'],
pipe::list[xorganism_id$eq'id'],
model::Gene[organism_id$in$xorganism_id]
The constant string or variable passed into the input parameter
A string with the substitutions applied is assigned to the output variable.
pipe::replace[pattern$eq'a'][replacement$eq'b'][input$in'abcd'][output$eqexample]
http://api.brain-map.org/api/v2/data/query.json?criteria= model::Structure[acronym$eq'HiF'][ontology_id$eq7], pipe::list[path$eq'structure_id_path'], pipe::replace[pattern$eq'$'][replacement$eq'*'][input$in$path][output$eq'descendents'], model::Structure[structure_id_path$il$descendents][ontology_id$eq7]
The constant string or variable passed into the input parameter
An comma-separated list of input string split where the pattern matched.
pipe::split[pattern$eq'x'][input$in'axbxcxd'][output$eqexample]
http://api.brain-map.org/api/v2/data/query.json?criteria= model::Structure[acronym$eq'HiF'][ontology_id$eq7],pipe::list[path$eq'structure_id_path'],pipe::replace[pattern$eq'(^\/)|(\/$)'][replacement$eq''][input$in$path][output$eq'path'],pipe::split[pattern$eq'/'][input$in$path][output$eq'ancestors'],model::Structure[id$in$ancestors][ontology_id$eq7]
SectionDataSet
Learn about Restful Model Access RMA with comprehensive guides and examples from Allen Institute for Brain Science.

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 API utility, RMA Query Builder, can be used to compose RMA queries.
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)
http://api.brain-map.org/api/v2/data/[Model]/[Model.id].[json|xml|csv]
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]
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>
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:
http://api.brain-map.org/api/v2/data/Chromosome/12.xml?include=organism
The associated information will be nested in the response:
<Response success="true" id="0" start_row="0" num_rows="1" total_rows="1">
<chromosomes>
<chromosome>
<id>15</id>
<name>21</name>
<organism-id>1</organism-id>
<organism>
<id>1</id>
<name>Homo Sapiens</name>
<ncbitaxonomyid>9606</ncbitaxonomyid>
</organism>
</chromosome>
</chromosomes>
</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).
http://api.brain-map.org/api/v2/data/Chromosome/query.xml?criteria=organism[ncbitaxonomyid$eq9606]
The criteria= parameter is discussed in more detail in the RMA Path Syntax section.
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.
http://api.brain-map.org/api/v2/data/Organism/1.xml?only=name
<Response success="true" id="0" start_row="0" num_rows="1" total_rows="1">
<organisms>
<organism>
<name>Homo Sapiens</name>
</organism>
</organisms>
</Response>
Use tabular= to restrict the attributes and also return them in a tabular format. Use ‘as’ to alias an attribute name or ‘distinct’ to eliminate duplicate rows. 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.
http://api.brain-map.org/api/v2/data/Gene/15.xml?criteria=probes&tabular=distinct%20genes.name%20as%20gene_name,probes.name%20as%20probe_name
<Response success="true" id="0" start_row="0" num_rows="15" total_rows="15">
<hash>
<gene-name>4-aminobutyrate aminotransferase</gene-name>
<probe-name>RP_100125_04_D02</probe-name>
</hash>
.....
</Response>
Limit the number of results by using the start_row=, num_rows= and order= URL parameters. Use num_rows=all to retrieve all records (not recommended for large queries). The response body contains information about the progress of paging. Use count=false if you do not want paging information returned in the response.
http://api.brain-map.org/api/v2/data/[Model]/query.xml?num_rows=[#]&start_row=[#]&order=[...]
Request the first Product by specifying start_row=0:
http://api.brain-map.org/api/v2/data/Product/query.xml?start_row=0&num_rows=1
Request 10 Products beginning with the 20th row, and order by the Products’ names:
http://api.brain-map.org/api/v2/data/Product/query.xml?num_rows=10&start_row=20&order=products.name
RMA uses the ActiveRecord Query Interface.
The filter clauses in both the criteria= parameter and the includes= parameter are treated as an AR Query where() argument. They can be thought of as an SQL where clause combined with the boolean ‘and’ operation.
Models are similar to SQL tables, attributes correspond to literal SQL columns and associations can be thought of as SQL foreign keys.
Learn about Quantified Data By Structures with comprehensive guides and examples from Allen Institute for Brain Science.

Data from our large scale gene expression and connectivity products is processed through an informatics data analysis pipeline to obtain spatially mapped quantified expression/projection information.
Quantified data is available for the following:



The output of the pipeline are quantified values at a grid voxel level. Quantified values can be computed for each structure delineated in the associated reference atlas by combining or unionizing grid voxels with the same 3-D structural label. While the reference atlas is typically annotated at the lowest level of the ontology tree, statistics at upper level structures can be obtained by combining measurements of the hierarchical children to obtain statistics for the parent structure.
Expression statistics are encapsulated as a StructureUnionize object associated with one Structure and one SectionDataSet.
Projection statistics are encapsulated as a ProjectionStructureUnionize object associated with one Structure, either left, right or both Hemispheres and one SectionDataSet.
StructureUnionize and ProjectionStructureUnionize data can be downloaded via RMA and are used in the web application to display expression summary bar graphs for a set of coarse structures. Its usage is also demonstrated in the “structure networks” example application.
Refer to the atlas API pages for further details.
