diff --git a/grammar/basic-grammar.xml b/grammar/basic-grammar.xml index 972b90123b..20ab65ce3d 100644 --- a/grammar/basic-grammar.xml +++ b/grammar/basic-grammar.xml @@ -134,7 +134,7 @@ - + : diff --git a/grammar/commands.xml b/grammar/commands.xml index 7b8161fa68..42b331fb0a 100644 --- a/grammar/commands.xml +++ b/grammar/commands.xml @@ -31,7 +31,7 @@ xmlns:rr="http://opencypher.org/railroad" xmlns:oc="http://opencypher.org/opencypher"> - + @@ -44,10 +44,51 @@ + + + + + + + + + + CREATE &SP; CONSTRAINT &SP; &SP; + FOR &SP; &SP; + REQUIRE &SP; + + + + DROP &SP; CONSTRAINT &SP; + + + + + + + + + ( &var; &label; ) + ( ) - [ &var; ] - ( ) + + + + + + + - + + UNIQUE &SP; &WS; , &WS; + + + + exists ( ) + + + CREATE &SP; diff --git a/tools/grammar/src/test/resources/cypher.txt b/tools/grammar/src/test/resources/cypher.txt index 60d110b9d8..463366a4c6 100644 --- a/tools/grammar/src/test/resources/cypher.txt +++ b/tools/grammar/src/test/resources/cypher.txt @@ -119,3 +119,16 @@ MATCH (other:Person) WHERE ( NOT other.age > 25) RETURN other.name§ MATCH (other:Person) WHERE ( NOT other.age > 25) RETURN other.name§ MATCH (other:Person) WHERE ( NOT other.age > 25 ) RETURN other.name§ MATCH (other:Person) WHERE NOT ( other.age > 25) RETURN other.name§ +CREATE CONSTRAINT foo +FOR (p:Person) +REQUIRE UNIQUE p.name§ +CREATE CONSTRAINT bar +FOR (p:Person) +REQUIRE UNIQUE p.name, p.email§ +CREATE CONSTRAINT baz +FOR (p:Person) +REQUIRE exists(p.name)§ +CREATE CONSTRAINT cru +FOR ()-[r:REL]-() +REQUIRE exists(r.property)§ +DROP CONSTRAINT foo_bar_baz§