# Allen Brain Atlas API: RMA Grammar

**URL:** <https://community.brain-map.org/t/allen-brain-atlas-api-rma-grammar/2884>\
**Category:** Allen Brain Atlas API\
**Created:** [January 9, 2024, 4:42am UTC](https://community.brain-map.org/t/allen-brain-atlas-api-rma-grammar/2884 "2024-01-09T04:42:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ray.sanchez](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/ray.sanchez/32/679_2.png) [@ray.sanchez](https://community.brain-map.org/u/ray.sanchez)\
**Post date:** [January 9, 2024, 4:42am UTC](https://community.brain-map.org/t/allen-brain-atlas-api-rma-grammar/2884/1 "2024-01-09T04:42:51Z")

</div>

```auto
# The Pipeline
expr : stage*
stage : model_stage | service_stage | pipe_stage

# Pipeline Stages
model_stage : model_step (rma_option_step | filters | includes)*
service_stage : service_step filters
pipe_stage : pipe_step filters

# Axis Steps
model_step : 'model' '::' ID
rma_step : 'rma' '::' ID
rma_option_step : 'rma' '::' 'option'
attribute_step : ('attribute' '::')? ID
service_step : 'service' '::' ID
pipe_step : 'pipe' '::' ID

# Filters (also used as Parameters)
filters : ('[' qcolumn operator filter_list ']')+
qcolumn : (ID '.')? ID
operator : '$' ('eq' | 'ne' | 'li' | 'gt' | 'lt' | 'ge' | 'le' | 'in' | 'il' | 'is')
filter_list : filter_element (',' filter_element)*
filter_element : (STRING | REAL | INTEGER | variable | qcolumn | NIL)

# Association Includes (and Criteria)
includes : attribute_step filters? ('(' include_terms ')')+
include_terms : includes (',' includes)*

# Literals
STRING : '\'' (.)* '\''
REAL : INTEGER* '.' INTEGER+ ;
INTEGER : DIGIT+;
variable : '$' ID
ID : (ID_START | '*') (ID_CHAR | WILDCARD)*
ID_CHAR ID_START | DIGIT ;
ID_START : ('A'..'Z' | 'a'..'z' | '_' )
DIGIT : '0'..'9'

```
