Search Query Grammar
Overview
This document provides a BNF description for Hub query grammar.
Grammar
<Query> ::= <OrExpression> EOF
<OrExpression> ::= <AndExpression> "or" <AndExpression>
<AndExpression> ::= <SignExpression> "and" <SignExpression>
<SignExpression> ::= ("not")? <Item>
<Item> ::= <Field>| <Tuple>| <Paren>| <Phrase>| <Text>
<Field> ::= <FieldName> ":" <FieldValue>
<Tuple> ::= <TupleName> "(" <Field> <Field>* ")"
<Paren> ::= "(" <OrExpression>| EOF ")"
Grammar is case-insensitive.
-
<Text>
— arbitrary text. -
<Phrase>
— the exact text to match. -
<FieldName>
— field name (id, name, etc.). It covers all available JSON field names + some additional like "is", "in", "has", etc. -
<FieldValue>
— attribute value (admin, global, {my global permission}, etc.) for not single worded values value should be surrounded with "{" "}" -
<Tuple>
— conditional match by fields (access(project: "myProject", with: "myRole"))
Samples
Last modified: 19 July 2017