Skip to content

Commit 6b032b4

Browse files
mnd999renetapopova
authored andcommitted
More review fixes
1 parent c394e23 commit 6b032b4

File tree

5 files changed

+31
-11
lines changed

5 files changed

+31
-11
lines changed

modules/ROOT/pages/errors/gql-errors/22NC6.adoc

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
= 22NC6
22

33
== Status description
4-
The independent constraint `{ <<constrDescrOrName>> }` was defined using the same label `{ <<label>> }` as a node type element.
4+
error: data exception - independent constraint and node element type have the same label.
5+
The independent constraint `{ <<constrDescrOrName>> }` is using the same label `{ <<label>> }` as a node element type.
56

67
== Explanation
7-
This error occurs when a label is used both as an identifying label (defining a node type element) and as part of an independent constraint.
8+
This error occurs when a label is used both as an identifying label (defining a node element type) and as part of an independent constraint.
89
A label cannot serve as both an identifying label and be referenced in an independent constraint at the same time.
910

1011
== Example scenario
@@ -22,7 +23,16 @@ An error will be thrown with GQLSTATUS 22NC6 and the status description:
2223

2324
[source]
2425
----
25-
error: data exception - independent constraint defined on node type element label. The independent constraint '(:`Person` {`name`})' was defined using the same label `Person` as a node type element.
26+
error: data exception - independent constraint and node element type have the same label. The independent constraint '(:`Person` {`name`})' is using the same label `Person` as a node element type.
27+
----
28+
29+
The correct fix is to define the existence constraint as part of the node element type:
30+
31+
[source, cypher]
32+
----
33+
ALTER CURRENT GRAPH TYPE SET {
34+
(p:Person => {name :: STRING NOT NULL})
35+
}
2636
----
2737

2838
ifndef::backend-pdf[]

modules/ROOT/pages/errors/gql-errors/22NC7.adoc

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
= 22NC7
22

33
== Status description
4-
The independent constraint `{ <<constrDescrOrName>> }` was defined using the same relationship type `{ <<relType>> }` as a relationship type element.
4+
error: data exception - independent constraint and relationship element type have the same relationship type. The independent constraint `{ <<constrDescrOrName>> }` is using the same relationship type `{ <<relType>> }` as a relationship element type.
55

66
== Explanation
7-
This error occurs when a relationship type is used both as an identifying relaionship type (defining a relationship type element) and as part of an independent constraint.
7+
This error occurs when a relationship type is used both as an identifying relationship type (defining a relationship element type) and as part of an independent constraint.
88
A label cannot serve as both an identifying label and be referenced in an independent constraint at the same time.
99

1010
== Example scenario
11-
For example, try to set an existance constraint on a property for the relationship type `:REL` where `:REL` is also defined as an identifying relationship type in the graph type:
11+
For example, try to set an existence constraint on a property for the relationship type `:REL` where `:REL` is also defined as an identifying relationship type in the graph type:
1212

1313
[source,cypher]
1414
----
1515
ALTER CURRENT GRAPH TYPE SET {
16-
()-[:REL => {name :: STRING}]->(),
17-
CONSTRAINT FOR ()-[r:REL =>]->() REQUIRE r.name IS NOT NULL,
16+
()-[:REL => {name :: ANY NOT NULL}]->(),
17+
CONSTRAINT FOR ()-[r:REL =>]->() REQUIRE r.name IS :: STRING,
1818
}
1919
----
2020

2121
An error will be thrown with GQLSTATUS 22NC7 and the status description:
2222

2323
[source]
2424
----
25-
error: data exception - independent constraint defined on node type element label. The independent constraint '(:`Person` {`name`})' was defined using the same label `Person` as a node type element.
25+
error: data exception - independent constraint and relationship element type have the same relationship type. The independent constraint '()-[:`REL`]-()' is using the same relationship type `REL` as a relationship element type.
26+
----
27+
28+
The correct fix is to define the existence constraint as part of the relationship element type:
29+
30+
[source, cypher]
31+
----
32+
ALTER CURRENT GRAPH TYPE SET {
33+
()-[:REL => {name :: STRING NOT NULL}]->()
34+
}
2635
----
2736

2837
ifndef::backend-pdf[]

modules/ROOT/pages/errors/gql-errors/22NC9.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ error: data exception - graph type contains duplicated tokens. The graph type in
3131

3232
=== Identifiers
3333

34-
Attempt to define two node element types using the same alias.
34+
Attempt to define two relationship element types using the same relationship type.
3535

3636
[source,cypher]
3737
----

modules/ROOT/pages/errors/gql-errors/22NCA.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= 22NCA
22

33
== Status description
4-
A `{ <<entityType>> }` element type property `{ <<context>> }` constraint cannot be specified inline of a `{ <<msg>> }` element type
4+
A `{ <<entityType>> }` element type property `{ <<context>> }` constraint cannot be specified inline of a `{ <<entityType2>> }` element type
55

66
== Explanation
77
Property type and existance constrains cannot be defined as inline constraints on graph type elements.

modules/ROOT/partials/glossary.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
[[endpointType]]$endpointType:: One of `start` or `end` of a relationship.
3636
[[entityId]]$entityId:: ID of a node or a relationship.
3737
[[entityType]]$entityType:: A node or a relationship.
38+
[[entityType2]]$entityType2:: A node or a relationship.
3839
[[expr]]$expr:: Cypher expression, for example, `1 + n.prop`.
3940
[[exprType]]$exprType:: Freeform expression type, for example, `EXISTS`, `COUNT`, `COLLECT`.
4041
[[feat]]$feat:: Freeform feature description.

0 commit comments

Comments
 (0)