Skip to content

Commit

Permalink
Add example for CIR-2017-172
Browse files Browse the repository at this point in the history
References opencypher#172
  • Loading branch information
Mats-SX committed Mar 6, 2017
1 parent 5fdef2c commit 49f8b2e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 49f8b2e

Please sign in to comment.