From bb9e8620371b8d6b45f343867729d638a3c0eed4 Mon Sep 17 00:00:00 2001 From: Mats Rydberg Date: Wed, 1 Mar 2017 15:53:14 +0100 Subject: [PATCH] Add example for CIR-2017-172 References #172 --- cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc b/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc index f2680afda1..2745d1f961 100644 --- a/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc +++ b/cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc @@ -217,6 +217,16 @@ FOR (p:Programmer) REQUIRE p:Person ---- +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.