|
compound_query
|
::= query 'intersect' compound_query
| query 'union' compound_query
|
|
query
|
::= basic_query | range_query
|
|
basic_query
|
::= 'select' selectables
'from' container
['inner join on' predicate ]
['where' predicate ]
['order by' orderables ]
['group by' selectables ]
|
|
container
|
::= ‘catalog' ‘(‘ catalog_name ‘)'
| ‘hierarchy' ‘(‘ hierarchy_name ‘)'
| ‘collaboration_area' ‘(‘ collaboration_area_name ‘)'
|
|
range_query
|
::= 'select range' start_index 'to'
end_index selectables_list
| 'select first' count selectables_list
| 'select last' count selectables_list
'from' container
['where' predicate]
|
|
selectables
|
::= selectable
| selectable ‘,'selectables
|
|
selectable
|
::= attribute
| ‘inner_join' ‘(‘ attribute ‘)'
| ‘max' ‘(‘ attribute ‘)'
| ‘min' ‘(‘ attribute ‘)'
| ‘sum' ‘(‘ attribute ‘)'
| ‘count' ‘(‘ attribute ‘)'
| ‘avg' ‘(‘ attribute ‘)'
|
|
orderables
|
::= orderable
| orderable ‘,' orderable
|
|
orderable
|
::= attribute ['asc'|'desc']
|
|
attribute
|
::= leading_attr
| attribute ‘.' named_attr
| attribute spec_driven_attr
|
|
leading_attr
|
::=, 'item'|'category',
|
|
named_attr
|
::= ‘item'|'category'|'pk'|'name'|'path'
|
|
spec_driven_attr
|
::= ‘[‘ attribute_path ‘]'
|
|
attribute_path
|
::= spec name ‘/' attribute name
|
|
predicate
|
::= expr
| expr logic_op predicate
|
|
expr
|
::= attribute binary_op const_attr
| ‘upper' ‘(‘attribute‘)' binary_op const_attr
| [‘not'] ‘exists' attribute
| attribute ‘is' [‘not'] ‘null'
| search attribute op const attribute
| named or indexed search attribute op named or
indexed search attribute
| search attribute [‘not']‘in' '('WQL subquery ')'
| search attribute ‘in' ‘SQL' '('SQL subquery ')'
| search attribute op WQL subquery
| search attribute op 'SQL' '(' ' "SQL subquery" ' ')'
| '[not] exists' WQL subquery
| '[not] exists' 'SQL' '('SQL subquery ')'
|
|
binary_op
|
::= '>'|'<' | ‘!=' | ‘<=' | ‘>=' | ‘like' |'='
|
|
logic_op
|
::= 'and'|'or',
|
|
constant_attr
|
::= single quoted string
| number
|'path' ‘(‘ path_string ‘,' path_separator ')'
|'date' ‘(‘ date_string ‘,' date_format ‘)'
|