diff --git a/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc b/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc index 5ba2a1a5f2..1d06f0412e 100644 --- a/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc +++ b/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc @@ -225,6 +225,16 @@ FOR p = (a)-[:R]-(b) REQUIRE length(p) < 2 ---- +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: + +.Constraint example from CIR-2017-172 +[source, cypher] +---- +CREATE CONSTRAINT enforce_dag_acyclic_for_R_links +FOR p = ()-[:R*]-() +REQUIRE acyclic(p) +---- + === Interaction with existing features The main interaction between the constraints and the rest of the language occurs during updating statements.