Skip to content

Commit 5f55cae

Browse files
post-review corrections (non-graph types pages)
1 parent e625176 commit 5f55cae

File tree

12 files changed

+74
-47
lines changed

12 files changed

+74
-47
lines changed

modules/ROOT/pages/clauses/index.adoc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ m| xref::indexes/search-performance-indexes/index-hints.adoc#query-using-join-hi
266266

267267
|===
268268

269-
[[index-and-constraint-clauses]]
270-
== Index and constraint clauses
269+
[[index-and-schema-clauses]]
270+
== Index and schema clauses
271271

272-
These comprise clauses to create, show, and drop indexes and constraints.
272+
These comprise clauses to manage indexes, constraints, and graph types.
273273

274274
[options="header"]
275275
|===
@@ -278,8 +278,15 @@ These comprise clauses to create, show, and drop indexes and constraints.
278278
m| xref:indexes/syntax.adoc[CREATE \| SHOW \| DROP INDEX]
279279
| Create, show or drop an index.
280280

281-
m| xref::schema/syntax.adoc[CREATE \| SHOW \| DROP CONSTRAINT]
281+
m| xref::schema/syntax.adoc#constraints[CREATE \| SHOW \| DROP CONSTRAINT]
282282
| Create, show or drop a constraint.
283+
284+
m| xref::schema/syntax.adoc#graph-types[ALTER CURRENT GRAPH TYPE SET \| ADD \| ALTER \|DROP]
285+
| Set, extend, alter or drop elements in a graph type.
286+
287+
m| xref::schema/syntax.adoc#list-graph-types[SHOW CURRENT GRAPH TYPE]
288+
| Show the full graph type.
289+
283290
|===
284291

285292
[[administration-clauses]]

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ label:new[]
132132
[source, cypher, role="noheader"]
133133
----
134134
ALTER CURRENT GRAPH DROP {
135-
(:Pet =>)
135+
(:Pet =>),
136+
CONSTRAINT pet_address
136137
}
137138
----
138139

@@ -2415,7 +2416,7 @@ CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>
24152416
----
24162417
a|
24172418

2418-
Extended xref::constraints/managing-constraints.adoc#create-property-type-constraint-union-type[node and relationship property type constraints].
2419+
Extended xref::schema/constraints/create-constraints.adoc#create-property-type-constraint-union-type[node and relationship property type constraints].
24192420
Closed dynamic union types (`type1 \| type2 \| ...`) are now supported, allowing for types such as:
24202421

24212422
* `INTEGER \| FLOAT`
@@ -2497,7 +2498,7 @@ CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>
24972498
----
24982499
a|
24992500

2500-
Extended xref::constraints/managing-constraints.adoc#type-constraints-allowed-properties[node and relationship property type constraints].
2501+
Extended xref::schema/constraints/create-constraints.adoc#type-constraints-allowed-properties[node and relationship property type constraints].
25012502
The new supported types are:
25022503

25032504
* `LIST<BOOLEAN NOT NULL>`
@@ -2655,7 +2656,7 @@ CREATE CONSTRAINT name FOR ()-[r:TYPE]-() REQUIRE r.prop IS :: <PROPERTY TYPE>
26552656
----
26562657
a|
26572658

2658-
Added xref::constraints/managing-constraints.adoc#create-property-type-constraints[node and relationship property type constraints].
2659+
Added xref::schema/constraints/create-constraints.adoc#create-property-type-constraints[node and relationship property type constraints].
26592660
The available property types are:
26602661

26612662
* `BOOLEAN`

modules/ROOT/pages/introduction/cypher-neo4j.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ All users have full access rights.
3333
a|
3434
xref:schema/graph-types/index.adoc[] and the following individual constraints:
3535

36-
* xref::constraints/managing-constraints.adoc#create-property-existence-constraints[node and relationship property existence constraints]
37-
* xref::constraints/managing-constraints.adoc#create-property-type-constraints[node and relationship property type constraints]
38-
* xref::constraints/managing-constraints.adoc#create-property-uniqueness-constraints[node and relationship property uniqueness constraints]
39-
* xref::constraints/managing-constraints.adoc#create-key-constraints[node and relationship key constraints]
36+
* xref::schema/constraints/create-constraints.adoc#create-property-existence-constraints[node and relationship property existence constraints]
37+
* xref::schema/constraints/create-constraints.adoc#create-property-type-constraints[node and relationship property type constraints]
38+
* xref::schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[node and relationship property uniqueness constraints]
39+
* xref::schema/constraints/create-constraints.adoc#create-key-constraints[node and relationship key constraints]
4040
a|
41-
Only xref::constraints/managing-constraints.adoc#create-property-uniqueness-constraints[node and relationship property uniqueness constraints].
41+
Only xref::schema/constraints/create-constraints.adoc#create-property-uniqueness-constraints[node and relationship property uniqueness constraints].
4242

4343
| Runtimes
4444
a|

modules/ROOT/pages/introduction/cypher-overview.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ However, there are some important differences between the two:
3535

3636
*Cypher is schema-flexible*::
3737

38-
While it is both possible and advised to enforce an xref:schema/index.adoc[open schemas] with Neo4j, Cypher and Neo4j offers a greater degree of schema-flexibility than SQL and a relational database.
38+
While it is both possible and advised to enforce an xref:schema/index.adoc[open schema] with Neo4j using xref:schema/graph-types/index.adoc[graph types]/xref:schema/constraints/index.adoc[constraints] and xref:indexes/search-performance-indexes/index.adoc[indexes], Cypher and Neo4j offers a greater degree of schema-flexibility than SQL and a relational database.
3939
More specifically, 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 an xref:schema/constraints/create-constraints.adoc#create-property-existence-constraints[property existence constraint] created on that specific property).
4040
This means that users are not required to use a fixed schema to represent data and that they can add new attributes and relationships as their graphs evolve.
4141

modules/ROOT/pages/schema/constraints/create-constraints.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ The index makes these checks much faster by enabling direct lookups instead of s
876876
Cypher will use the indexes with an owning constraint in the same way that it utilizes other search-performance indexes.
877877
For more information about how indexes impact query performance, see xref:indexes/search-performance-indexes/using-indexes.adoc[].
878878

879-
These indexes are listed in the `owningConstraint` column returned by the xref:indexes/search-performance-indexes/managing-indexes.adoc#list-indexes[`SHOW INDEX`] command, and the `ownedIndex` column returned by the xref:schema/constraints/drop-constraints.adoc[`SHOW CONSTRAINT`] command.
879+
These indexes are listed in the `owningConstraint` column returned by the xref:indexes/search-performance-indexes/managing-indexes.adoc#list-indexes[`SHOW INDEX`] command, and the `ownedIndex` column returned by the xref:schema/constraints/list-constraints.adoc[`SHOW CONSTRAINT`] command.
880880

881881
.List constraints with backing indexes
882882
======

modules/ROOT/pages/schema/constraints/drop-constraints.adoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
:description: Information about droppping Neo4j's constraints.
2-
[[drop-constraint]]
32
= Drop constraints
43

54
Constraints are dropped using the `DROP CONSTRAINT` command.
6-
For the full command syntax to drop constraints, see xref:schema/syntax.adoc#drop-constraint[Syntax -> DROP CONSTRAINT].
5+
For the full command syntax to drop constraints, see xref:schema/syntax.adoc#drop-constraint[Syntax -> Drop constraints].
76
The constraints dropped on this page are created on the page xref:schema/constraints/create-constraints.adoc[].
87

98
[NOTE]
@@ -73,6 +72,19 @@ Removed 1 constraint.
7372
7473
======
7574

75+
[NOTE]
76+
====
77+
Constraints that are created as part of xref:schema/graph-types/set-graph-types.adoc#node-element-types[node] or xref:schema/graph-types/set-graph-types.adoc#relationship-element-types[relationship element types] in a xref:schema/graph-types/index.adoc[graph type] cannot be dropped with the `DROP CONSTRAINT constraint_name` command.
78+
This includes the following constraints:
79+
80+
* Property existence and property type constraints on identifying labels or relationship types
81+
* Node label existence constraints
82+
* Relationship source and target label constraints
83+
84+
These constraints can only be dropped by dropping the full node or relationship element type.
85+
For more information, see xref:schema/graph-types/drop-graph-type-elements.adoc#drop-element-types[Drop node and relationship element types]
86+
====
87+
7688
[[drop-constraint-with-parameter]]
7789
== Drop a constraint with a parameter
7890

modules/ROOT/pages/schema/constraints/index.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ The following constraints are available in Neo4j:
1111
* xref:schema/constraints/create-constraints.adoc#create-property-type-constraints[Property type constraints]: ensure that a property has the required property type for all nodes with a specific label or for all relationships with a specific type. label:enterprise-edition[]
1212
* xref:schema/constraints/create-constraints.adoc#create-key-constraints[Key constraints]: ensure 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.label:enterprise-edition[]
1313
14-
For information about listing and dropping constraints, see:
14+
For more information index-backed constraints, constraint creation failures and data violation scenarios, as well as listing and dropping constraints, see:
1515

16+
* xref:schema/constraints/create-constraints.adoc[]
1617
* xref:schema/constraints/list-constraints.adoc[]
1718
* xref:schema/constraints/drop-constraints.adoc[]
1819
@@ -25,5 +26,5 @@ Not all constraint types can be created using this syntax, however, and maintain
2526
2627
*It is, therefore, recommended to define a schema using a graph type, which offers both additional, more sophisticated constraint types and a more holistic and simplified approach for constraining and maintaining the shape of the data in a graph.*
2728
28-
For more information, see xref:schema/graph-types/index.adoc[]
29+
For more information, see xref:schema/graph-types/index.adoc[].
2930
====

modules/ROOT/pages/schema/constraints/list-constraints.adoc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
:description: Information about listing Neo4j's constraints.
32
= Show constraints
43

54
To list all constraints with the default output columns, use `SHOW CONSTRAINTS`.
65
If all columns are required, use `SHOW CONSTRAINTS YIELD *`.
7-
For the full command syntax to list constraints, see xref:schema/syntax.adoc#list-constraints[Syntax -> SHOW CONSTRAINTS].
6+
For the full command syntax to list constraints, see xref:schema/syntax.adoc#list-constraints[Syntax -> Show constraints].
87
The constraints listed on this page are created on the page xref:schema/constraints/create-constraints.adoc[].
98

109
[NOTE]
@@ -18,7 +17,7 @@ For more information, see the following sections of the xref:schema/graph-types/
1817
====
1918

2019
One of the output columns from `SHOW CONSTRAINTS` is the name of the constraint.
21-
This can be used to drop the constraint with the xref::constraints/managing-constraints.adoc#drop-constraint[`DROP CONSTRAINT` command].
20+
This can be used to drop the constraint with the xref::schema/constraints/drop-constraints.adoc[`DROP CONSTRAINT` command].
2221

2322
[NOTE]
2423
Listing constraints requires the link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`SHOW CONSTRAINTS` privilege].
@@ -256,7 +255,7 @@ YIELD name, type, createStatement
256255
| STRING
257256

258257
| type
259-
| The ConstraintType of this constraint (`NODE_PROPERTY_UNIQUENESS`, `RELATIONSHIP_PROPERTY_UNIQUENESS`, `NODE_PROPERTY_EXISTENCE`, `RELATIONSHIP_PROPERTY_EXISTENCE`, `NODE_PROPERTY_TYPE`, `RELATIONSHIP_PROPERTY_TYPE`, `NODE_KEY`, or `RELATIONSHIP_KEY`). label:default-output[]
258+
| The ConstraintType of this constraint (`NODE_PROPERTY_UNIQUENESS`, `RELATIONSHIP_PROPERTY_UNIQUENESS`, `NODE_PROPERTY_EXISTENCE`, `RELATIONSHIP_PROPERTY_EXISTENCE`, `NODE_PROPERTY_TYPE`, `RELATIONSHIP_PROPERTY_TYPE`, `NODE_LABEL_EXISTENCE`, `RELATIONSHIP_SOURCE_LABEL`, `RELATIONSHIP_TARGET_LABEL`, `NODE_KEY`, or `RELATIONSHIP_KEY`). label:default-output[]
260259

261260
| STRING
262261

@@ -270,11 +269,11 @@ The list returned will only include a single value (the name of the constrained
270269
| LIST<STRING>
271270

272271
| properties
273-
| The properties of this constraint (`null` for node label existence, relationship source label, and relationship target constraints which do not constrain properties). label:default-output[]
272+
| The properties of this constraint, or `null` for node label existence, relationship source label, and relationship target constraints which do not constrain properties. label:default-output[]
274273
| LIST<STRING>
275274

276275
| enforcedLabel
277-
| The implied labels required by a node element type or the source node and target node labels required by a relationship element type. label:default-output[] label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
276+
| The implied labels required by a node label existence constraint or the source node and target node labels required by a relationship source or target label constraint. label:default-output[] label:cypher[Cypher 25 only] label:new[Introduced in Neo4j 2025.xx]
278277
| STRING
279278

280279
| ownedIndex
@@ -295,7 +294,7 @@ label:default-output[]
295294
| MAP
296295

297296
| createStatement
298-
| Statement used to create the constraint (`null` for node label existence, relationship source label, and relationship target constraints, as well as property existence and property constraints defined on an identifying node label or relationship type of a node or relationship element type).
297+
| Statement used to create the constraint, or `null` for constraints with `dependent` classification.
299298
| STRING
300299

301300
|===

modules/ROOT/pages/schema/graph-types/set-graph-types.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ The `REQUIRE` keyword can also be used as an alternative syntax to define severa
289289

290290
Property uniqueness and key constraints can also be created using the `CONSTRAINT … FOR … REQUIRE` syntax.
291291
If so, they can be given a name which can be used in the `ALTER CURRENT GRAPH TYPE DROP` or `DROP CONSTRAINT` commands (if a name is not explicitly given, a name will be assigned).
292+
The given name must be unique among both indexes and constraints.
292293
For more information, see xref:schema/graph-types/drop-graph-type-elements.adoc#drop-constraints-on-identifying-and-non-identifying-labels-and-types[Drop constraints on identifying and non-identifying node labels and relationship types].
293294

294295
The following two examples define the same key constraint on an identifying node label.
@@ -469,7 +470,9 @@ It is also possible to include constraints in a graph type on implied node label
469470
This can be a useful tool if the data model requires certain attributes for nodes or relationships with non-identifying labels or types.
470471

471472
[NOTE]
472-
Constraints on non-identifying node labels and relationship types can be explicitly named when defined.This can be useful when see xref:schema/graph-types/drop-graph-type-elements.adoc#drop-constraints-on-identifying-and-non-identifying-labels-and-types[Drop constraints on identifying and non-identifying node labels and relationship types] (if a name is not explicitly given, a name will be assigned).
473+
Constraints on non-identifying node labels and relationship types can be explicitly named when defined.
474+
This can be useful when see xref:schema/graph-types/drop-graph-type-elements.adoc#drop-constraints-on-identifying-and-non-identifying-labels-and-types[Drop constraints on identifying and non-identifying node labels and relationship types] (if a name is not explicitly given, a name will be assigned).
475+
The given name must be unique among both indexes and constraints.
473476

474477
Property uniqueness and key constraints can be defined against any node label or relationship type in the graph, regardless of whether they serve as identifying node labels or relationship types (an example of a key constraint defined against the identifying node label of a node element type can be found xref:schema/graph-types/set-graph-types.adoc#naming-property-uniqueness-and-key-constraints[above]).
475478

modules/ROOT/pages/schema/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:description: Information about using a schema in Neo4j.
1+
:description: Information about using a schema in Neo4j for ensuring data integrity.
22
= Schema
33

44
Neo4j is a natively schema-free database.

0 commit comments

Comments
 (0)