Skip to content

Commit 51142ac

Browse files
post review corrections 4 (main graph types pages)
1 parent 024aaa2 commit 51142ac

File tree

6 files changed

+124
-125
lines changed

6 files changed

+124
-125
lines changed

modules/ROOT/pages/schema/graph-types/alter-element-types.adoc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ When altering a graph type, only those node or relationship element types to be
99
====
1010
Altering element types in a graph type requires the following privileges:
1111
12-
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`CREATE CONSTRAINT`]
12+
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`CREATE CONSTRAINT`]
1313
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`DROP CONSTRAINT`]
1414
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-tokens[`NAME MANAGEMENT`] (if graph type includes node labels, relationship types, or properties not already in the graph)
1515
====
@@ -33,7 +33,7 @@ ALTER CURRENT GRAPH TYPE SET {
3333
----
3434

3535
[NOTE]
36-
For details about all the elements included in the above graph type, see xref:schema/graph-types/set-graph-types.adoc[].
36+
For details about the different elements a graph type can contain, see xref:schema/graph-types/set-graph-types.adoc[].
3737

3838
.Alter node and relationship element types in a graph type
3939
[source, cypher]
@@ -97,8 +97,6 @@ For more information about how graph types are implemented, see xref:schema/grap
9797

9898
The behavior of key and property uniqueness constraints on identifying node labels and relationship types, as well as constraints on non-identifying node labels and relationship types with regard to the `ALTER CURRENT GRAPH TYPE ALTER` command follows that of xref:schema/constraints/index.adoc[Neo4j constraints]; they can be created and dropped, but they cannot be altered through a single command (they must, in that case, be dropped and recreated to fit the desired alteration).
9999

100-
It is not allowed to add key and property uniqueness constraints to node or relationship element types when altering a graph type. Nor can they be converted into another one through alteration.
101-
102100
It is not allowed to add key and property uniqueness constraints to node or relationship element types when altering a graph type.
103101
Nor can they be converted into another one through alteration.
104102

modules/ROOT/pages/schema/graph-types/drop-graph-type-elements.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ ALTER CURRENT GRAPH TYPE SET {
1717
(:Robot => :Resident&Machine {application :: STRING NOT NULL, id :: INTEGER NOT NULL}),
1818
(:City => {name :: STRING NOT NULL, population :: INTEGER}),
1919
(:Resident)-[:LIVES_IN => {since :: ANY NOT NULL}]->(:City),
20-
CONSTRAINT company_name FOR (c:Company) REQUIRE c.name IS KEY,
21-
CONSTRAINT resident_address FOR (resident:Resident) REQUIRE resident.address :: STRING,
22-
CONSTRAINT ownership_id FOR ()-[owner:OWNER_OF]->() REQUIRE owner.ownershipId IS UNIQUE,
2320
(:Company => {name :: STRING, address :: STRING IS UNIQUE}),
24-
(:Person)-[:WORKS_FOR => {role :: STRING}]->(:Company)
21+
(:Person)-[:WORKS_FOR => {role :: STRING}]->(:Company),
22+
CONSTRAINT company_name FOR (c:Company) REQUIRE c.name IS KEY,
23+
CONSTRAINT animal_id FOR (a:Animal) REQUIRE a.id IS UNIQUE,
24+
CONSTRAINT resident_address FOR (resident:Resident) REQUIRE resident.address :: STRING
2525
}
2626
----
2727

@@ -124,7 +124,7 @@ The names of constraints are returned by the xref:schema/constraints/list-constr
124124
[source, cypher]
125125
----
126126
ALTER CURRENT GRAPH TYPE DROP {
127-
CONSTRAINT ownership_id,
127+
CONSTRAINT animal_id,
128128
CONSTRAINT constraint_302a3693
129129
}
130130
----

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This command cannot alter existing elements in a graph type but adds entirely ne
99
====
1010
Extending a graph type requires the following privileges:
1111
12-
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`CREATE CONSTRAINT`]
12+
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-constraints[`CREATE CONSTRAINT`]
1313
* link:{neo4j-docs-base-uri}/operations-manual/current/authentication-authorization/database-administration/#access-control-database-administration-tokens[`NAME MANAGEMENT`] (if graph type includes node labels, relationship types, or properties not already in the graph)
1414
====
1515

@@ -30,13 +30,13 @@ ALTER CURRENT GRAPH TYPE SET {
3030
----
3131

3232
[NOTE]
33-
For details about all the elements included in the above graph type, see xref:schema/graph-types/set-graph-types.adoc[].
33+
For details about the different elements a graph type can contain, see xref:schema/graph-types/set-graph-types.adoc[].
3434

3535
.Extend a graph type by adding new element types
3636
[source, cypher]
3737
----
3838
ALTER CURRENT GRAPH TYPE ADD {
39-
(:Company => {name :: STRING, address :: STRING IS KEY}), // <1>
39+
(:Company => {name :: STRING, address :: STRING IS UNIQUE}), // <1>
4040
(:Person)-[:WORKS_FOR => {role :: STRING}]->(:Company)
4141
}
4242
----
@@ -63,7 +63,7 @@ It is implemented with the following constraints:
6363

6464
| `(:Company)`
6565
| Node property key
66-
| `address IS KEY`
66+
| `address IS UNIQUE`
6767

6868
| `()-[:WORKS_FOR]\->()`
6969
| Relationship property type
@@ -82,7 +82,7 @@ For more information about how graph types are implemented, see xref:schema/grap
8282

8383
The graph type now includes the added node and relationship element type:
8484

85-
.Set graph type - with added node and relationship element types
85+
.Current graph type -- with added node and relationship element types
8686
[source]
8787
----
8888
(p:Person => :Resident {name :: STRING, ssn :: INTEGER})
@@ -119,3 +119,4 @@ This is not valid.
119119
The reverse (adding a node or relationship element type with an identifying label/type already defined by a property type or property existence constraint) is also not possible.
120120
<3> This attempts to add a node element type with an identifying label already used as an implied label in a node element type in the existing graph type (`Pet`).
121121
This is not valid.
122+
The reverse (adding a node element type with an implied label that is already used as an identifying label in an existing node element type) is also not possible.

0 commit comments

Comments
 (0)