@@ -33,9 +33,8 @@ The constraint syntax is defined as follows:
3333[source, ebnf]
3434----
3535constraint command = create-constraint | drop-constraint ;
36- create-constraint = "CREATE", "CONSTRAINT", constraint-name, "FOR", constraint- pattern, "REQUIRE", constraint-expr, { "REQUIRE", constraint-expr } ;
36+ create-constraint = "CREATE", "CONSTRAINT", constraint-name, "FOR", pattern, "REQUIRE", constraint-expr, { "REQUIRE", constraint-expr } ;
3737constraint-name = symbolic-name
38- constraint-pattern = node-pattern | simple-pattern ;
3938constraint-expr = uniqueness-expr | expression ;
4039uniquness-expr = "UNIQUE", property-expression, { ",", property-expression }
4140drop-constraint = "DROP", "CONSTRAINT", constraint-name ;
@@ -51,8 +50,6 @@ To that set of valid expressions, this CIP further specifies a special prefix op
5150All constraints require the user to specify a nonempty _name_ at constraint creation time.
5251This name is subsequently the handle with which a user may refer to the constraint, for example when dropping it.
5352
54- // TODO: Should we impose restrictions on the domain of constraint names, or are all Unicode characters allowed?
55-
5653==== Removing constraints
5754
5855A constraint is removed by referring to its name.
@@ -185,6 +182,22 @@ This composite constraint will make sure that all `:Color` nodes has a value for
185182
186183More complex constraint definitions are considered below:
187184
185+ .Multiple property existence using conjunction
186+ [source, cypher]
187+ ----
188+ CREATE CONSTRAINT person_properties
189+ FOR (p:Person)
190+ REQUIRE exists(p.name) AND exists(p.email)
191+ ----
192+
193+ .Using larger pattern
194+ [source, cypher]
195+ ----
196+ CREATE CONSTRAINT not_rating_own_posts
197+ FOR (u1:User)-[:RATED]->(:Post)<-[:POSTED_BY]-(u2:User)
198+ REQUIRE u.name <> u2.name
199+ ----
200+
188201.Property value limitations
189202[source, cypher]
190203----
0 commit comments