Full Cypher grammar

<program> ::= 
    <standalone procedure call>
  | <procedure specification>
  | <standalone operation statement>

<procedure specification> ::= 
  <statement block>

<nested procedure specification> ::= 
  <left brace> <procedure specification> <right brace>

<statement block> ::= 
  <statement> [ <next statement>... ]

<next statement> ::= 
  "NEXT" <statement>

<standalone operation statement> ::= 
    <standalone catalog statement>
  | <standalone operation control statement>
  | <standalone access control statement>

<statement> ::= 
    <composite statement>
  | <conditional statement>

<composite statement> ::= 
  <linear statement> [ { <composite conjunction> <linear statement> }... ]

<composite conjunction> ::= 
  "UNION" [ <set quantifier> ]

<conditional statement> ::= 
  <conditional statement when clause>... [ <conditional statement else clause> ]

<conditional statement when clause> ::= 
  "WHEN" <search condition> "THEN" <conditional statement result>

<conditional statement else clause> ::= 
  "ELSE" <conditional statement result>

<conditional statement result> ::= 
    <nested procedure specification>
  | <linear statement>

<linear statement> ::= 
  [ <use graph clause> ] { <nested procedure specification> | <statement chain> }

<statement chain> ::= 
    <primitive result statement>
  | <ambient primitive statement chain> [ <focused primitive statement chain>... ] [ <primitive result statement> ]

<focused primitive statement chain> ::= 
  <use graph clause> <ambient primitive statement chain>

<ambient primitive statement chain> ::= 
  <primitive statement>...

<primitive statement> ::= 
    <primitive query statement>
  | <primitive data load statement>
  | <primitive data update statement>
  | <call procedure statement>
  | <primitive operation statement>

<primitive query statement> ::= 
    <match statement>
  | <unwind statement>
  | <for statement>
  | <let statement>
  | <filter statement>
  | <order by and page statement>
  | <with statement>

<match statement> ::= 
    <optional match statement>
  | <simple match statement>

<optional match statement> ::= 
  "OPTIONAL" <optional match operand>

<optional match operand> ::= 
  <simple match statement>

<simple match statement> ::= 
  "MATCH" <graph pattern binding table>

<unwind statement> ::= 
  "UNWIND" <value expression> "AS" <binding variable>

<for statement> ::= 
  "FOR" <binding variable> "IN" <value expression>

<let statement> ::= 
  "LET" <let variable definition list>

<let variable definition list> ::= 
  <let variable definition> [ { <comma> <let variable definition> }... ]

<let variable definition> ::= 
  <binding variable> <equals operator> <value expression>

<filter statement> ::= 
  "FILTER" [ "WHERE" ] <search condition>

<order by and page statement> ::= 
  <order by and page clause>

<with statement> ::= 
  "WITH" <return statement body> [ <order by and page clause> ] [ <where clause> ]

<primitive data load statement> ::= 
  <load csv statement>

<load csv statement> ::= 
  "LOAD CSV" [ <csv headers option> ] <csv source> [ <csv field terminator> ]

<csv headers option> ::= 
  "WITH HEADERS"

<csv source> ::= 
  "FROM" <value expression> "AS" <binding variable>

<csv field terminator> ::= 
  "FIELDTERMINATOR" <character string literal>

<primitive data update statement> ::= 
    <create or insert statement>
  | <merge statement>
  | <set statement>
  | <remove statement>
  | <delete statement>
  | <foreach statement>

<create or insert statement> ::= 
    <create statement>
  | <insert statement>

<create statement> ::= 
  "CREATE" <create graph pattern>

<insert statement> ::= 
  "INSERT" <insert graph pattern>

<merge statement> ::= 
  "MERGE" <merge graph pattern> [ <merge action> ]

<merge action> ::= 
  "ON" { "MATCH" | "CREATE" } <set statement>

<set statement> ::= 
  "SET" <set item list>

<set item list> ::= 
  <set item> [ { <comma> <set item> }... ]

<set item> ::= 
    <set all properties item>
  | <add all properties item>
  | <set labels item>
  | <set property item>

<set all properties item> ::= 
  <binding variable reference> <equals operator> <value expression>

<add all properties item> ::= 
  <binding variable reference> <plus equals> <value expression>

<set labels item> ::= 
  <binding variable reference> <node label set specification for set and remove>

<set property item> ::= 
  <postfix expression> <equals operator> <value expression>

<remove statement> ::= 
  "REMOVE" <remove item list>

<remove item list> ::= 
  <remove item> [ { <comma> <remove item> }... ]

<remove item> ::= 
    <remove labels item>
  | <remove property item>

<remove labels item> ::= 
  <binding variable reference> <node label set specification for set and remove>

<remove property item> ::= 
  <postfix expression>

<delete statement> ::= 
  [ "DETACH" | "NODETACH" ] "DELETE" <delete item list>

<delete item list> ::= 
  <delete item> [ { <comma> <delete item> }... ]

<delete item> ::= 
  <value expression>

<foreach statement> ::= 
  "FOREACH" <left paren> <foreach element source> <foreach action> <right paren>

<foreach element source> ::= 
  <binding variable reference> "IN" <value expression>

<foreach action> ::= 
  <vertical bar> <foreach action statement>...

<foreach action statement> ::= 
    <create or insert statement>
  | <merge statement>
  | <set statement>
  | <remove statement>
  | <delete statement>

<call procedure statement> ::= 
  [ "OPTIONAL" ] "CALL" <procedure call>

<standalone procedure call> ::= 
  "CALL" <procedure reference> [ <explicit procedure arguments> ] [ <standalone procedure call yield clause> ]

<procedure call> ::= 
    <inline procedure call>
  | <named procedure call>

<inline procedure call> ::= 
  [ <variable scope clause> ] <nested procedure specification> [ <in transactions> ]

<variable scope clause> ::= 
  <left paren> [ <binding variable reference list> ] <right paren>

<in transactions> ::= 
  "IN" [ [ <value expression> ] "CONCURRENT" ] "TRANSACTIONS" [ <in transactions parameters>... ]

<in transactions parameters> ::= 
    <in transactions batch parameters>
  | <in transactions disjoint by parameters>
  | <in transactions error parameters>
  | <in transactions error retry parameters>
  | <in transactions report parameters>

<in transactions batch parameters> ::= 
  "OF" <value expression> { "ROW" | "ROWS" }

<in transactions disjoint by parameters> ::= 
    "DISJOINT BY NONE"
  | "DISJOINT BY AUTO"
  | "DISJOINT BY" <disjoint by expression group>

<disjoint by expression group> ::= 
  <left paren> <disjoint by expression list> <right paren>

<disjoint by expression list> ::= 
  <value expression> [ { <comma> <value expression> }... ]

<in transactions error parameters> ::= 
  "ON ERROR" <in transactions error action>

<in transactions error retry parameters> ::= 
  "ON ERROR RETRY" [ <in transactions error retry time> ] [ "THEN" <in transactions error action> ]

<in transactions error action> ::= 
    "CONTINUE"
  | "BREAK"
  | "FAIL"

<in transactions error retry time> ::= 
  "FOR" <value expression> <seconds keywords>

<in transactions report parameters> ::= 
  "REPORT STATUS AS" <binding variable>

<named procedure call> ::= 
  <procedure reference> <explicit procedure arguments> [ <yield clause> ]

<explicit procedure arguments> ::= 
  <left paren> [ <procedure argument list> ] <right paren>

<procedure argument list> ::= 
  <procedure argument> [ { <comma> <procedure argument> }... ]

<procedure argument> ::= 
  <value expression>

<yield clause> ::= 
  "YIELD" <yield item list> [ <where clause> ]

<standalone procedure call yield clause> ::= 
  "YIELD" { <yield item list> | <asterisk> }

<yield item list> ::= 
  <yield item> [ { <comma> <yield item> }... ]

<yield item> ::= 
  <yield item name> [ <yield item alias> ]

<yield item name> ::= 
  <field name>

<yield item alias> ::= 
  "AS" <binding variable>

<primitive result statement> ::= 
    <return statement>
  | "FINISH"

<return statement> ::= 
  "RETURN" <return statement body> [ <order by and page clause> ]

<return statement body> ::= 
  [ <set quantifier> ] <return item list> [ <group by clause> ]

<return item list> ::= 
  { <asterisk> | <return item> } [ { <comma> <return item> }... ]

<return item> ::= 
  <value expression> [ <return item alias> ]

<return item alias> ::= 
  "AS" <identifier>

<order by and page clause> ::= 
    <order by clause> [ <offset clause> ] [ <limit clause> ]
  | <offset clause> [ <limit clause> ]
  | <limit clause>

<order by clause> ::= 
  "ORDER BY" <sort specification list>

<sort specification list> ::= 
  <sort specification> [ { <comma> <sort specification> }... ]

<sort specification> ::= 
  <sort key> [ <ordering specification> ]

<sort key> ::= 
  <value expression>

<ordering specification> ::= 
    <ascending order>
  | <descending order>

<ascending order> ::= 
    "ASC"
  | "ASCENDING"

<descending order> ::= 
    "DESC"
  | "DESCENDING"

<offset clause> ::= 
  <offset synonym> <value expression>

<offset synonym> ::= 
    "SKIP"
  | "OFFSET"

<limit clause> ::= 
  "LIMIT" <value expression>

<group by clause> ::= 
  "GROUP BY" <grouping element list>

<grouping element list> ::= 
    <grouping element> [ { <comma> <grouping element> }... ]
  | <empty grouping set>
  | "ALL"

<grouping element> ::= 
  <value expression>

<empty grouping set> ::= 
  <left paren> <right paren>

<standalone catalog statement> ::= 
    <catalog create statement>
  | <catalog drop statement>
  | <catalog alter statement>
  | <standalone catalog show statement>

<command options> ::= 
  "OPTIONS" <map value or parameter specification>

<set option> ::= 
  "OPTION" <identifier> <value expression>

<remove option> ::= 
  "OPTION" <identifier>

<wait clause> ::= 
    "WAIT" <unsigned decimal integer> <seconds keywords>
  | "NOWAIT"

<if not exists> ::= 
  "IF NOT EXISTS"

<if exists> ::= 
  "IF EXISTS"

<property names specification> ::= 
    <property name inner specification>
  | <parenthesized property names specification>

<parenthesized property names specification> ::= 
  <left paren> <property name specification list> <right paren>

<bracketed property names specification> ::= 
  <left bracket> <property name specification list> <right bracket>

<property name specification list> ::= 
  <property name inner specification> [ { <comma> <property name inner specification> }... ]

<property name specification> ::= 
    <property name inner specification>
  | <left paren> <property name inner specification> <right paren>

<property name inner specification> ::= 
  <binding variable reference> <period> <property name>

<catalog create statement> ::= 
    <create alias statement>
  | <create auth rule statement>
  | <create constraint statement>
  | <create database statement>
  | <create index statement>
  | <create role statement>
  | <create user statement>

<create alias statement> ::= 
  "CREATE" [ "OR REPLACE" ] "ALIAS" <alias name specification> [ <if not exists> ] "FOR DATABASE" <alias target>

<alias target> ::= 
    <alias remote target>
  | <alias local target>

<alias local target> ::= 
  <alias target name specification> [ <alias target properties> ]

<alias remote target> ::= 
  <alias target name specification> <remote target connection> [ <alias target properties> ]

<remote target connection> ::= 
  <remote target connection host> <remote target connection credentials> [ <remote target connection driver settings> ] [ <default language specification> ]

<remote target connection host> ::= 
  "AT" <alias target name specification>

<remote target connection credentials> ::= 
    <remote target connection user> <remote target connection password>
  | <remote target credential forwarding>

<remote target connection user> ::= 
  "USER" <user name specification>

<remote target connection password> ::= 
  "PASSWORD" <password value specification>

<remote target credential forwarding> ::= 
  "OIDC CREDENTIAL FORWARDING"

<remote target connection driver settings> ::= 
  "DRIVER" <map value or parameter specification>

<alias target properties> ::= 
  "PROPERTIES" <map value or parameter specification>

<create auth rule statement> ::= 
  "CREATE" [ "OR REPLACE" ] "AUTH RULE" <auth rule name specification> [ <if not exists> ] <auth rule set condition> [ <auth rule set enabled> ]

<auth rule set condition> ::= 
  "SET CONDITION" <value expression>

<auth rule set enabled> ::= 
  "SET ENABLED" <boolean literal>

<create constraint statement> ::= 
  "CREATE CONSTRAINT" [ <constraint name specification> ] [ <if not exists> ] <constraint specification> [ <command options> ]

<constraint specification> ::= 
    <node constraint specification>
  | <relationship constraint specification>

<node constraint specification> ::= 
    <node key constraint>
  | <node uniqueness constraint>
  | <node property existence constraint>
  | <node property type constraint>

<relationship constraint specification> ::= 
    <relationship key constraint>
  | <relationship uniqueness constraint>
  | <relationship property existence constraint>
  | <relationship property type constraint>

<node key constraint> ::= 
  <node constraint for> <node key constraint require>

<node uniqueness constraint> ::= 
  <node constraint for> <node uniqueness constraint require>

<node property existence constraint> ::= 
  <node constraint for> <property existence constraint require>

<node property type constraint> ::= 
  <node constraint for> <property type constraint require>

<relationship key constraint> ::= 
  <relationship constraint for> <relationship key constraint require>

<relationship uniqueness constraint> ::= 
  <relationship constraint for> <relationship uniqueness constraint require>

<relationship property existence constraint> ::= 
  <relationship constraint for> <property existence constraint require>

<relationship property type constraint> ::= 
  <relationship constraint for> <property type constraint require>

<node constraint for> ::= 
  "FOR" <command node pattern>

<relationship constraint for> ::= 
  "FOR" <command relationship pattern>

<node key constraint require> ::= 
  "REQUIRE" <property names specification> "IS" [ "NODE" ] "KEY"

<relationship key constraint require> ::= 
  "REQUIRE" <property names specification> "IS" [ <relationship singular keywords> ] "KEY"

<node uniqueness constraint require> ::= 
  "REQUIRE" <property names specification> "IS" [ "NODE" ] "UNIQUE"

<relationship uniqueness constraint require> ::= 
  "REQUIRE" <property names specification> "IS" [ <relationship singular keywords> ] "UNIQUE"

<property existence constraint require> ::= 
  "REQUIRE" <property name specification> "IS NOT NULL"

<property type constraint require> ::= 
  "REQUIRE" <property name specification> <is typed> <value type>

<is typed> ::= 
    [ "IS" ] <double colon>
  | "IS TYPED"

<create database statement> ::= 
    <create standard database statement>
  | <create composite database statement>
  | <create replica database statement>

<create standard database statement> ::= 
  "CREATE" [ "OR REPLACE" ] "DATABASE" <database name specification> [ <if not exists> ] [ [ "SET" ] <default language specification> ] [ <topology specification> ] [ <command options> ] [ <wait clause> ]

<create composite database statement> ::= 
  "CREATE" [ "OR REPLACE" ] "COMPOSITE DATABASE" <database name specification> [ <if not exists> ] [ [ "SET" ] <default language specification> ] [ <command options> ] [ <wait clause> ]

<create replica database statement> ::= 
  "CREATE" [ "OR REPLACE" ] "REPLICA DATABASE" <database name specification> [ <if not exists> ] [ [ "SET" ] <default language specification> ] [ <topology specification> ] [ <command options> ] [ <wait clause> ]

<default language specification> ::= 
  "DEFAULT LANGUAGE CYPHER" <unsigned decimal integer>

<topology specification> ::= 
    [ "SET" ] <simple topology specification>
  | <shard topology specification>

<simple topology specification> ::= 
  "TOPOLOGY" { <primary topology> [ <secondary topology> ] | <secondary topology> [ <primary topology> ] }

<primary topology> ::= 
  <unsigned decimal integer specification> <primary keywords>

<secondary topology> ::= 
  <unsigned decimal integer specification> <secondary keywords>

<shard topology specification> ::= 
  [ [ "SET" ] <graph shard> ] [ "SET" ] <property shard>

<graph shard> ::= 
  "GRAPH SHARD" <left brace> [ [ "SET" ] <simple topology specification> ] <right brace> <property shard>

<property shard> ::= 
  "PROPERTY" <shard keywords> <left brace> "COUNT" <unsigned decimal integer specification> [ [ "SET" ] <replica topology> ] <right brace>

<replica topology> ::= 
  "TOPOLOGY" <unsigned decimal integer specification> <replica keywords>

<create index statement> ::= 
  "CREATE" <index specification> [ <command options> ]

<index specification> ::= 
    <fulltext index>
  | <lookup index>
  | <point index>
  | <range index>
  | <text index>
  | <vector index>

<fulltext index> ::= 
  "FULLTEXT" <index prefix> <multi-entity-token index for> <fulltext index on>

<lookup index> ::= 
  "LOOKUP" <index prefix> { <node lookup index for and on> | <relationship lookup index for and on> }

<point index> ::= 
  "POINT" <index prefix> <index for> <single property index on>

<range index> ::= 
  "RANGE" <index prefix> <index for> <composite index on>

<text index> ::= 
  "TEXT" <index prefix> <index for> <single property index on>

<vector index> ::= 
  "VECTOR" <index prefix> <multi-entity-token index for> <single property index on> [ <with properties> ]

<index prefix> ::= 
  "INDEX" [ <index name specification> ] [ <if not exists> ]

<index for> ::= 
  "FOR" <command element pattern>

<composite index on> ::= 
  "ON" <property names specification>

<single property index on> ::= 
  "ON" <property name specification>

<node lookup index for and on> ::= 
  <node lookup index for> <node lookup index on>

<node lookup index for> ::= 
  "FOR" <lookup index node pattern>

<node lookup index on> ::= 
  "ON EACH" <function name> <left paren> <binding variable> <right paren>

<relationship lookup index for and on> ::= 
  <relationship lookup index for> <relationship lookup index on>

<relationship lookup index for> ::= 
  "FOR" <lookup index relationship pattern>

<relationship lookup index on> ::= 
  "ON" [ "EACH" ] <function name> <left paren> <binding variable> <right paren>

<multi-entity-token index for> ::= 
  "FOR" <multi-entity-token index element pattern>

<fulltext index on> ::= 
  "ON EACH" <bracketed property names specification>

<with properties> ::= 
  "WITH" <bracketed property names specification>

<create role statement> ::= 
  "CREATE" [ "OR REPLACE" ] [ "IMMUTABLE" ] "ROLE" <role name specification> [ <if not exists> ] [ <as copy of role> ]

<as copy of role> ::= 
  "AS COPY OF" <role name specification>

<create user statement> ::= 
  "CREATE" [ "OR REPLACE" ] "USER" <user name specification> [ <if not exists> ] <user create set clause>...

<user create set clause> ::= 
  "SET" <user create set item>

<user create set item> ::= 
    <user set password>
  | <user set password change required>
  | <user set status>
  | <user set home database>
  | <user set authentication provider>
  | <user set tags clause>

<user set password> ::= 
  <password specification> [ <password change required specification> ]

<password specification> ::= 
  [ "PLAINTEXT" | "ENCRYPTED" ] "PASSWORD" <password value specification>

<user set password change required> ::= 
  <password change required specification>

<password change required specification> ::= 
  "PASSWORD" <change required specification>

<change required specification> ::= 
  "CHANGE" [ "NOT" ] "REQUIRED"

<user set status> ::= 
  "STATUS" { "SUSPENDED" | "ACTIVE" }

<user set home database> ::= 
  "HOME DATABASE" <alias or database name specification>

<user set authentication provider> ::= 
  "AUTH" [ "PROVIDER" ] <character string literal> <user set authentication provider attributes>

<user set authentication provider attributes> ::= 
  <left brace> <user set authentication provider attribute>... <right brace>

<user set authentication provider attribute> ::= 
  "SET" <user authentication provider attribute>

<user authentication provider attribute> ::= 
    <user authentication provider id>
  | <user authentication provider password>
  | <user authentication provider password change required>

<user authentication provider id> ::= 
  "ID" <character string value specification>

<user authentication provider password> ::= 
  <password specification>

<user authentication provider password change required> ::= 
  <password change required specification>

<user set tags clause> ::= 
  <explicit user tags>

<explicit user tags> ::= 
  <tag keywords> <character string or string list value specification>

<catalog drop statement> ::= 
    <drop alias statement>
  | <drop auth rule statement>
  | <drop constraint statement>
  | <drop database statement>
  | <drop index statement>
  | <drop role statement>
  | <drop server statement>
  | <drop user statement>

<drop alias statement> ::= 
  "DROP ALIAS" <alias name specification> [ <if exists> ] "FOR DATABASE"

<drop auth rule statement> ::= 
  "DROP AUTH RULE" <auth rule name specification> [ <if exists> ]

<drop constraint statement> ::= 
  "DROP CONSTRAINT" <constraint name specification> [ <if exists> ]

<drop database statement> ::= 
  "DROP" [ "COMPOSITE" ] "DATABASE" <alias or database name specification> [ <if exists> ] [ <drop database alias action> ] [ <drop database data action> ] [ <wait clause> ]

<drop database alias action> ::= 
    "RESTRICT"
  | "CASCADE" <alias keywords>

<drop database data action> ::= 
    <drop database dump data action>
  | <drop database destroy data action>

<drop database dump data action> ::= 
  "DUMP DATA"

<drop database destroy data action> ::= 
  "DESTROY DATA"

<drop index statement> ::= 
  "DROP INDEX" <index name specification> [ <if exists> ]

<drop role statement> ::= 
  "DROP ROLE" <role name specification> [ <if exists> ]

<drop server statement> ::= 
  "DROP SERVER" <server name specification>

<drop user statement> ::= 
  "DROP USER" <user name specification> [ <if exists> ]

<catalog alter statement> ::= 
    <alter alias statement>
  | <alter auth rule statements>
  | <alter current graph type statement>
  | <alter database statement>
  | <alter role statements>
  | <alter server statements>
  | <alter user statements>

<alter role statements> ::= 
  <rename role statement>

<alter server statements> ::= 
    <alter server statement>
  | <rename server statement>

<alter user statements> ::= 
    <alter current user statement>
  | <alter user statement>
  | <alter users statement>
  | <rename user statement>

<alter auth rule statements> ::= 
    <alter auth rule statement>
  | <rename auth rule statement>

<alter alias statement> ::= 
  "ALTER ALIAS" <alias name specification> [ <if exists> ] "SET DATABASE" <alias alter target>

<alias alter target> ::= 
    <alias alter local target item>...
  | <alias alter remote target item>...

<alias alter local target item> ::= 
    <alias target database name>
  | <alias target properties>

<alias alter remote target item> ::= 
    <alias target database name> <remote target connection host>
  | <remote target connection user>
  | <remote target connection password>
  | <remote target connection driver settings>
  | <default language specification>
  | <alias target properties>

<alias target database name> ::= 
  "TARGET" <alias target name specification>

<rename auth rule statement> ::= 
  "RENAME AUTH RULE" <auth rule name specification> [ <if exists> ] "TO" <auth rule name specification>

<alter auth rule statement> ::= 
  "ALTER AUTH RULE" <auth rule name specification> [ <if exists> ] <auth rule set clause>...

<auth rule set clause> ::= 
    <auth rule set condition>
  | <auth rule set enabled>

<alter current graph type statement> ::= 
  "ALTER CURRENT GRAPH TYPE" <alter current graph type action>

<alter current graph type action> ::= 
    <alter current graph type add>
  | <alter current graph type alter>
  | <alter current graph type drop>
  | <alter current graph type set>

<alter current graph type add> ::= 
  "ADD" <graph type specification>

<alter current graph type alter> ::= 
  "ALTER" <graph type specification>

<alter current graph type drop> ::= 
  "DROP" <graph type drop specification>

<alter current graph type set> ::= 
  "SET" <graph type specification>

<alter database statement> ::= 
  "ALTER DATABASE" <alias or database name specification> [ <if exists> ] { <database set clause>... | <database remove clause>... } [ <wait clause> ]

<database set clause> ::= 
  "SET" <database set item>

<database set item> ::= 
    <access specification>
  | <alter topology>
  | <set option>
  | <default language specification>

<access specification> ::= 
  "ACCESS" { <read-only access> | <read write access> }

<read-only access> ::= 
  "READ ONLY"

<read write access> ::= 
  "READ WRITE"

<alter topology> ::= 
    <simple topology specification>
  | <replica topology>
  | <graph shard>
  | <alter property shard>

<alter property shard> ::= 
  "PROPERTY" <shard keywords> <left brace> "SET" <replica topology> <right brace>

<database remove clause> ::= 
  "REMOVE" <database remove item>

<database remove item> ::= 
  <remove option>

<rename role statement> ::= 
  "RENAME ROLE" <role name specification> [ <if exists> ] "TO" <role name specification>

<rename server statement> ::= 
  "RENAME SERVER" <server name specification> "TO" <server name specification>

<alter server statement> ::= 
  "ALTER SERVER" <server name specification> "SET" <command options>

<rename user statement> ::= 
  "RENAME USER" <user name specification> [ <if exists> ] "TO" <user name specification>

<alter current user statement> ::= 
  "CURRENT USER SET PASSWORD FROM" <password value specification> "TO" <password value specification>

<alter user statement> ::= 
  "ALTER USER" <user name specification> [ <if exists> ] [ <user remove clause>... ] [ <user add clause>... ] [ <user alter set clause>... ]

<user alter set clause> ::= 
  "SET" <user alter set item>

<user alter set item> ::= 
    <user set password>
  | <user set password change required>
  | <user set status>
  | <user set home database>
  | <user set authentication provider>
  | <user set tags clause>

<user add clause> ::= 
  "ADD" <user add item>

<user add item> ::= 
  <user add tags clause>

<user add tags clause> ::= 
  <explicit user tags>

<user remove clause> ::= 
  "REMOVE" <user remove item>

<user remove item> ::= 
    <user remove home database>
  | <user remove all authentication provider>
  | <user remove named authentication provider>
  | <user remove tags clause>

<user remove home database> ::= 
  "HOME DATABASE"

<user remove all authentication provider> ::= 
  "ALL AUTH" [ <provider keywords> ]

<user remove named authentication provider> ::= 
  "AUTH" [ <provider keywords> ] <character string or string list value specification>

<user remove tags clause> ::= 
    <explicit user tags>
  | "ALL" <tag keywords>

<alter users statement> ::= 
  "ALTER USERS" <user name specification list> [ <if exists> ] [ <user remove bulk clause>... ] [ <user add bulk clause>... ] [ <user set bulk clause>... ]

<user add bulk clause> ::= 
  "ADD" <user add bulk item>

<user add bulk item> ::= 
  <user add tags clause>

<user remove bulk clause> ::= 
  "REMOVE" <user remove bulk item>

<user remove bulk item> ::= 
  <user remove tags clause>

<user set bulk clause> ::= 
  "SET" <user set bulk item>

<user set bulk item> ::= 
  <user set tags clause>

<standalone catalog show statement> ::= 
    <show aliases statement>
  | <show current user statement>
  | <show privileges statement>
  | <show auth rules statement>
  | <show roles statement>
  | <show servers statement>
  | <show users statement>

<primitive catalog show statement> ::= 
    <show constraints statement>
  | <show current graph type statement>
  | <show indexes statement>
  | <show functions statement>
  | <show procedures statement>
  | <show settings statement>
  | <show transactions statement>
  | <show databases statement>

<show aliases statement> ::= 
  "SHOW" <alias keywords> [ <alias name specification> ] "FOR" <database keywords> [ <show result clause> ]

<show auth rules statement> ::= 
  "SHOW" <auth rule keywords> [ "AS" <command keywords> ] [ <show result clause> ]

<show constraints statement> ::= 
  "SHOW" [ <show constraint type> ] <constraint keywords> [ <show yield where clause> ]

<show constraint type> ::= 
    <show all constraints>
  | <show key constraints>
  | <show uniqueness constraints>
  | <show property existence constraints>
  | <show existence constraints>
  | <show property type constraints>

<show all constraints> ::= 
  "ALL"

<show key constraints> ::= 
  [ <show constraints for element> ] "KEY"

<show uniqueness constraints> ::= 
  [ <show constraints for element> ] [ "PROPERTY" ] { "UNIQUENESS" | "UNIQUE" }

<show property existence constraints> ::= 
  [ <show constraints for element> ] "PROPERTY" { "EXISTENCE" | "EXIST" }

<show existence constraints> ::= 
  [ <show constraints for element> ] { "EXISTENCE" | "EXIST" }

<show property type constraints> ::= 
  [ <show constraints for element> ] "PROPERTY TYPE"

<show constraints for element> ::= 
    "NODE"
  | <relationship singular keywords>

<show current graph type statement> ::= 
  "SHOW CURRENT GRAPH TYPE" [ "AS GRAPH" ] [ <show yield where clause> ]

<show current user statement> ::= 
  "SHOW CURRENT USER" [ <show result clause> ]

<show users statement> ::= 
  "SHOW" <user keywords> [ "WITH AUTH" ] [ "AS" <command keywords> ] [ <show result clause> ]

<show databases statement> ::= 
    <show all databases statement>
  | <show default database statement>
  | <show home database statement>
  | <show named database statement>

<show all databases statement> ::= 
  "SHOW" <database keywords> [ <show yield where clause> ]

<show default database statement> ::= 
  "SHOW DEFAULT DATABASE" [ <show yield where clause> ]

<show home database statement> ::= 
  "SHOW HOME DATABASE" [ <show yield where clause> ]

<show named database statement> ::= 
  "SHOW" <database keywords> <alias or database name specification> [ <show yield where clause> ]

<show functions statement> ::= 
  "SHOW" [ <show function type> ] <function keywords> [ <executable by> ] [ <show yield where clause> ]

<show procedures statement> ::= 
  "SHOW" <procedure keywords> [ <executable by> ] [ <show yield where clause> ]

<show function type> ::= 
    <show all functions>
  | <show built-in functions>
  | <show user-defined functions>

<show all functions> ::= 
  "ALL"

<show built-in functions> ::= 
  "BUILT IN"

<show user-defined functions> ::= 
  "USER DEFINED"

<executable by> ::= 
  "EXECUTABLE" [ <by current user> | <by named user> ]

<by current user> ::= 
  "BY CURRENT USER"

<by named user> ::= 
  "BY" <user name>

<show indexes statement> ::= 
  "SHOW" [ <show index type> ] <index keywords> [ <show yield where clause> ]

<show index type> ::= 
    <show all indexes>
  | <show fulltext indexes>
  | <show lookup indexes>
  | <show point indexes>
  | <show range indexes>
  | <show text indexes>
  | <show vector indexes>

<show all indexes> ::= 
  "ALL"

<show fulltext indexes> ::= 
  "FULLTEXT"

<show lookup indexes> ::= 
  "LOOKUP"

<show point indexes> ::= 
  "POINT"

<show range indexes> ::= 
  "RANGE"

<show text indexes> ::= 
  "TEXT"

<show vector indexes> ::= 
  "VECTOR"

<show privileges statement> ::= 
    <show all privileges statement>
  | <show supported privileges statement>
  | <show role privileges statement>
  | <show user privileges statement>
  | <show auth rule privileges statement>

<show all privileges statement> ::= 
  "SHOW" [ "ALL" ] <privilege keywords> [ <show privilege as> ] [ <show result clause> ]

<show supported privileges statement> ::= 
  "SHOW SUPPORTED" <privilege keywords> [ <show result clause> ]

<show role privileges statement> ::= 
  "SHOW" <role keywords> <role name specification list> <privilege keywords> [ <show privilege as> ] [ <show result clause> ]

<show user privileges statement> ::= 
  "SHOW" <user keywords> [ <user name specification list> ] <privilege keywords> [ <show privilege as> ] [ <show result clause> ]

<show auth rule privileges statement> ::= 
  "SHOW" <auth rule keywords> <auth rule name specification list> <privilege keywords> [ <show privilege as> ] [ <show result clause> ]

<show privilege as> ::= 
    <show privilege as grant-deny command>
  | <show privilege as revoke command>

<show privilege as grant-deny command> ::= 
  "AS" <command keywords>

<show privilege as revoke command> ::= 
  "AS REVOKE" <command keywords>

<show roles statement> ::= 
    <show all roles statement>
  | <show populated roles statement>

<show all roles statement> ::= 
  "SHOW" [ "ALL" ] <role keywords> [ <with users> | <with auth rules> ] [ "AS" <command keywords> ] [ <show result clause> ]

<show populated roles statement> ::= 
  "SHOW POPULATED" <role keywords> [ <with users> | <with auth rules> ] [ "AS" <command keywords> ] [ <show result clause> ]

<with users> ::= 
  "WITH" <user keywords>

<with auth rules> ::= 
  "WITH" <auth rule keywords>

<show servers statement> ::= 
  "SHOW" <server keywords> [ <show result clause> ]

<show settings statement> ::= 
  "SHOW" <setting keywords> [ <character string list element list or expression> ] [ <show yield where clause> ]

<show transactions statement> ::= 
  "SHOW" <transaction keywords> [ <character string list element list or expression> ] [ <show yield where clause> ]

<show result clause> ::= 
    <show yield result clause>
  | <show where result clause>

<show yield where clause> ::= 
    <show yield only clause>
  | <show where result clause>

<show yield result clause> ::= 
  "YIELD" { <yield item list> | <asterisk> } [ <order by clause> ] [ <offset clause> ] [ <limit clause> ] [ <where clause> ] [ <return statement> ]

<show yield only clause> ::= 
  "YIELD" { <yield item list> | <asterisk> } [ <order by clause> ] [ <offset clause> ] [ <limit clause> ] [ <where clause> ]

<show where result clause> ::= 
  <where clause>

<graph type specification> ::= 
  <left brace> [ <graph type specification body> ] <right brace>

<graph type specification body> ::= 
  <graph type element> [ { <comma> <graph type element> }... ]

<graph type element> ::= 
    <relationship element type with constraints specification>
  | <node element type with constraints specification>
  | <graph type constraint specification>

<node element type with constraints specification> ::= 
  <node element type specification> [ <node element type inline constraint list> ]

<relationship element type with constraints specification> ::= 
  <relationship element type specification> [ <relationship element type inline constraint list> ]

<node element type inline constraint list> ::= 
  <node element type inline constraint require>...

<relationship element type inline constraint list> ::= 
  <relationship element type inline constraint require>...

<node element type inline constraint require> ::= 
    <graph type node key constraint require>
  | <graph type node property uniqueness constraint require>

<relationship element type inline constraint require> ::= 
    <graph type relationship key constraint require>
  | <graph type relationship property uniqueness constraint require>

<node element type specification> ::= 
  <left paren> [ <element type alias> ] <node element type filler> <right paren>

<node element type filler> ::= 
  <identifying label> [ <implied label set> ] [ <property types specification> ]

<implied label set> ::= 
  { <colon> | "IS" } <label name> [ { <ampersand> <label name> }... ]

<node element type reference> ::= 
    <node element type alias reference>
  | <node element type in-situ reference>

<node element type alias reference> ::= 
  <left paren> <element type alias> <right paren>

<node element type in-situ reference> ::= 
  <left paren> [ [ <element type alias> ] <single label> [ <implies> ] ] <right paren>

<empty node element type reference> ::= 
  <left paren> <right paren>

<relationship element type specification> ::= 
  <source endpoint> <arc pointing right> <destination endpoint>

<arc pointing right> ::= 
  <arc pointing right start> [ <element type alias> ] <relationship element type filler> <arc pointing right end>

<relationship element type filler> ::= 
  <identifying label> [ <property types specification> ]

<source endpoint> ::= 
  <node element type reference>

<destination endpoint> ::= 
  <node element type reference>

<arc pointing right start> ::= 
  <arrow line> <left bracket>

<arc pointing right end> ::= 
  <right bracket> <arrow line> <right arrowhead>

<relationship element type reference> ::= 
    <relationship element type alias reference>
  | <relationship element type in-situ reference>

<relationship element type alias reference> ::= 
  <relationship element type reference start> <element type alias> <relationship element type reference end>

<relationship element type in-situ reference> ::= 
  <relationship element type reference start> <element type alias> <single label> [ <implies> ] <relationship element type reference end>

<relationship element type reference start> ::= 
  <empty node element type reference> <arc pointing right start>

<relationship element type reference end> ::= 
  <arc pointing right end> <empty node element type reference>

<property types specification> ::= 
  <left brace> [ <property type list> ] <right brace>

<property type list> ::= 
  <property type with constraint> [ { <comma> <property type with constraint> }... ]

<property type with constraint> ::= 
  <property type> [ <property type inline constraint> ]

<property type> ::= 
  <property name> [ <typed> ] <value type>

<property type inline constraint> ::= 
    <property type inline key constraint>
  | <property type inline uniqueness constraint>

<property type inline key constraint> ::= 
  "IS" [ "NODE" | <relationship singular keywords> ] "KEY"

<property type inline uniqueness constraint> ::= 
  "IS" [ "NODE" | <relationship singular keywords> ] "UNIQUE"

<graph type constraint specification> ::= 
    <graph type node constraint>
  | <graph type relationship constraint>

<graph type node constraint> ::= 
    <graph type node key constraint>
  | <graph type node uniqueness constraint>
  | <graph type node property existence constraint>
  | <graph type node property type constraint>

<graph type relationship constraint> ::= 
    <graph type relationship key constraint>
  | <graph type relationship uniqueness constraint>
  | <graph type relationship property existence constraint>
  | <graph type relationship property type constraint>

<graph type node key constraint> ::= 
  <graph type node constraint prefix> <graph type node key constraint require>

<graph type node uniqueness constraint> ::= 
  <graph type node constraint prefix> <graph type node property uniqueness constraint require>

<graph type node property existence constraint> ::= 
  <graph type node constraint prefix> <graph type property existence constraint require>

<graph type node property type constraint> ::= 
  <graph type node constraint prefix> <graph type property type constraint require>

<graph type relationship key constraint> ::= 
  <graph type relationship constraint prefix> <graph type relationship key constraint require>

<graph type relationship uniqueness constraint> ::= 
  <graph type relationship constraint prefix> <graph type relationship property uniqueness constraint require>

<graph type relationship property existence constraint> ::= 
  <graph type relationship constraint prefix> <graph type property existence constraint require>

<graph type relationship property type constraint> ::= 
  <graph type relationship constraint prefix> <graph type property type constraint require>

<graph type node constraint prefix> ::= 
  <graph type constraint prefix> <node element type reference>

<graph type relationship constraint prefix> ::= 
  <graph type constraint prefix> <relationship element type reference>

<graph type constraint prefix> ::= 
  "CONSTRAINT" [ <constraint name> ] "FOR"

<graph type node key constraint require> ::= 
  "REQUIRE" <graph type constraint property names specification> "IS" [ "NODE" ] "KEY" [ <command options> ]

<graph type relationship key constraint require> ::= 
  "REQUIRE" <graph type constraint property names specification> "IS" [ <relationship singular keywords> ] "KEY" [ <command options> ]

<graph type node property uniqueness constraint require> ::= 
  "REQUIRE" <graph type constraint property names specification> "IS" [ "NODE" ] "UNIQUE" [ <command options> ]

<graph type relationship property uniqueness constraint require> ::= 
  "REQUIRE" <graph type constraint property names specification> "IS" [ <relationship singular keywords> ] "UNIQUE" [ <command options> ]

<graph type property existence constraint require> ::= 
  "REQUIRE" <graph type constraint property name specification> "IS NOT NULL" [ <command options> ]

<graph type property type constraint require> ::= 
  "REQUIRE" <graph type constraint property name specification> <is typed> <value type> [ <command options> ]

<graph type constraint property names specification> ::= 
    <graph type constraint property name specification>
  | <left paren> <graph type constraint property name specification list> <right paren>

<graph type constraint property name specification list> ::= 
  <graph type constraint property name specification> [ { <comma> <graph type constraint property name specification> }... ]

<graph type constraint property name specification> ::= 
  <element type alias> <period> <property name>

<graph type drop specification> ::= 
  <left brace> [ <graph type drop specification body> ] <right brace>

<graph type drop specification body> ::= 
  <graph type drop element> [ { <comma> <graph type drop element> }... ]

<graph type drop element> ::= 
    <graph type element drop specification>
  | <graph type constraint drop specification>

<graph type element drop specification> ::= 
    <relationship element type specification>
  | <node element type specification>

<graph type constraint drop specification> ::= 
  "CONSTRAINT" <constraint name>

<identifying label> ::= 
  <single label> <implies>

<single label> ::= 
  { <colon> | "IS" } <label name>

<implies> ::= 
    <right double arrow>
  | "IMPLIES"

<element type alias> ::= 
  <identifier>

<standalone operation control statement> ::= 
    <deallocate database statement>
  | <enable server statement>
  | <reallocate database statement>
  | <start database statement>
  | <stop database statement>

<primitive operation statement> ::= 
    <primitive catalog show statement>
  | <terminate transaction statement>

<deallocate database statement> ::= 
  [ "DRYRUN" ] "DEALLOCATE" <database keywords> "FROM" <server keywords> <character string list element list specification>

<reallocate database statement> ::= 
  [ "DRYRUN" ] "REALLOCATE" <database keywords>

<start database statement> ::= 
  "START DATABASE" <alias or database name specification> [ <wait clause> ]

<stop database statement> ::= 
  "STOP DATABASE" <alias or database name specification> [ <wait clause> ]

<terminate transaction statement> ::= 
  "TERMINATE" <transaction keywords> <character string list element list or expression> [ <show yield only clause> ]

<enable server statement> ::= 
  "ENABLE SERVER" <server name specification> <command options>

<standalone access control statement> ::= 
    <grant statement>
  | <deny statement>
  | <revoke statement>

<grant statement> ::= 
  "GRANT" { <grant privilege> | <grant role> }

<grant privilege> ::= 
  [ "IMMUTABLE" ] <privilege> "TO" <role name specification list>

<grant role> ::= 
  <role keywords> <role name specification list> "TO" <user or auth rule>

<user or auth rule> ::= 
    [ <user keywords> ] <user name specification list>
  | <auth rule keywords> <auth rule name specification list>

<deny statement> ::= 
  "DENY" [ "IMMUTABLE" ] <privilege> "TO" <role name specification list>

<revoke statement> ::= 
  "REVOKE" { <revoke privilege> | <revoke role> }

<revoke privilege> ::= 
  [ "GRANT" | "DENY" ] [ "IMMUTABLE" ] <privilege> "FROM" <role name specification list>

<revoke role> ::= 
  <role keywords> <role name specification list> "FROM" <user or auth rule>

<privilege> ::= 
    <graph privilege>
  | <database privilege>
  | <dbms privilege>
  | <load privilege>

<graph privilege> ::= 
    <all graph privilege>
  | <merge privilege>
  | <read graph privilege group>
  | <write graph privilege group>

<all graph privilege> ::= 
  "ALL" [ [ "GRAPH" ] "PRIVILEGES" ] <graph privilege target>

<merge privilege> ::= 
  "MERGE" <property privilege target> <qualified write graph privilege target>

<read graph privilege group> ::= 
    <traverse element privilege>
  | <read and match element privilege>

<traverse element privilege> ::= 
  "TRAVERSE" <qualified read graph privilege target>

<read and match element privilege> ::= 
  { "READ" | "MATCH" } <property privilege target> <qualified read graph privilege target>

<write graph privilege group> ::= 
    <create element privilege>
  | <delete element privilege>
  | <remove label privilege>
  | <set label privilege>
  | <set property privilege>
  | <write privilege>

<create element privilege> ::= 
  "CREATE" <qualified write graph privilege target>

<delete element privilege> ::= 
  "DELETE" <qualified write graph privilege target>

<remove label privilege> ::= 
  "REMOVE" <label privilege target> <graph privilege target>

<set label privilege> ::= 
  "SET" <label privilege target> <graph privilege target>

<set property privilege> ::= 
  "SET PROPERTY" <named property privilege target> <qualified write graph privilege target>

<write privilege> ::= 
  "WRITE" <graph privilege target>

<database privilege> ::= 
    <all database privilege>
  | <access privilege>
  | <start privilege>
  | <stop privilege>
  | <alter database on database privilege group>
  | <index management privilege group>
  | <constraint management privilege group>
  | <name management privilege group>
  | <transaction management privilege group>

<all database privilege> ::= 
  "ALL" [ [ "DATABASE" ] "PRIVILEGES" ] <database privilege target>

<access privilege> ::= 
  "ACCESS" <database privilege target>

<start privilege> ::= 
  "START" <database privilege target>

<stop privilege> ::= 
  "STOP" <database privilege target>

<alter database on database privilege group> ::= 
    <alter database on database privilege>
  | <set database access on database privilege>
  | <set database default language on database privilege>

<alter database on database privilege> ::= 
  "ALTER" [ "COMPOSITE" ] "DATABASE" <database privilege target>

<set database access on database privilege> ::= 
  "SET DATABASE ACCESS" <database privilege target>

<set database default language on database privilege> ::= 
  "SET DATABASE DEFAULT LANGUAGE" <database privilege target>

<index management privilege group> ::= 
    <create index privilege>
  | <drop index privilege>
  | <show index privilege>
  | <index management privilege>

<create index privilege> ::= 
  "CREATE" <index keywords> <database privilege target>

<drop index privilege> ::= 
  "DROP" <index keywords> <database privilege target>

<show index privilege> ::= 
  "SHOW" <index keywords> <database privilege target>

<index management privilege> ::= 
  <index keywords> [ "MANAGEMENT" ] <database privilege target>

<constraint management privilege group> ::= 
    <create constraint privilege>
  | <drop constraint privilege>
  | <show constraint privilege>
  | <constraint management privilege>

<create constraint privilege> ::= 
  "CREATE" <constraint keywords> <database privilege target>

<drop constraint privilege> ::= 
  "DROP" <constraint keywords> <database privilege target>

<show constraint privilege> ::= 
  "SHOW" <constraint keywords> <database privilege target>

<constraint management privilege> ::= 
  <constraint keywords> [ "MANAGEMENT" ] <database privilege target>

<name management privilege group> ::= 
    <create node label privilege>
  | <create relationship type privilege>
  | <create property name privilege>
  | <name management privilege>

<create node label privilege> ::= 
  "CREATE NEW" [ "NODE" ] <label keywords> <database privilege target>

<create relationship type privilege> ::= 
  "CREATE NEW" [ "RELATIONSHIP" ] <type keywords> <database privilege target>

<create property name privilege> ::= 
  "CREATE NEW" [ "PROPERTY" ] <name keywords> <database privilege target>

<name management privilege> ::= 
  "NAME" [ "MANAGEMENT" ] <database privilege target>

<transaction management privilege group> ::= 
    <show transaction privilege>
  | <transaction termination privilege>
  | <transaction management privilege>

<show transaction privilege> ::= 
  "SHOW" <transaction keywords> [ <user privilege target> ] <database privilege target>

<transaction termination privilege> ::= 
  "TERMINATE" <transaction keywords> [ <user privilege target> ] <database privilege target>

<transaction management privilege> ::= 
  "TRANSACTION" [ "MANAGEMENT" ] [ <user privilege target> ] <database privilege target>

<dbms privilege> ::= 
    <all dbms privilege>
  | <impersonate user privilege>
  | <show setting privilege>
  | <execute privilege group>
  | <user management privilege group>
  | <auth rule management privilege group>
  | <role management privilege group>
  | <user metadata management privilege group>
  | <privilege management privilege group>
  | <alias management privilege group>
  | <database management privilege group>
  | <server management privilege group>

<all dbms privilege> ::= 
  "ALL" [ [ "DBMS" ] "PRIVILEGES" ] <dbms privilege target>

<impersonate user privilege> ::= 
  "IMPERSONATE" <user privilege target> <dbms privilege target>

<show setting privilege> ::= 
  "SHOW" <setting keywords> <setting privilege target> <dbms privilege target>

<execute privilege group> ::= 
    <execute admin procedures privilege>
  | <execute procedures privilege>
  | <execute functions privilege>

<execute admin procedures privilege> ::= 
  "EXECUTE" <admin keywords> "PROCEDURES" <dbms privilege target>

<execute procedures privilege> ::= 
  "EXECUTE" [ "BOOSTED" ] <procedure keywords> <procedure privilege target> <dbms privilege target>

<execute functions privilege> ::= 
  "EXECUTE" [ "BOOSTED" ] [ "USER" [ "DEFINED" ] ] <function keywords> <function privilege target> <dbms privilege target>

<user management privilege group> ::= 
    <create user privilege>
  | <rename user privilege>
  | <alter user privilege>
  | <set password privilege>
  | <set user status privilege>
  | <set user home database privilege>
  | <set auth privilege>
  | <drop user privilege>
  | <show user privilege>
  | <show user credentials privilege>
  | <user management privilege>

<create user privilege> ::= 
  "CREATE USER" <dbms privilege target>

<rename user privilege> ::= 
  "RENAME USER" <dbms privilege target>

<alter user privilege> ::= 
  "ALTER USER" <dbms privilege target>

<set password privilege> ::= 
  "SET" <password keywords> <dbms privilege target>

<set user status privilege> ::= 
  "SET USER STATUS" <dbms privilege target>

<set user home database privilege> ::= 
  "SET USER" <home database keyword> <dbms privilege target>

<set auth privilege> ::= 
  "SET AUTH" <dbms privilege target>

<drop user privilege> ::= 
  "DROP USER" <dbms privilege target>

<show user privilege> ::= 
  "SHOW USER" <dbms privilege target>

<show user credentials privilege> ::= 
  "SHOW USER CREDENTIALS" <dbms privilege target>

<user management privilege> ::= 
  "USER MANAGEMENT" <dbms privilege target>

<auth rule management privilege group> ::= 
    <create auth rule privilege>
  | <rename auth rule privilege>
  | <alter auth rule privilege>
  | <drop auth rule privilege>
  | <show auth rule privilege>
  | <auth rule management privilege>

<create auth rule privilege> ::= 
  "CREATE AUTH RULE" <dbms privilege target>

<rename auth rule privilege> ::= 
  "RENAME AUTH RULE" <dbms privilege target>

<alter auth rule privilege> ::= 
  "ALTER AUTH RULE" <dbms privilege target>

<drop auth rule privilege> ::= 
  "DROP AUTH RULE" <dbms privilege target>

<show auth rule privilege> ::= 
  "SHOW AUTH RULE" <dbms privilege target>

<auth rule management privilege> ::= 
  "AUTH RULE MANAGEMENT" <dbms privilege target>

<user metadata management privilege group> ::= 
    <show user metadata privilege>
  | <set user metadata privilege>
  | <user metadata management privilege>

<show user metadata privilege> ::= 
  "SHOW USER METADATA" <dbms privilege target>

<set user metadata privilege> ::= 
  "SET USER METADATA" <dbms privilege target>

<user metadata management privilege> ::= 
  "USER METADATA MANAGEMENT" <dbms privilege target>

<role management privilege group> ::= 
    <create role privilege>
  | <rename role privilege>
  | <drop role privilege>
  | <assign role privilege>
  | <remove role privilege>
  | <show role privilege>
  | <role management privilege>

<create role privilege> ::= 
  "CREATE ROLE" <dbms privilege target>

<rename role privilege> ::= 
  "RENAME ROLE" <dbms privilege target>

<drop role privilege> ::= 
  "DROP ROLE" <dbms privilege target>

<assign role privilege> ::= 
  "ASSIGN ROLE" <dbms privilege target>

<remove role privilege> ::= 
  "REMOVE ROLE" <dbms privilege target>

<show role privilege> ::= 
  "SHOW ROLE" <dbms privilege target>

<role management privilege> ::= 
  "ROLE MANAGEMENT" <dbms privilege target>

<privilege management privilege group> ::= 
    <assign privilege privilege>
  | <remove privilege privilege>
  | <show privilege privilege>
  | <privilege management privilege>

<assign privilege privilege> ::= 
  "ASSIGN PRIVILEGE" <dbms privilege target>

<remove privilege privilege> ::= 
  "REMOVE PRIVILEGE" <dbms privilege target>

<show privilege privilege> ::= 
  "SHOW PRIVILEGE" <dbms privilege target>

<privilege management privilege> ::= 
  "PRIVILEGE MANAGEMENT" <dbms privilege target>

<alias management privilege group> ::= 
    <create alias privilege>
  | <alter alias privilege>
  | <drop alias privilege>
  | <show alias privilege>
  | <alias management privilege>

<create alias privilege> ::= 
  "CREATE ALIAS" <dbms privilege target>

<alter alias privilege> ::= 
  "ALTER ALIAS" <dbms privilege target>

<drop alias privilege> ::= 
  "DROP ALIAS" <dbms privilege target>

<show alias privilege> ::= 
  "SHOW ALIAS" <dbms privilege target>

<alias management privilege> ::= 
  "ALIAS MANAGEMENT" <dbms privilege target>

<database management privilege group> ::= 
    <create database privilege>
  | <alter database on dbms privilege>
  | <set database access on dbms privilege>
  | <set database default language on dbms privilege>
  | <drop database privilege>
  | <database management privilege>

<create database privilege> ::= 
  "CREATE" [ "COMPOSITE" ] "DATABASE" <dbms privilege target>

<alter database on dbms privilege> ::= 
  "ALTER" [ "COMPOSITE" ] "DATABASE" <dbms privilege target>

<set database access on dbms privilege> ::= 
  "SET DATABASE ACCESS" <dbms privilege target>

<set database default language on dbms privilege> ::= 
  "SET DATABASE DEFAULT LANGUAGE" <dbms privilege target>

<drop database privilege> ::= 
  "DROP" [ "COMPOSITE" ] "DATABASE" <dbms privilege target>

<database management privilege> ::= 
  [ "COMPOSITE" ] "DATABASE MANAGEMENT" <dbms privilege target>

<server management privilege group> ::= 
    <show server privilege>
  | <server management privilege>

<show server privilege> ::= 
  "SHOW" <server keywords> <dbms privilege target>

<server management privilege> ::= 
  "SERVER MANAGEMENT" <dbms privilege target>

<load privilege> ::= 
    <load cidr privilege>
  | <load all data privilege>

<load cidr privilege> ::= 
  "LOAD ON CIDR" <character string value specification>

<load all data privilege> ::= 
  "LOAD ON ALL DATA"

<qualified write graph privilege target> ::= 
  <graph privilege target> [ <write graph element privilege target> ]

<qualified read graph privilege target> ::= 
  <graph privilege target> [ <read graph element privilege target> ]

<graph privilege target> ::= 
    <home graph target>
  | <named graph privilege target>

<database privilege target> ::= 
    <home database target>
  | <named database privilege target>

<dbms privilege target> ::= 
  "ON DBMS"

<home graph target> ::= 
  "ON HOME GRAPH"

<home database target> ::= 
  "ON" <home database keyword>

<named graph privilege target> ::= 
  "ON" { "GRAPH" | "GRAPHS" } { <asterisk> | <graph specification list> }

<named database privilege target> ::= 
  "ON" { "DATABASE" | "DATABASES" } { <asterisk> | <alias or database specification list> }

<write graph element privilege target> ::= 
    <targeted elements>
  | <targeted nodes>
  | <targeted relationships>

<read graph element privilege target> ::= 
    <targeted elements>
  | <targeted nodes>
  | <targeted relationships>
  | "FOR" <targeted node pattern>

<targeted elements> ::= 
  <element keywords> <target labels>

<targeted nodes> ::= 
  <node keywords> <target labels>

<targeted relationships> ::= 
  <relationship keywords> <target labels>

<label privilege target> ::= 
  "LABEL" <target labels>

<target labels> ::= 
    <asterisk>
  | <label name list>

<user privilege target> ::= 
  <left paren> { <asterisk> | <user name specification list> } <right paren>

<procedure privilege target> ::= 
  <identifier glob list>

<function privilege target> ::= 
  <identifier glob list>

<setting privilege target> ::= 
  <identifier glob list>

<property privilege target> ::= 
    <all property privilege target>
  | <named property privilege target>

<all property privilege target> ::= 
  <left brace> <asterisk> <right brace>

<named property privilege target> ::= 
  <targeted property names specification>

<identifier glob list> ::= 
  <identifier glob> [ { <comma> <identifier glob> }... ]

<identifier glob> ::= 
    <delimited identifier> [ <identifier glob recursion> ]
  | <identifier glob recursion>

<identifier glob recursion> ::= 
  <identifier glob part> [ <identifier glob recursion> ]

<identifier glob part> ::= 
    <period> [ <delimited identifier> ]
  | <question mark>
  | <asterisk>
  | <regular identifier>

<use graph clause> ::= 
  "USE" <graph expression>

<graph expression> ::= 
    <left paren> <graph expression> <right paren>
  | <graph reference>
  | <function invocation>

<graph pattern binding table> ::= 
  <graph pattern>

<where clause> ::= 
  "WHERE" <search condition>

<set quantifier> ::= 
    "ALL"
  | "DISTINCT"

<graph pattern> ::= 
  [ <match mode> ] <path pattern list> [ <hints> ] [ <graph pattern where and search clause> ]

<hints> ::= 
  <hint> [ <hints> ]

<hint> ::= 
  "USING" <hint specification>

<hint specification> ::= 
    <index hint specification>
  | "JOIN ON" <binding variable reference list>
  | "SCAN" <binding variable> <label or rel type>

<index hint specification> ::= 
  [ <index type> ] "INDEX" [ "SEEK" ] <binding variable> <label or rel type> <left paren> <property name list> <right paren>

<index type> ::= 
    "TEXT"
  | "RANGE"
  | "POINT"

<label or rel type> ::= 
  <colon> <label name>

<graph pattern where and search clause> ::= 
    <graph pattern where clause> [ <search clause> ]
  | <search clause> [ <graph pattern where clause> ]

<match mode> ::= 
    <repeatable elements match mode>
  | <different edges match mode>

<repeatable elements match mode> ::= 
  "REPEATABLE" <element bindings or elements>

<different edges match mode> ::= 
  "DIFFERENT" <edge bindings or edges>

<element bindings or elements> ::= 
    "ELEMENT" [ "BINDINGS" ]
  | "ELEMENTS"

<edge bindings or edges> ::= 
    "RELATIONSHIP" [ "BINDINGS" ]
  | "RELATIONSHIPS"

<path pattern list> ::= 
  <path pattern> [ { <comma> <path pattern> }... ]

<graph pattern where clause> ::= 
  <where clause>

<search clause> ::= 
  "SEARCH" <binding variable reference> "IN" <left paren> <index specification clause> <for clause> [ <where clause> ] [ <offset clause> ] <limit clause> <right paren> [ <score clause> ]

<index specification clause> ::= 
  { "VECTOR" | "FULLTEXT" } "INDEX" <index name specification>

<for clause> ::= 
  "FOR" <value expression> [ "WITH ANALYZER" <value expression> ]

<score clause> ::= 
  "SCORE AS" <binding variable>

<path pattern> ::= 
  [ <path variable declaration> ] [ <path pattern prefix> ] <path pattern expression>

<path variable declaration> ::= 
  <binding variable> <equals operator>

<path pattern prefix> ::= 
    <path mode prefix>
  | <path search prefix>

<path mode prefix> ::= 
  <path mode> [ <path keywords> ]

<path mode> ::= 
    "WALK"
  | "TRAIL"
  | "ACYCLIC"

<path search prefix> ::= 
    <all path search>
  | <any path search>
  | <shortest path search>

<all path search> ::= 
  "ALL" [ <path mode> ] [ <path keywords> ]

<any path search> ::= 
  "ANY" [ <number of paths> ] [ <path mode> ] [ <path keywords> ]

<shortest path search> ::= 
    <all shortest path search>
  | <any shortest path search>
  | <counted shortest path search>
  | <counted shortest group search>

<all shortest path search> ::= 
  "ALL SHORTEST" [ <path mode> ] [ <path keywords> ]

<any shortest path search> ::= 
  "ANY SHORTEST" [ <path mode> ] [ <path keywords> ]

<counted shortest path search> ::= 
  "SHORTEST" <number of paths> [ <path mode> ] [ <path keywords> ]

<counted shortest group search> ::= 
  "SHORTEST" [ <number of groups> ] [ <path mode> ] [ <path keywords> ] { "GROUP" | "GROUPS" }

<number of paths> ::= 
  <unsigned decimal integer specification>

<number of groups> ::= 
  <unsigned decimal integer specification>

<simple path pattern> ::= 
  <node pattern> { <relationship pattern> <node pattern> }...

<path pattern expression> ::= 
    <path term>
  | <legacy shortest path pattern>

<legacy shortest path pattern> ::= 
  { "SHORTESTPATH" | "ALLSHORTESTPATHS" } <left paren> <node pattern> <relationship pattern> <node pattern> <right paren>

<path term> ::= 
    <path factor>
  | <path term> <path factor>

<path factor> ::= 
    <path primary>
  | <quantified path primary>

<quantified path primary> ::= 
  <path primary> <graph pattern quantifier>

<path primary> ::= 
    <element pattern>
  | <parenthesized path pattern expression>

<parenthesized path pattern expression> ::= 
  <left paren> [ <subpath variable declaration> ] <path pattern expression> [ <parenthesized path pattern where clause> ] <right paren>

<subpath variable declaration> ::= 
  <binding variable> <equals operator>

<parenthesized path pattern where clause> ::= 
  "WHERE" <value expression>

<element pattern> ::= 
    <node pattern>
  | <relationship pattern>

<node pattern> ::= 
  <left paren> [ <node pattern filler> ] <right paren>

<node pattern filler> ::= 
    <binding variable> [ <is node label expression> ] [ <element pattern predicate> ]
  | <is node label expression> [ <element pattern predicate> ]
  | <element pattern predicate>

<element pattern predicate> ::= 
    <element pattern where clause>
  | <element property specification>
  | <general parameter reference>

<element pattern where clause> ::= 
  "WHERE" <value expression>

<element property specification> ::= 
  <left brace> <property key value pair list> <right brace>

<property key value pair list> ::= 
  <property key value pair> [ { <comma> <property key value pair> }... ]

<property key value pair> ::= 
  <property name> <colon> <value expression>

<relationship pattern> ::= 
  <full relationship pattern>

<full relationship pattern> ::= 
    <full relationship pointing left>
  | <full relationship pointing right>
  | <full relationship left or right>
  | <full relationship any direction>

<full relationship pointing left> ::= 
  <left arrowhead> <arrow line> [ <left bracket> [ <relationship pattern filler> ] <right bracket> ] <arrow line>

<full relationship pointing right> ::= 
  <arrow line> [ <left bracket> [ <relationship pattern filler> ] <right bracket> ] <arrow line> <right arrowhead>

<full relationship left or right> ::= 
  <left arrowhead> <arrow line> [ <left bracket> [ <relationship pattern filler> ] <right bracket> ] <arrow line> <right arrowhead>

<full relationship any direction> ::= 
  <arrow line> [ <left bracket> [ <relationship pattern filler> ] <right bracket> ] <arrow line>

<left arrowhead> ::= 
  <left angle bracket>

<arrow line> ::= 
  <minus sign>

<right arrowhead> ::= 
  <right angle bracket>

<relationship pattern filler> ::= 
    <binding variable> [ <is relationship label expression> ] [ <path length> ] [ <element pattern predicate> ]
  | <is relationship label expression> [ <path length> ] [ <element pattern predicate> ]
  | <path length> [ <element pattern predicate> ]
  | <element pattern predicate>

<path length> ::= 
  <asterisk> [ <lower and upper bound path length> | <fixed path length> ]

<lower and upper bound path length> ::= 
  [ <lower bound path length> ] <double period> [ <upper bound path length> ]

<graph pattern quantifier> ::= 
    <asterisk>
  | <plus sign>
  | <fixed quantifier>
  | <general quantifier>

<fixed quantifier> ::= 
  <left brace> <unsigned decimal integer> <right brace>

<general quantifier> ::= 
  <left brace> [ <lower bound path length> ] <comma> [ <upper bound path length> ] <right brace>

<lower bound path length> ::= 
  <unsigned decimal integer>

<upper bound path length> ::= 
  <unsigned decimal integer>

<fixed path length> ::= 
  <unsigned decimal integer>

<create graph pattern> ::= 
  <create path pattern list>

<create path pattern list> ::= 
  <create path pattern> [ { <comma> <create path pattern> }... ]

<create path pattern> ::= 
  [ <path variable declaration> ] <create node pattern> [ { <create relationship pattern> <create node pattern> }... ]

<create node pattern> ::= 
  <left paren> [ <create node pattern filler> ] <right paren>

<create relationship pattern> ::= 
    <create relationship pointing left>
  | <create relationship pointing right>

<create relationship pointing left> ::= 
  <left arrowhead> <arrow line> <left bracket> <create relationship pattern filler> <right bracket> <arrow line>

<create relationship pointing right> ::= 
  <arrow line> <left bracket> <create relationship pattern filler> <right bracket> <arrow line> <right arrowhead>

<create node pattern filler> ::= 
    <binding variable> [ <create node label and property set specification> ]
  | [ <binding variable> ] <create node label and property set specification>

<create relationship pattern filler> ::= 
  [ <binding variable> ] <create relationship label and property set specification>

<create node label and property set specification> ::= 
    <create node label set specification> [ <create element property specification> ]
  | [ <create node label set specification> ] <create element property specification>

<create relationship label and property set specification> ::= 
  <create relationship label specification> [ <create element property specification> ]

<create node label set specification> ::= 
  <node label set specification for create and merge>

<create relationship label specification> ::= 
  <relationship label specification for create and merge>

<create element property specification> ::= 
    <element property specification>
  | <general parameter reference>

<insert graph pattern> ::= 
  <insert path pattern list>

<insert path pattern list> ::= 
  <insert path pattern> [ { <comma> <insert path pattern> }... ]

<insert path pattern> ::= 
  <insert node pattern> [ { <insert relationship pattern> <insert node pattern> }... ]

<insert node pattern> ::= 
  <left paren> [ <insert node pattern filler> ] <right paren>

<insert relationship pattern> ::= 
    <insert relationship pointing left>
  | <insert relationship pointing right>

<insert relationship pointing left> ::= 
  <left arrowhead> <arrow line> <left bracket> <insert relationship pattern filler> <right bracket> <arrow line>

<insert relationship pointing right> ::= 
  <arrow line> <left bracket> <insert relationship pattern filler> <right bracket> <arrow line> <right arrowhead>

<insert node pattern filler> ::= 
    <binding variable> [ <insert node label and property set specification> ]
  | [ <binding variable> ] <insert node label and property set specification>

<insert relationship pattern filler> ::= 
  [ <binding variable> ] <insert relationship label and property set specification>

<insert node label and property set specification> ::= 
    <insert node label set specification> [ <insert element property specification> ]
  | [ <insert node label set specification> ] <insert element property specification>

<insert relationship label and property set specification> ::= 
  <insert relationship label specification> [ <insert element property specification> ]

<insert node label set specification> ::= 
  <node label set specification for insert>

<insert relationship label specification> ::= 
  <relationship label specification for insert>

<insert element property specification> ::= 
  <element property specification>

<merge graph pattern> ::= 
  <merge path pattern>

<merge path pattern> ::= 
  [ <path variable declaration> ] <merge node pattern> [ { <merge relationship pattern> <merge node pattern> }... ]

<merge node pattern> ::= 
  <left paren> [ <merge node pattern filler> ] <right paren>

<merge relationship pattern> ::= 
    <merge relationship pointing left>
  | <merge relationship pointing right>

<merge relationship pointing left> ::= 
  <left arrowhead> <arrow line> <left bracket> <merge relationship pattern filler> <right bracket> <arrow line>

<merge relationship pointing right> ::= 
  <arrow line> <left bracket> <merge relationship pattern filler> <right bracket> <arrow line> <right arrowhead>

<merge node pattern filler> ::= 
    <binding variable> [ <merge node label and property set specification> ]
  | [ <binding variable> ] <merge node label and property set specification>

<merge relationship pattern filler> ::= 
  [ <binding variable> ] <merge relationship label and property set specification>

<merge node label and property set specification> ::= 
    <merge node label set specification> [ <merge element property specification> ]
  | [ <merge node label set specification> ] <merge element property specification>

<merge relationship label and property set specification> ::= 
  <merge relationship label specification> [ <merge element property specification> ]

<merge node label set specification> ::= 
  <node label set specification for create and merge>

<merge relationship label specification> ::= 
  <relationship label specification for create and merge>

<merge element property specification> ::= 
  <element property specification>

<command element pattern> ::= 
    <command node pattern>
  | <command relationship pattern>

<command node pattern> ::= 
  <left paren> <binding variable> <colon> <label name> <right paren>

<command relationship pattern> ::= 
  <left paren> <right paren> { <command relationship body pointing left> | <command relationship body pointing right> | <command relationship body pointing both> | <command relationship body> } <left paren> <right paren>

<command relationship body pointing left> ::= 
  <left arrowhead> <command relationship body>

<command relationship body pointing right> ::= 
  <command relationship body> <right arrowhead>

<command relationship body pointing both> ::= 
  <left arrowhead> <command relationship body> <right arrowhead>

<command relationship body> ::= 
  <arrow line> <left bracket> <binding variable> <colon> <label name> <right bracket> <arrow line>

<lookup index node pattern> ::= 
  <left paren> <binding variable> <right paren>

<lookup index relationship pattern> ::= 
  <left paren> <right paren> { <lookup index relationship body pointing left> | <lookup index relationship body pointing right> | <lookup index relationship body pointing both> | <lookup index relationship body> } <left paren> <right paren>

<lookup index relationship body pointing left> ::= 
  <left arrowhead> <lookup index relationship body>

<lookup index relationship body pointing right> ::= 
  <lookup index relationship body> <right arrowhead>

<lookup index relationship body pointing both> ::= 
  <left arrowhead> <lookup index relationship body> <right arrowhead>

<lookup index relationship body> ::= 
  <arrow line> <left bracket> <binding variable> <right bracket> <arrow line>

<multi-entity-token index element pattern> ::= 
    <multi-label index node pattern>
  | <multi-reltype index relationship pattern>

<multi-label index node pattern> ::= 
  <left paren> <binding variable> <colon> <multi-entity-token index label expression> <right paren>

<multi-reltype index relationship pattern> ::= 
  <left paren> <right paren> { <multi-reltype index relationship body pointing left> | <multi-reltype index relationship body pointing right> | <multi-reltype index relationship body pointing both> | <multi-reltype index relationship body> } <left paren> <right paren>

<multi-reltype index relationship body pointing left> ::= 
  <left arrowhead> <multi-reltype index relationship body>

<multi-reltype index relationship body pointing right> ::= 
  <multi-reltype index relationship body> <right arrowhead>

<multi-reltype index relationship body pointing both> ::= 
  <left arrowhead> <multi-reltype index relationship body> <right arrowhead>

<multi-reltype index relationship body> ::= 
  <arrow line> <left bracket> <binding variable> <colon> <multi-entity-token index label expression> <right bracket> <arrow line>

<multi-entity-token index label expression> ::= 
  <disjunctive label specification>

<targeted node pattern> ::= 
  <left paren> [ <targeted node pattern filler> ] <right paren>

<targeted node pattern filler> ::= 
    <binding variable> [ <targeted node label expression> ] [ <element pattern predicate> ]
  | <targeted node label expression> [ <element pattern predicate> ]
  | <element pattern predicate>

<targeted node label expression> ::= 
  <colon> <disjunctive label specification>

<targeted property names specification> ::= 
  <left brace> <property name list> <right brace>

<is node label expression> ::= 
    <colon> <node label expression legacy>
  | <is label expression>

<is relationship label expression> ::= 
    <colon> <relationship label expression legacy>
  | <is label expression>

<is label expression> ::= 
  { <colon> | "IS" } <label expression>

<node label expression legacy> ::= 
  <label name> { <colon> <label name> }...

<relationship label expression legacy> ::= 
  <label name> { <vertical bar> <colon> <label name> }...

<wildcard label> ::= 
  <percent>

<label expression> ::= 
    <label term>
  | <label expression> <vertical bar> <label term>

<label term> ::= 
    <label factor>
  | <label term> <ampersand> <label factor>

<label factor> ::= 
    <label primary>
  | <label negation>

<label negation> ::= 
  <exclamation mark> <label primary>

<label primary> ::= 
    <label name>
  | <parenthesized label expression>
  | <wildcard label>
  | <dynamic label expression>

<parenthesized label expression> ::= 
  <left paren> <label expression> <right paren>

<dynamic label expression> ::= 
  <dollar sign> [ <dynamic label expression quantifier> ] <left paren> <value expression> <right paren>

<dynamic label expression quantifier> ::= 
    "ALL"
  | "ANY"

<node label set specification for create and merge> ::= 
    <dynamic node label set specification with ampersand>
  | <dynamic node label set specification with colon>
  | <dynamic node label set single specification>

<node label set specification for insert> ::= 
  <static node label set specification with ampersand>

<node label set specification for set and remove> ::= 
    <dynamic node label set specification with colon>
  | <dynamic node label set single specification>

<static node label set specification with ampersand> ::= 
  { "IS" | <colon> } <label name> [ { <ampersand> <label name> }... ]

<dynamic node label set specification with ampersand> ::= 
  { "IS" | <colon> } <dynamic label specification> { <ampersand> <dynamic label specification> }...

<dynamic node label set specification with colon> ::= 
  <colon> <dynamic label specification> { <colon> <dynamic label specification> }...

<dynamic node label set single specification> ::= 
  { "IS" | <colon> } <dynamic label specification>

<relationship label specification for create and merge> ::= 
  <dynamic relationship label specification>

<relationship label specification for insert> ::= 
  <static relationship label specification>

<static relationship label specification> ::= 
  { <colon> | "IS" } <label name>

<dynamic relationship label specification> ::= 
  { <colon> | "IS" } <dynamic label specification>

<dynamic label specification> ::= 
    <label name>
  | <dynamic label specification expression>

<dynamic label specification expression> ::= 
  <dollar sign> <left paren> <value expression> <right paren>

<disjunctive label specification> ::= 
  <label name> [ { <vertical bar> <label name> }... ]

<alias reference> ::= 
    [ <regular catalog object parent reference> ] <regular alias name>
  | <alias name>

<database reference> ::= 
    [ <regular catalog object parent reference> ] <regular database name>
  | <database name>

<alias or database reference> ::= 
    <alias reference>
  | <database reference>

<graph reference> ::= 
    [ <regular catalog object parent reference> ] <regular graph name>
  | <graph name>

<procedure reference> ::= 
  [ <catalog object parent reference> ] <procedure name>

<function reference> ::= 
  [ <catalog object parent reference> ] <function name>

<catalog object parent reference> ::= 
  { <object name> <period> }...

<regular catalog object parent reference> ::= 
  { <regular object name> <period> }...

<value expression> ::= 
  <boolean value expression>

<search condition> ::= 
  <boolean value expression>

<boolean value expression> ::= 
    <boolean term xor>
  | <boolean value expression> "OR" <boolean term xor>

<boolean term xor> ::= 
    <boolean term>
  | <boolean term xor> "XOR" <boolean term>

<boolean term> ::= 
    <boolean factor>
  | <boolean term> "AND" <boolean factor>

<boolean factor> ::= 
  [ { "NOT" }... ] <boolean primary>

<boolean primary> ::= 
    <pattern expression>
  | <predicate>

<predicate> ::= 
    <property exists predicate>
  | <comparison predicate>

<comparison predicate> ::= 
  <simple comparison predicand> [ <simple comparison predicate part 2>... ]

<simple comparison predicand> ::= 
  <advanced comparison predicand> [ <advanced comparison predicate part 2> ]

<simple comparison predicate part 2> ::= 
  <simple comp op> <advanced comparison predicand>

<simple comp op> ::= 
    <equals operator>
  | <not equals operator>
  | <less than operator>
  | <greater than operator>
  | <less than or equals operator>
  | <greater than or equals operator>

<advanced comparison predicand> ::= 
  <arithmetic value expression>

<advanced comparison predicate part 2> ::= 
    <advanced comp op> <advanced comparison predicand>
  | <value type predicate part 2>
  | <null predicate part 2>
  | <normalized predicate part 2>
  | <is labeled predicate part 2>

<advanced comp op> ::= 
    <contains operator>
  | <in operator>
  | <regex equals operator>
  | <start with operator>
  | <end with operator>

<null predicate part 2> ::= 
  "IS" [ "NOT" ] "NULL"

<normalized predicate part 2> ::= 
  "IS" [ "NOT" ] [ <normal form> ] "NORMALIZED"

<normal form> ::= 
    "NFC"
  | "NFD"
  | "NFKC"
  | "NFKD"

<value type predicate part 2> ::= 
  { "IS" [ "NOT" ] { <double colon> | "TYPED" } | <double colon> } <value type>

<start with operator> ::= 
  "STARTS WITH"

<end with operator> ::= 
  "ENDS WITH"

<contains operator> ::= 
  "CONTAINS"

<in operator> ::= 
  "IN"

<is labeled predicate part 2> ::= 
    <is label expression>
  | "IS" [ "NOT" ] "LABELED" <label expression>
  | "IS NOT" <label expression>

<property exists predicate> ::= 
  "PROPERTY_EXISTS" <left paren> <binding variable reference> <comma> <property name> <right paren>

<arithmetic value expression> ::= 
    <arithmetic term>
  | <arithmetic value expression> <plus sign> <arithmetic term>
  | <arithmetic value expression> <minus sign> <arithmetic term>
  | <arithmetic value expression> <concatenation operator> <arithmetic term>

<arithmetic term> ::= 
    <arithmetic factor>
  | <arithmetic term> <asterisk> <arithmetic factor>
  | <arithmetic term> <solidus> <arithmetic factor>
  | <arithmetic term> <percent> <arithmetic factor>

<arithmetic factor> ::= 
    <arithmetic unary>
  | <arithmetic factor> <circumflex> <arithmetic unary>

<arithmetic unary> ::= 
  [ <sign> ] <postfix expression>

<postfix expression> ::= 
    <value expression primary>
  | <postfix expression> <postfix operator>

<postfix operator> ::= 
    <static property reference>
  | <dynamic element reference>
  | <slicing>

<static property reference> ::= 
  <period> <property name>

<dynamic element reference> ::= 
  <left bracket> <value expression> <right bracket>

<slicing> ::= 
  <left bracket> [ <slicing from> ] <double period> [ <slicing to> ] <right bracket>

<slicing from> ::= 
  <value expression>

<slicing to> ::= 
  <value expression>

<value expression primary> ::= 
    <parenthesized value expression>
  | <non-parenthesized value expression primary>

<parenthesized value expression> ::= 
  <left paren> <value expression> <right paren>

<non-parenthesized value expression primary> ::= 
    <general parameter reference>
  | <case expression>
  | <count star>
  | <exists expression>
  | <count expression>
  | <collect expression>
  | <map projection>
  | <list comprehension>
  | <pattern comprehension>
  | <reduce expression>
  | <all reduce expression>
  | <quantifier expression>
  | <trim function>
  | <vector value function>
  | <shortest path expression>
  | <function invocation>
  | <value specification>
  | <binding variable reference>

<case expression> ::= 
    <simple case>
  | <search case>

<simple case> ::= 
  "CASE" <case operand> <simple when clause>... [ <else clause> ] "END"

<search case> ::= 
  "CASE" <searched when clause>... [ <else clause> ] "END"

<simple when clause> ::= 
  "WHEN" <when operand list> "THEN" <value expression>

<searched when clause> ::= 
  "WHEN" <search condition> "THEN" <value expression>

<case operand> ::= 
  <value expression>

<when operand list> ::= 
  <when operand> [ { <comma> <when operand> }... ]

<when operand> ::= 
    <simple comparison predicate part 2>
  | <advanced comparison predicate part 2>
  | <value expression>

<else clause> ::= 
  "ELSE" <value expression>

<exists expression> ::= 
  "EXISTS" <left brace> <subquery expression argument> <right brace>

<count expression> ::= 
  "COUNT" <left brace> <subquery expression argument> <right brace>

<collect expression> ::= 
  "COLLECT" <nested procedure specification>

<subquery expression argument> ::= 
    <procedure specification>
  | <graph pattern>

<map projection> ::= 
  <binding variable> <left brace> [ <map projection element list> ] <right brace>

<map projection element list> ::= 
  <map projection element> [ { <comma> <map projection element> }... ]

<map projection element> ::= 
    <literal map field>
  | <field selector>
  | <variable selector>
  | <all fields selector>

<list comprehension> ::= 
  <left bracket> <list element source> [ <list element filter and projection> ] <right bracket>

<list element filter and projection> ::= 
    [ <list element filter> ] <list element projection>
  | <list element filter>

<list element source> ::= 
  <binding variable> "IN" <value expression>

<list element filter> ::= 
  "WHERE" <value expression>

<list element projection> ::= 
  <vertical bar> <value expression>

<pattern comprehension> ::= 
  <left bracket> <pattern source> <pattern filter and projection> <right bracket>

<pattern source> ::= 
  [ <binding variable> <equals operator> ] <simple path pattern>

<pattern filter and projection> ::= 
  [ <pattern filter> ] <pattern projection>

<pattern filter> ::= 
  "WHERE" <value expression>

<pattern projection> ::= 
  <vertical bar> <value expression>

<reduce expression> ::= 
  "REDUCE" <left paren> <reduce accumulator initialization> <comma> <reduce element source> <reduce step> <right paren>

<reduce accumulator initialization> ::= 
  <binding variable> <equals operator> <value expression>

<reduce element source> ::= 
  <binding variable> "IN" <value expression>

<reduce step> ::= 
  <vertical bar> <value expression>

<all reduce expression> ::= 
  "ALLREDUCE" <left paren> <all reduce accumulator initialization> <comma> <all reduce element source> <all reduce step> <comma> <all reduce predicate> <right paren>

<all reduce accumulator initialization> ::= 
  <binding variable> <equals operator> <value expression>

<all reduce element source> ::= 
  <binding variable> "IN" <value expression>

<all reduce step> ::= 
  <vertical bar> <value expression>

<all reduce predicate> ::= 
  <boolean value expression>

<literal map field> ::= 
  <property name> <colon> <value expression>

<field selector> ::= 
  <static property reference>

<variable selector> ::= 
  <binding variable>

<all fields selector> ::= 
  <period> <asterisk>

<quantifier expression> ::= 
  <quantifier> <left paren> <quantifier element source> <quantifier element predicate> <right paren>

<quantifier> ::= 
    "ALL"
  | "ANY"
  | "SINGLE"
  | "NONE"

<quantifier element source> ::= 
  <binding variable> "IN" <value expression>

<quantifier element predicate> ::= 
  "WHERE" <value expression>

<trim function> ::= 
  <single-character trim function>

<single-character trim function> ::= 
  "TRIM" <left paren> <trim operands> <right paren>

<trim operands> ::= 
  [ [ <trim specification> ] [ <trim character string> ] "FROM" ] <trim source>

<trim source> ::= 
  <value expression>

<trim specification> ::= 
    "LEADING"
  | "TRAILING"
  | "BOTH"

<trim character string> ::= 
  <value expression>

<vector value function> ::= 
  "VECTOR" <left paren> <vector coordinate values> <comma> <dimension> <comma> <coordinate type> <right paren>

<vector coordinate values> ::= 
  <value expression>

<function invocation> ::= 
  <function reference> <left paren> [ <set quantifier> ] [ <function argument list> ] <right paren>

<function argument list> ::= 
  <function argument> [ { <comma> <function argument> }... ]

<function argument> ::= 
  <value expression>

<count star> ::= 
  "COUNT" <left paren> <asterisk> <right paren>

<pattern expression> ::= 
  <simple path pattern>

<shortest path expression> ::= 
  <legacy shortest path pattern>

<value specification> ::= 
    <literal>
  | <general parameter reference>
  | <list value constructor>
  | <map value constructor>

<list value constructor> ::= 
  <left bracket> [ <list element list> ] <right bracket>

<list element list> ::= 
  <value expression> [ { <comma> <value expression> }... ]

<character string list literal> ::= 
  <left bracket> [ <character string list element list> ] <right bracket>

<character string list element list> ::= 
  <character string literal> [ { <comma> <character string literal> }... ]

<map value constructor> ::= 
  <record value constructor>

<record value constructor> ::= 
  <fields specification>

<fields specification> ::= 
  <left brace> [ <field list> ] <right brace>

<field list> ::= 
  <field> [ { <comma> <field> }... ]

<field> ::= 
  <field name> <colon> <value expression>

<map value or parameter specification> ::= 
    <map value constructor>
  | <general parameter reference>

<unsigned decimal integer specification> ::= 
    <unsigned decimal integer>
  | <general parameter reference>

<password value specification> ::= 
  <character string value specification>

<character string value specification> ::= 
    <character string literal>
  | <general parameter reference>

<character string or string list value specification> ::= 
    <character string literal>
  | <character string list literal>
  | <general parameter reference>

<character string list element list specification> ::= 
    <character string list element list>
  | <general parameter reference>

<character string list element list or expression> ::= 
    <character string list element list>
  | <value expression>

<value type> ::= 
    <value type primary>
  | <undelimited closed dynamic union type>

<value type primary> ::= 
    <predefined type>
  | <constructed value type>
  | <delimited dynamic union type>

<typed> ::= 
    <double colon>
  | "TYPED"

<predefined type> ::= 
    <boolean type>
  | <character string type>
  | <numeric type>
  | <temporal type>
  | <point type>
  | <vector type>
  | <uuid type>
  | <reference value type>
  | <immaterial value type>

<boolean type> ::= 
  { "BOOL" | "BOOLEAN" } [ <not null> ]

<character string type> ::= 
    "STRING" [ <not null> ]
  | "VARCHAR" [ <not null> ]

<numeric type> ::= 
    <exact numeric type>
  | <approximate numeric type>

<exact numeric type> ::= 
  <binary exact numeric type>

<binary exact numeric type> ::= 
  <signed binary exact numeric type>

<signed binary exact numeric type> ::= 
    "INT" [ <not null> ]
  | [ "SIGNED" ] "INTEGER" [ <not null> ]

<approximate numeric type> ::= 
  "FLOAT" [ <not null> ]

<temporal type> ::= 
    <temporal instant type>
  | <temporal duration type>

<temporal instant type> ::= 
    <datetime type>
  | <localdatetime type>
  | <date type>
  | <time type>
  | <localtime type>

<datetime type> ::= 
  "ZONED DATETIME" [ <not null> ]

<localdatetime type> ::= 
  "LOCAL DATETIME" [ <not null> ]

<date type> ::= 
  "DATE" [ <not null> ]

<time type> ::= 
  "ZONED TIME" [ <not null> ]

<localtime type> ::= 
  "LOCAL TIME" [ <not null> ]

<temporal duration type> ::= 
  "DURATION" [ <not null> ]

<point type> ::= 
  "POINT" [ <not null> ]

<vector type> ::= 
    "VECTOR" <left paren> <dimension> <comma> <coordinate type> <right paren> [ <not null> ]
  | "VECTOR" [ <left angle bracket> <coordinate type> <right angle bracket> ] [ <left paren> <dimension> <right paren> ] [ <not null> ]

<dimension> ::= 
  <unsigned decimal integer>

<coordinate type> ::= 
    <numeric type>
  | <vector-only numeric coordinate type>

<vector-only numeric coordinate type> ::= 
  { "FLOAT64" | "FLOAT32" | "INTEGER64" | "INT64" | "INTEGER32" | "INT32" | "INTEGER16" | "INT16" | "INTEGER8" | "INT8" } [ <not null> ]

<uuid type> ::= 
  "UUID" [ <not null> ]

<reference value type> ::= 
    <node reference value type>
  | <edge reference value type>

<node reference value type> ::= 
  <open node reference value type>

<open node reference value type> ::= 
  [ "ANY" ] <node synonym> [ <not null> ]

<edge reference value type> ::= 
  <open edge reference value type>

<open edge reference value type> ::= 
  [ "ANY" ] <edge synonym> [ <not null> ]

<immaterial value type> ::= 
    <null type>
  | <empty type>

<null type> ::= 
  "NULL"

<constructed value type> ::= 
    <path value type>
  | <list value type>
  | <map type>

<path value type> ::= 
  "PATH" [ <not null> ]

<list value type> ::= 
  { <list value type cypher-notation> | <list value type sql-notation> } [ <not null> ]

<list value type cypher-notation> ::= 
  <list value type name> <left angle bracket> <value type> <right angle bracket>

<list value type sql-notation> ::= 
    <basic list element type> <list value type name>
  | <list value type sql-notation> <list value type name>

<list value type name> ::= 
    "LIST"
  | "ARRAY"

<basic list element type> ::= 
    <predefined type>
  | <path value type>
  | <map type>
  | <delimited dynamic union type>

<map type> ::= 
  [ "ANY" ] "MAP" [ <not null> ]

<empty type> ::= 
    "NULL" <not null>
  | "NOTHING"

<delimited dynamic union type> ::= 
    <open dynamic union type>
  | <dynamic property value type>
  | <delimited closed dynamic union type>

<open dynamic union type> ::= 
  "ANY" [ "VALUE" ] [ <not null> ]

<dynamic property value type> ::= 
  [ "ANY" ] "PROPERTY VALUE" [ <not null> ]

<delimited closed dynamic union type> ::= 
  "ANY" [ "VALUE" ] <left angle bracket> <delimited component type list> <right angle bracket>

<delimited component type list> ::= 
  <delimited component type> [ { <vertical bar> <delimited component type> }... ]

<undelimited closed dynamic union type> ::= 
  <undelimited component type> { <vertical bar> <undelimited component type> }...

<delimited component type> ::= 
  <value type>

<undelimited component type> ::= 
  <value type primary>

<not null> ::= 
    "NOT NULL"
  | <exclamation mark>

<parameter name> ::= 
  <separated identifier>

<label name list> ::= 
  <label name> [ { <comma> <label name> }... ]

<label name> ::= 
  <identifier>

<property name list> ::= 
  <property name> [ { <comma> <property name> }... ]

<property name> ::= 
  <identifier>

<field name> ::= 
  <identifier>

<binding variable reference> ::= 
  <binding variable>

<binding variable> ::= 
  <identifier>

<binding variable reference list> ::= 
  <binding variable reference> [ { <comma> <binding variable reference> }... ]

<graph specification list> ::= 
  <graph name specification> [ { <comma> <graph name specification> }... ]

<graph name specification> ::= 
    <graph reference>
  | <general parameter reference>

<graph name> ::= 
  <identifier>

<regular graph name> ::= 
    <regular identifier>
  | <non-reserved word>

<procedure name> ::= 
  <identifier>

<function name> ::= 
  <identifier>

<alias name specification> ::= 
    <alias reference>
  | <general parameter reference>

<alias name> ::= 
  <identifier>

<regular alias name> ::= 
    <regular identifier>
  | <non-reserved word>

<alias target name specification> ::= 
    <alias or database reference>
  | <general parameter reference>

<constraint name specification> ::= 
    <constraint name>
  | <general parameter reference>

<constraint name> ::= 
  <identifier>

<database name specification> ::= 
    <database reference>
  | <general parameter reference>

<database name> ::= 
  <identifier>

<regular database name> ::= 
    <regular identifier>
  | <non-reserved word>

<alias or database specification list> ::= 
  <alias or database name specification> [ { <comma> <alias or database name specification> }... ]

<alias or database name specification> ::= 
    <alias or database reference>
  | <general parameter reference>

<index name specification> ::= 
    <index name>
  | <general parameter reference>

<index name> ::= 
  <identifier>

<role name specification list> ::= 
  <role name specification> [ { <comma> <role name specification> }... ]

<role name specification> ::= 
    <role name>
  | <general parameter reference>

<role name> ::= 
  <identifier>

<auth rule name specification list> ::= 
  <auth rule name specification> [ { <comma> <auth rule name specification> }... ]

<auth rule name specification> ::= 
    <auth rule name>
  | <general parameter reference>

<auth rule name> ::= 
  <identifier>

<server name specification> ::= 
    <server name>
  | <general parameter reference>

<server name> ::= 
  <identifier>

<user name specification list> ::= 
  <user name specification> [ { <comma> <user name specification> }... ]

<user name specification> ::= 
    <user name>
  | <general parameter reference>

<user name> ::= 
  <identifier>

<object name> ::= 
  <identifier>

<regular object name> ::= 
    <regular identifier>
  | <non-reserved word>

<literal> ::= 
    <signed numeric literal>
  | <general literal>

<general literal> ::= 
    <boolean literal>
  | <character string literal>
  | <interpolated character string literal>
  | <null literal>
  | <list literal>
  | <map literal>

<boolean literal> ::= 
    "TRUE"
  | "FALSE"

<null literal> ::= 
  "NULL"

<character string literal> ::= 
    <single quoted character sequence>
  | <double quoted character sequence>

<single quoted character sequence> ::= 
  <unbroken single quoted character sequence>

<double quoted character sequence> ::= 
  <unbroken double quoted character sequence>

<accent quoted character sequence> ::= 
  <unbroken accent quoted character sequence>

<unbroken single quoted character sequence> ::= 
  <quote> [ <single quoted character representation>... ] <quote>

<unbroken double quoted character sequence> ::= 
  <double quote> [ <double quoted character representation>... ] <double quote>

<unbroken accent quoted character sequence> ::= 
  <grave accent> [ <accent quoted character representation>... ] <grave accent>

<single quoted character representation> ::= 
    any character but: \, '
  | <double single quote>
  | <escaped character>

<double quoted character representation> ::= 
    any character but: \, "
  | <double double quote>
  | <escaped character>

<accent quoted character representation> ::= 
    any character but: \, `
  | <double grave accent>
  | <escaped character>

<double single quote> ::= 
  <quote> <quote>

<double double quote> ::= 
  <double quote> <double quote>

<double grave accent> ::= 
  <grave accent> <grave accent>

<escaped character> ::= 
    <escaped reverse solidus>
  | <escaped quote>
  | <escaped double quote>
  | <escaped grave accent>
  | <escaped tab>
  | <escaped backspace>
  | <escaped newline>
  | <escaped carriage return>
  | <escaped form feed>
  | <unicode escape value>

<escaped reverse solidus> ::= 
  <reverse solidus> <reverse solidus>

<escaped quote> ::= 
  <reverse solidus> <quote>

<escaped double quote> ::= 
  <reverse solidus> <double quote>

<escaped grave accent> ::= 
  <reverse solidus> <grave accent>

<escaped tab> ::= 
  <reverse solidus> "t"

<escaped backspace> ::= 
  <reverse solidus> "b"

<escaped newline> ::= 
  <reverse solidus> "n"

<escaped carriage return> ::= 
  <reverse solidus> "r"

<escaped form feed> ::= 
  <reverse solidus> "f"

<unicode escape value> ::= 
    <unicode 4 digit escape value>
  | <unicode 6 digit escape value>

<unicode 4 digit escape value> ::= 
  <reverse solidus> "u" <hex digit> <hex digit> <hex digit> <hex digit>

<unicode 6 digit escape value> ::= 
  <reverse solidus> "U" <hex digit> <hex digit> <hex digit> <hex digit> <hex digit> <hex digit>

<interpolated character string literal> ::= 
    <single quoted non-interpolated character string literal>
  | <double quoted non-interpolated character string literal>
  | <single quoted interpolated character string literal>
  | <double quoted interpolated character string literal>

<single quoted non-interpolated character string literal> ::= 
  <unbroken single quoted non-interpolated character sequence>

<double quoted non-interpolated character string literal> ::= 
  <unbroken double quoted non-interpolated character sequence>

<single quoted interpolated character string literal> ::= 
  <unbroken single quoted interpolated character sequence left> <value expression> [ { <unbroken single quoted interpolated character sequence middle> <value expression> }... ] <unbroken single quoted interpolated character sequence right>

<double quoted interpolated character string literal> ::= 
  <unbroken double quoted interpolated character sequence left> <value expression> [ { <unbroken double quoted interpolated character sequence middle> <value expression> }... ] <unbroken double quoted interpolated character sequence right>

<unbroken single quoted interpolated character sequence left> ::= 
  { "s" | "S" } <quote> push(') [ <single quoted interpolated character representation>... ] <left brace>

<unbroken double quoted interpolated character sequence left> ::= 
  { "s" | "S" } <double quote> push(") [ <double quoted interpolated character representation>... ] <left brace>

<unbroken single quoted interpolated character sequence right> ::= 
  check(') <right brace> [ <single quoted interpolated character representation>... ] <quote> pop()

<unbroken double quoted interpolated character sequence right> ::= 
  check(") <right brace> [ <double quoted interpolated character representation>... ] <double quote> pop()

<unbroken single quoted interpolated character sequence middle> ::= 
  check(') <right brace> [ <single quoted interpolated character representation>... ] <left brace>

<unbroken double quoted interpolated character sequence middle> ::= 
  check(") <right brace> [ <double quoted interpolated character representation>... ] <left brace>

<unbroken single quoted non-interpolated character sequence> ::= 
  { "s" | "S" } <quote> [ <single quoted interpolated character representation>... ] <quote>

<unbroken double quoted non-interpolated character sequence> ::= 
  { "s" | "S" } <double quote> [ <double quoted interpolated character representation>... ] <double quote>

<single quoted interpolated character representation> ::= 
    any character but: \, ', {, }
  | <double single quote>
  | <escaped character>
  | <escaped left brace>
  | <escaped right brace>

<double quoted interpolated character representation> ::= 
    any character but: \, ", {, }
  | <double double quote>
  | <escaped character>
  | <escaped left brace>
  | <escaped right brace>

<escaped left brace> ::= 
  <reverse solidus> <left brace>

<escaped right brace> ::= 
  <reverse solidus> <right brace>

<signed numeric literal> ::= 
    [ <minus sign> ] { <unsigned numeric literal> | "INF" | "INFINITY" }
  | "NAN"

<sign> ::= 
    <plus sign>
  | <minus sign>

<unsigned numeric literal> ::= 
    <exact numeric literal>
  | <approximate numeric literal>

<exact numeric literal> ::= 
  <unsigned integer>

<unsigned decimal in scientific notation> ::= 
  <mantissa> <exponent indicator> <exponent>

<exponent indicator> ::= 
    "E"
  | "e"

<mantissa> ::= 
    <unsigned decimal in common notation>
  | <unsigned decimal integer>

<exponent> ::= 
  <signed decimal integer>

<unsigned decimal in common notation> ::= 
    <unsigned decimal integer> <period> <unsigned decimal integer>
  | <period> <unsigned decimal integer>

<unsigned integer> ::= 
    <unsigned decimal integer>
  | <unsigned hexadecimal integer>
  | <unsigned octal integer>

<signed decimal integer> ::= 
  [ <sign> ] <unsigned decimal integer>

<unsigned decimal integer> ::= 
  <digit> [ { [ <underscore> ] <digit> }... ]

<unsigned hexadecimal integer> ::= 
  { "0x" | "0X" } { [ <underscore> ] <hex digit> }...

<unsigned octal integer> ::= 
  "0o" { [ <underscore> ] <octal digit> }...

<approximate numeric literal> ::= 
    <unsigned decimal in scientific notation> [ <approximate number suffix> ]
  | <unsigned decimal in common notation> [ <approximate number suffix> ]

<approximate number suffix> ::= 
    "F"
  | "D"
  | "f"
  | "d"

<list literal> ::= 
  <left bracket> [ <list element list literal> ] <right bracket>

<list element list literal> ::= 
  <literal> [ { <comma> <literal> }... ]

<map literal> ::= 
  <record literal>

<record literal> ::= 
  <fields literal>

<fields literal> ::= 
  <left brace> [ <field list literal> ] <right brace>

<field list literal> ::= 
  <field literal> [ { <comma> <field literal> }... ]

<field literal> ::= 
  <field name> <colon> <literal>

<edge synonym> ::= 
    "EDGE"
  | "RELATIONSHIP"

<node synonym> ::= 
    "NODE"
  | "VERTEX"

<home database keyword> ::= 
  "HOME DATABASE"

<alias keywords> ::= 
    "ALIAS"
  | "ALIASES"

<admin keywords> ::= 
    "ADMIN"
  | "ADMINISTRATOR"

<command keywords> ::= 
    "COMMAND"
  | "COMMANDS"

<constraint keywords> ::= 
    "CONSTRAINT"
  | "CONSTRAINTS"

<database keywords> ::= 
    "DATABASE"
  | "DATABASES"

<element keywords> ::= 
    "ELEMENT"
  | "ELEMENTS"

<function keywords> ::= 
    "FUNCTION"
  | "FUNCTIONS"

<index keywords> ::= 
    "INDEX"
  | "INDEXES"

<name keywords> ::= 
    "NAME"
  | "NAMES"

<node keywords> ::= 
    "NODE"
  | "NODES"

<label keywords> ::= 
    "LABEL"
  | "LABELS"

<password keywords> ::= 
    "PASSWORD"
  | "PASSWORDS"

<procedure keywords> ::= 
    "PROCEDURE"
  | "PROCEDURES"

<path keywords> ::= 
    "PATH"
  | "PATHS"

<primary keywords> ::= 
    "PRIMARY"
  | "PRIMARIES"

<relationship keywords> ::= 
    "RELATIONSHIP"
  | "RELATIONSHIPS"

<relationship singular keywords> ::= 
    "RELATIONSHIP"
  | "REL"

<replica keywords> ::= 
    "REPLICA"
  | "REPLICAS"

<role keywords> ::= 
    "ROLE"
  | "ROLES"

<privilege keywords> ::= 
    "PRIVILEGE"
  | "PRIVILEGES"

<secondary keywords> ::= 
    "SECONDARY"
  | "SECONDARIES"

<seconds keywords> ::= 
    "SEC"
  | "SECOND"
  | "SECONDS"

<server keywords> ::= 
    "SERVER"
  | "SERVERS"

<setting keywords> ::= 
    "SETTING"
  | "SETTINGS"

<shard keywords> ::= 
    "SHARD"
  | "SHARDS"

<type keywords> ::= 
    "TYPE"
  | "TYPES"

<transaction keywords> ::= 
    "TRANSACTION"
  | "TRANSACTIONS"

<user keywords> ::= 
    "USER"
  | "USERS"

<auth rule keywords> ::= 
    "AUTH RULE"
  | "AUTH RULES"

<provider keywords> ::= 
    "PROVIDER"
  | "PROVIDERS"

<tag keywords> ::= 
    "TAG"
  | "TAGS"

<identifier> ::= 
    <regular identifier>
  | <delimited identifier>
  | <non-reserved word>

<separated identifier> ::= 
    <extended identifier>
  | <delimited identifier>

<regular identifier> ::= 
  <identifier start> [ <identifier extend>... ]

<extended identifier> ::= 
  <identifier extend>...

<general parameter reference> ::= 
  <dollar sign> <parameter name>

<delimited identifier> ::= 
  <accent quoted character sequence>

<identifier start> ::= 
  unicode: XID_START

<identifier extend> ::= 
  unicode: XID_CONTINUE

<non-reserved word> ::= 
    "ACCESS"
  | "ACTIVE"
  | "ACYCLIC"
  | "ADD"
  | "ADMIN"
  | "ADMINISTRATOR"
  | "ALIAS"
  | "ALIASES"
  | "ALLREDUCE"
  | "ALLSHORTESTPATHS"
  | "ALL"
  | "ALTER"
  | "ANALYZER"
  | "AND"
  | "ANY"
  | "ARRAY"
  | "AS"
  | "ASC"
  | "ASCENDING"
  | "ASSIGN"
  | "AT"
  | "AUTH"
  | "AUTO"
  | "BINDINGS"
  | "BOOL"
  | "BOOLEAN"
  | "BOOSTED"
  | "BOTH"
  | "BREAK"
  | "BUILT"
  | "BY"
  | "CALL"
  | "CASCADE"
  | "CASE"
  | "CHANGE"
  | "CIDR"
  | "COLLECT"
  | "COMMAND"
  | "COMMANDS"
  | "COMPOSITE"
  | "CONCURRENT"
  | "CONDITION"
  | "CONSTRAINT"
  | "CONSTRAINTS"
  | "CONTAINS"
  | "CONTINUE"
  | "COPY"
  | "COUNT"
  | "CREATE"
  | "CREDENTIAL"
  | "CREDENTIALS"
  | "CSV"
  | "CYPHER"
  | "CURRENT"
  | "DATA"
  | "DATABASE"
  | "DATABASES"
  | "DATE"
  | "DATETIME"
  | "DBMS"
  | "DEALLOCATE"
  | "DEFAULT"
  | "DEFINED"
  | "DELETE"
  | "DENY"
  | "DESC"
  | "DESCENDING"
  | "DESTROY"
  | "DETACH"
  | "DIFFERENT"
  | "DISJOINT"
  | "DISTINCT"
  | "DRIVER"
  | "DROP"
  | "DRYRUN"
  | "DUMP"
  | "DURATION"
  | "EACH"
  | "EDGE"
  | "ELEMENT"
  | "ELEMENTS"
  | "ELSE"
  | "ENABLE"
  | "ENABLED"
  | "ENCRYPTED"
  | "END"
  | "ENDS"
  | "ERROR"
  | "EXECUTABLE"
  | "EXECUTE"
  | "EXIST"
  | "EXISTENCE"
  | "EXISTS"
  | "FAIL"
  | "FALSE"
  | "FIELDTERMINATOR"
  | "FILTER"
  | "FINISH"
  | "FLOAT"
  | "FLOAT64"
  | "FLOAT32"
  | "FOREACH"
  | "FOR"
  | "FORWARDING"
  | "FROM"
  | "FULLTEXT"
  | "FUNCTION"
  | "FUNCTIONS"
  | "GRANT"
  | "GRAPH"
  | "GRAPHS"
  | "GROUP"
  | "GROUPS"
  | "HEADERS"
  | "HOME"
  | "ID"
  | "IF"
  | "IMMUTABLE"
  | "IMPERSONATE"
  | "IMPLIES"
  | "IN"
  | "INDEX"
  | "INDEXES"
  | "INF"
  | "INFINITY"
  | "INSERT"
  | "INT"
  | "INT64"
  | "INT32"
  | "INT16"
  | "INT8"
  | "INTEGER"
  | "INTEGER64"
  | "INTEGER32"
  | "INTEGER16"
  | "INTEGER8"
  | "IS"
  | "JOIN"
  | "KEY"
  | "LANGUAGE"
  | "LABEL"
  | "LABELED"
  | "LABELS"
  | "LEADING"
  | "LET"
  | "LIMIT"
  | "LIST"
  | "LOAD"
  | "LOCAL"
  | "LOOKUP"
  | "MATCH"
  | "MANAGEMENT"
  | "MAP"
  | "MERGE"
  | "METADATA"
  | "NAME"
  | "NAMES"
  | "NAN"
  | "NEW"
  | "NEXT"
  | "NFC"
  | "NFD"
  | "NFKC"
  | "NFKD"
  | "NODE"
  | "NODETACH"
  | "NODES"
  | "NONE"
  | "NORMALIZED"
  | "NOT"
  | "NOTHING"
  | "NOWAIT"
  | "NULL"
  | "OF"
  | "OFFSET"
  | "OIDC"
  | "ON"
  | "ONLY"
  | "OPTIONAL"
  | "OPTIONS"
  | "OPTION"
  | "OR"
  | "ORDER"
  | "PASSWORD"
  | "PASSWORDS"
  | "PATH"
  | "PATHS"
  | "PLAINTEXT"
  | "POINT"
  | "POPULATED"
  | "PRIMARY"
  | "PRIMARIES"
  | "PRIVILEGE"
  | "PRIVILEGES"
  | "PROCEDURE"
  | "PROCEDURES"
  | "PROPERTIES"
  | "PROPERTY"
  | "PROPERTY_EXISTS"
  | "PROVIDER"
  | "PROVIDERS"
  | "RANGE"
  | "READ"
  | "REALLOCATE"
  | "REDUCE"
  | "REL"
  | "RELATIONSHIP"
  | "RELATIONSHIPS"
  | "REMOVE"
  | "RENAME"
  | "REPEATABLE"
  | "REPLACE"
  | "REPLICA"
  | "REPLICAS"
  | "REPORT"
  | "RETRY"
  | "REQUIRE"
  | "REQUIRED"
  | "RESTRICT"
  | "RETURN"
  | "REVOKE"
  | "ROLE"
  | "ROLES"
  | "ROW"
  | "ROWS"
  | "RULE"
  | "RULES"
  | "SCAN"
  | "SCORE"
  | "SEARCH"
  | "SEC"
  | "SECOND"
  | "SECONDS"
  | "SECONDARIES"
  | "SECONDARY"
  | "SEEK"
  | "SERVER"
  | "SERVERS"
  | "SET"
  | "SETTING"
  | "SETTINGS"
  | "SHARD"
  | "SHARDS"
  | "SHORTEST"
  | "SHORTESTPATH"
  | "SHOW"
  | "SIGNED"
  | "SINGLE"
  | "SKIP"
  | "START"
  | "STARTS"
  | "STATUS"
  | "STOP"
  | "STRING"
  | "SUPPORTED"
  | "SUSPENDED"
  | "TAG"
  | "TAGS"
  | "TARGET"
  | "TERMINATE"
  | "TEXT"
  | "THEN"
  | "TIME"
  | "TO"
  | "TOPOLOGY"
  | "TRAIL"
  | "TRAILING"
  | "TRANSACTION"
  | "TRANSACTIONS"
  | "TRAVERSE"
  | "TRIM"
  | "TRUE"
  | "TYPE"
  | "TYPED"
  | "TYPES"
  | "UNION"
  | "UNIQUE"
  | "UNIQUENESS"
  | "UNWIND"
  | "USE"
  | "USER"
  | "USERS"
  | "USING"
  | "UUID"
  | "VALUE"
  | "VARCHAR"
  | "VECTOR"
  | "VERTEX"
  | "WAIT"
  | "WALK"
  | "WHEN"
  | "WHERE"
  | "WITH"
  | "WRITE"
  | "XOR"
  | "YIELD"
  | "ZONED"

<concatenation operator> ::= 
  "||"

<double colon> ::= 
  "::"

<double period> ::= 
  ".."

<regex equals operator> ::= 
  "=~"

<greater than operator> ::= 
  <right angle bracket>

<greater than or equals operator> ::= 
  ">="

<less than operator> ::= 
  <left angle bracket>

<less than or equals operator> ::= 
  "<="

<not equals operator> ::= 
  "<>"

<plus equals> ::= 
  "+="

<right double arrow> ::= 
  "=>"

<ampersand> ::= 
  "&"

<asterisk> ::= 
  "*"

<colon> ::= 
  ":"

<comma> ::= 
  ","

<dollar sign> ::= 
  "$"

<double quote> ::= 
  """

<equals operator> ::= 
  "="

<exclamation mark> ::= 
  "!"

<right angle bracket> ::= 
  ">"

<grave accent> ::= 
  "`"

<left brace> ::= 
  "{"

<left bracket> ::= 
  "["

<left paren> ::= 
  "("

<left angle bracket> ::= 
  "<"

<minus sign> ::= 
  "-"

<percent> ::= 
  "%"

<period> ::= 
  "."

<plus sign> ::= 
  "+"

<question mark> ::= 
  "?"

<quote> ::= 
  "'"

<reverse solidus> ::= 
  "\"

<right brace> ::= 
  "}"

<right bracket> ::= 
  "]"

<right paren> ::= 
  ")"

<solidus> ::= 
  "/"

<underscore> ::= 
  "_"

<vertical bar> ::= 
  "|"

<circumflex> ::= 
  "^"

<hex digit> ::= 
    <standard digit>
  | "A"
  | "B"
  | "C"
  | "D"
  | "E"
  | "F"
  | "a"
  | "b"
  | "c"
  | "d"
  | "e"
  | "f"

<digit> ::= 
  <standard digit>

<standard digit> ::= 
    <octal digit>
  | "8"
  | "9"

<octal digit> ::= 
    <binary digit>
  | "2"
  | "3"
  | "4"
  | "5"
  | "6"
  | "7"

<binary digit> ::= 
    "0"
  | "1"