Hub 2018.1 Help

Search Query Grammar

This page 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> — an arbitrary text.
  • <Phrase> — the exact text phrase to match.
  • <FieldName> — a field name. For example, id, name, login, and so on. This covers all available JSON field names, plus a number of additional names like "is", "in", "has", and so on.
  • <FieldValue> — an attribute value. For example, admin, global, {my global permission}. Enclose each value that contains several words separated with spaces in curly braces { }.
  • <Tuple> — conditional match by fields. For example, access(project: "myProject", with: "myRole").

Samples

QueryDescription
name: admin Returns all users with the visibleName "admin".
is: banned Returns the list of all banned users.
access(project: MyProject, with: {Read Auth Module}) Returns a list of users that can access the project "MyProject" with the permission "Read Auth Module".
Last modified: 22 May 2018