Skip to content

Commit b226603

Browse files
constraints slice, graph type set, add and alter
1 parent 54cab09 commit b226603

29 files changed

+1217
-505
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,16 @@
116116
** xref:indexes/syntax.adoc[]
117117
118118
* xref:schema/index.adoc[]
119-
** xref:schema/graph-types.adoc[]
120-
** xref:schema/constraints.adoc[]
119+
** xref:schema/graph-types/index.adoc[]
120+
*** xref:schema/graph-types/set-graph-types.adoc[]
121+
*** xref:schema/graph-types/extend-graph-types.adoc[]
122+
*** xref:schema/graph-types/alter-graph-types.adoc[]
123+
*** xref:schema/graph-types/list-graph-types.adoc[]
124+
*** xref:schema/graph-types/drop-graph-type-elements.adoc[]
125+
** xref:schema/constraints/index.adoc[]
126+
*** xref:schema/constraints/create-constraints.adoc[]
127+
*** xref:schema/constraints/list-constraints.adoc[]
128+
*** xref:schema/constraints/drop-constraints.adoc[]
121129
** xref:schema/syntax.adoc[]
122130
123131
* xref:planning-and-tuning/index.adoc[]

modules/ROOT/images/graph-types-alter-graph-type.svg

Lines changed: 32 additions & 0 deletions
Loading

modules/ROOT/images/graph-types-extend-graph-type.svg

Lines changed: 34 additions & 0 deletions
Loading

modules/ROOT/images/graph-types-relationship-element-type.svg

Lines changed: 2 additions & 1 deletion
Loading

modules/ROOT/images/graph-types-set-graph-type-populated-database.svg

Lines changed: 33 additions & 0 deletions
Loading

modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,16 @@ GQL supports `GRAPH TYPES` as a way of constraining a graph schema, but does not
616616
| Cypher feature
617617
| Description
618618

619-
| xref:schema/constraints.adoc#create-property-uniqueness-constraints[Property uniqueness constraints]
619+
| xref:schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[Property uniqueness constraints]
620620
| Ensures that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.
621621

622-
| xref:schema/constraints.adoc#create-property-existence-constraints[Property existence constraints]
622+
| xref:schema/constraints/create-constraints.adoc#create-property-existence-constraints[Property existence constraints]
623623
| Ensures that a property exists either for all nodes with a specific label or for all relationships with a specific type.
624624

625-
| xref:schema/constraints.adoc#create-property-type-constraints[Property type constraints]
625+
| xref:schema/constraints/create-constraints.adoc#create-property-type-constraints[Property type constraints]
626626
| Ensures that a property has the required property type for all nodes with a specific label or for all relationships with a specific type.
627627

628-
| xref:schema/constraints.adoc#create-key-constraints[Key constraints]
628+
| xref:schema/constraints/create-constraints.adoc#create-key-constraints[Key constraints]
629629
| Ensures that all properties exist and that the combined property values are unique for all nodes with a specific label or all relationships with a specific type.
630630

631631
|===

modules/ROOT/pages/appendix/tutorials/advanced-query-tuning.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ Predicates that will not work:
936936

937937
[NOTE]
938938
====
939-
If there is a xref:schema/constraints.adoc#create-property-existence-constraints[property existence constraint] on the property, no predicate is required to trigger the optimization.
939+
If there is a xref:schema/constraints/create-constraints.adoc#create-property-existence-constraints[property existence constraint] on the property, no predicate is required to trigger the optimization.
940940
For example, `CREATE CONSTRAINT constraint_name FOR (p:Person) REQUIRE p.name IS NOT NULL`
941941
942942
Predicates with parameters, such as `WHERE n.prop > $param`, can trigger _index-backed ORDER BY_.

modules/ROOT/pages/clauses/load-csv.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ For more `STRING` manipulation functions, see xref:functions/string.adoc[String
661661

662662
=== Create property uniqueness constraints
663663

664-
Always create xref:schema/constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints] prior to importing data, to avoid duplicates or colliding entities.
664+
Always create xref:schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints] prior to importing data, to avoid duplicates or colliding entities.
665665
If the source file contains duplicated data and the right constraints are in place, Cypher raises an error.
666666

667667
.Create a node property uniqueness constraints on person ID

modules/ROOT/pages/clauses/merge.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If partial matches are needed, this can be accomplished by splitting a pattern i
2525
[NOTE]
2626
====
2727
Under concurrent updates, `MERGE` only guarantees the existence of the `MERGE` pattern, but not uniqueness.
28-
To guarantee uniqueness of nodes with certain properties, a xref:schema/constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraint] should be used.
28+
To guarantee uniqueness of nodes with certain properties, a xref:schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraint] should be used.
2929
See xref::clauses/merge.adoc#query-merge-using-unique-constraints[Using property uniqueness constraints with `MERGE`].
3030
====
3131

@@ -512,7 +512,7 @@ This is in contrast to the example shown above in xref::clauses/merge.adoc#merge
512512
[[query-merge-using-unique-constraints]]
513513
== Using node property uniqueness constraints with `MERGE`
514514

515-
Cypher prevents getting conflicting results from `MERGE` when using patterns that involve xref:schema/constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints].
515+
Cypher prevents getting conflicting results from `MERGE` when using patterns that involve xref:schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[property uniqueness constraints].
516516
In this case, there must be at most one node that matches that pattern.
517517

518518
For example, given two property node uniqueness constraints on `:Person(id)` and `:Person(ssn)`, a query such as `MERGE (n:Person {id: 12, ssn: 437})` will fail, if there are two different nodes (one with `id` 12 and one with `ssn` 437), or if there is only one node with only one of the properties.

modules/ROOT/pages/clauses/optional-match.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ For example, the matching variables from one `MATCH` clause will provide the con
4949
However, there are two important differences between Neo4j and SQL which helps to explain `OPTIONAL MATCH` further.
5050

5151
. While it is both possible and advised to enforce partial schemas using indexes and constraints, Neo4j offers a greater degree of schema flexibility than a relational database.
52-
Nodes and relationships in a Neo4j database do not have to have a specific property set to them because other nodes or relationships in the same graph have that property (unless there is a xref:schema/constraints.adoc#create-property-existence-constraints[property existence constraint] created on the specific property).
52+
Nodes and relationships in a Neo4j database do not have to have a specific property set to them because other nodes or relationships in the same graph have that property (unless there is a xref:schema/constraints/create-constraints.adoc#create-property-existence-constraints[property existence constraint] created on the specific property).
5353

5454
. Queries in Cypher are run as pipelines.
5555
If a clause returns no results, it will effectively end the query as subsequent clauses will have no data to execute upon.

0 commit comments

Comments
 (0)