Skip to content

Commit 49f8b2e

Browse files
committed
Add example for CIR-2017-172
References #172
1 parent 5fdef2c commit 49f8b2e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ FOR (p:Programmer)
217217
REQUIRE p:Person
218218
----
219219

220+
Assuming a function `acyclic()` that takes a path as argument and returns `true` if and only if the same node does not appear twice in the path, otherwise `false`, we may express:
221+
222+
.Constraint example from CIR-2017-172
223+
[source, cypher]
224+
----
225+
CREATE CONSTRAINT enforce_dag_acyclic_for_R_links
226+
FOR p = ()-[:R*]-()
227+
REQUIRE acyclic(p)
228+
----
229+
220230
=== Interaction with existing features
221231

222232
The main interaction between the constraints and the rest of the language occurs during updating statements.

0 commit comments

Comments
 (0)