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 May 4, 2017
1 parent e828f34 commit bb9e862
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 bb9e862

Please sign in to comment.