Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7157bf3
Add the constraints CIP
Mats-SX Dec 14, 2016
6448277
Add property existence constraint syntax
Mats-SX Dec 14, 2016
6b667b0
Introduce the concept of domain
Mats-SX Dec 15, 2016
bbb46f4
Add example for existence constraint
Mats-SX Dec 15, 2016
bf6e05c
Add SQL examples
Mats-SX Dec 15, 2016
a7521d2
Update standardisation scope
Mats-SX Dec 15, 2016
27cd6e6
Add grammar rules for new constraint syntax
Mats-SX Dec 15, 2016
08f8eb7
Edited the textual contents of the CIP
Feb 15, 2017
0d1ae5e
More textual edits to the Constraints CIP
Feb 16, 2017
824a2c7
Amended w3 reference to denote alterations in 'quoted' text
Feb 17, 2017
4103056
Rework CIP
Mats-SX Mar 1, 2017
fcaad28
Remove Motivation section
Mats-SX Mar 1, 2017
35c4730
Move Mutability and Name sections
Mats-SX Mar 1, 2017
9d7aaf4
Add cross-links
Mats-SX Mar 1, 2017
ec56ba9
Add example for CIR-2017-172
Mats-SX Mar 1, 2017
c6a6d38
Support arbitrary patterns
Mats-SX Mar 1, 2017
d355dcc
Introduce PRIMARY KEY constraint predicate
Mats-SX Mar 3, 2017
9438af1
Rename constraint operator to NODE KEY
Mats-SX Mar 7, 2017
f31f09f
Use ADD for constraint creation
Mats-SX Mar 7, 2017
a2dc74d
Add specification for the return record
Mats-SX Mar 7, 2017
52f3a5e
Add tests verifying NODE KEY works in grammar
Mats-SX May 4, 2017
8eca441
Reformatted title
Jan 17, 2018
53b0445
Use CREATE instead of ADD
Mats-SX Jul 19, 2019
0ec02df
Make textual clarifications
Mats-SX Jul 19, 2019
4ef7b32
Update grammar to use CREATE
Mats-SX Jul 22, 2019
dd6fbcd
Add Neo4j index extension CIP
Mats-SX Mar 3, 2017
41a0c27
Reformatted title
Jan 17, 2018
d92de3e
Update CIP with latest developments
Mats-SX Jul 26, 2019
f02ad09
Add detail on relationship to contraints CIP
Mats-SX Jul 26, 2019
2cebf70
Add result record specification
Mats-SX Jul 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add property existence constraint syntax
  • Loading branch information
Mats-SX committed Jul 26, 2019
commit 6448277604c5b51c645a0e3896d824f2eb44569e
37 changes: 37 additions & 0 deletions cip/1.accepted/CIP2016-12-14-Constraint-syntax.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,43 @@ FOR (c:Color)
REQUIRE UNIQUE c.rgb, c.name
----

[[existence]]
=== Property existence constraints

Property existence constraints are defined for both nodes and relationships, but the semantics are the same.
For this reason we will go over both constraints in the same section.

==== Syntax

.Grammar definition for property existence constraint:
[source, ebnf]
----
existence-constraint = "exists", "(", property-expression, ")" ;
----

.Example of node property existence constraint:
[source, cypher]
----
CREATE CONSTRAINT colors_must_have_rgb
FOR (c:Color)
REQUIRE exists(c.rgb)
----

.Example of relationship property existence constraint:
[source, cypher]
----
CREATE CONSTRAINT rates_have_quality
FOR ()-[l:RATED]-()
REQUIRE exists(l.rating)
----

==== Semantics

Property existence constraints enforce that the value of the specified property is non-null for all entities in the constraint domain.


===== Example

=== Interaction with existing features

The main interaction between the constraints and the rest of the language happens during updating statements.
Expand Down