Skip to content

Commit a25ddb0

Browse files
committed
Rough sketch of the remaining error codes
1 parent c8ec980 commit a25ddb0

File tree

10 files changed

+342
-2
lines changed

10 files changed

+342
-2
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@
165165
**** xref:errors/gql-errors/22NC7.adoc[]
166166
**** xref:errors/gql-errors/22NC8.adoc[]
167167
**** xref:errors/gql-errors/22NC9.adoc[]
168+
**** xref:errors/gql-errors/22NCA.adoc[]
169+
**** xref:errors/gql-errors/22NCB.adoc[]
170+
**** xref:errors/gql-errors/22NCC.adoc[]
171+
**** xref:errors/gql-errors/22NCD.adoc[]
172+
**** xref:errors/gql-errors/22NCE.adoc[]
173+
**** xref:errors/gql-errors/22NCF.adoc[]
168174
*** xref:errors/gql-errors/index.adoc#invalid-transaction-state[Invalid transaction state]
169175
**** xref:errors/gql-errors/25G02.adoc[]
170176
**** xref:errors/gql-errors/25N01.adoc[]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ALTER CURRENT GRAPH TYPE SET {
1616
}
1717
----
1818

19-
The query returns an error with GQLSTATUS 22NCA and the status description:
19+
The query returns an error with GQLSTATUS 22NC9 and the status description:
2020

2121
[source]
2222
----
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
= 22NCA
2+
3+
== Status description
4+
error: data exception - node element type already exists. A node element type identified by the label `{ <<label>> }` already exists in the graph type.
5+
6+
== Explanation
7+
8+
This error occurs when attempting to add a new node element type to the graph type, but a node element type with the same label already exists.
9+
10+
== Example scenario
11+
12+
Given the existing graph type:
13+
14+
[source,cypher]
15+
----
16+
ALTER CURRENT GRAPH TYPE SET {
17+
(p:Person => {name :: STRING })
18+
}
19+
----
20+
21+
Execute the query:
22+
23+
[source,cypher]
24+
----
25+
ALTER CURRENT GRAPH TYPE ADD {
26+
(p:Person => {name :: STRING, age :: INT })
27+
}
28+
----
29+
30+
The query returns an error with GQLSTATUS 22NCA and the status description:
31+
32+
[source]
33+
----
34+
error: data exception - node element type already exists. A node element type identified by the label `:Person` already exists in the graph type.
35+
----
36+
37+
To fix this, change the query as follows:
38+
39+
[source, cypher]
40+
----
41+
ALTER CURRENT GRAPH TYPE ALTER {
42+
(p:Person => {name :: STRING, age :: INT })
43+
}
44+
----
45+
46+
47+
ifndef::backend-pdf[]
48+
[discrete.glossary]
49+
== Glossary
50+
51+
include::partial$glossary.adoc[]
52+
endif::[]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
= 22NCB
2+
3+
== Status description
4+
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `{ <<relType>> }` already exists in the graph type."
5+
6+
== Explanation
7+
8+
This error occurs when attempting to add a new relationship element type to the graph type, but a relationship element type with the same type already exists.
9+
10+
== Example scenario
11+
12+
Given the existing graph type:
13+
14+
[source,cypher]
15+
----
16+
ALTER CURRENT GRAPH TYPE SET {
17+
()-[r:REL => {name :: STRING }]->()
18+
}
19+
----
20+
21+
Execute the query:
22+
23+
[source,cypher]
24+
----
25+
ALTER CURRENT GRAPH TYPE ADD {
26+
()-[r:REL => {name :: STRING, age :: INT }]->()
27+
}
28+
----
29+
30+
The query returns an error with GQLSTATUS 22NCB and the status description:
31+
32+
[source]
33+
----
34+
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `REL` already exists in the graph type."
35+
----
36+
37+
To fix this, change the query as follows:
38+
39+
[source, cypher]
40+
----
41+
ALTER CURRENT GRAPH TYPE ALTER {
42+
()-[r:REL => {name :: STRING, age :: INT }]->()
43+
}
44+
----
45+
46+
47+
ifndef::backend-pdf[]
48+
[discrete.glossary]
49+
== Glossary
50+
51+
include::partial$glossary.adoc[]
52+
endif::[]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
= 22NCC
2+
3+
== Status description
4+
error: data exception - node element type specified incorrectly. The node element type identified by the label `{ <<label>> }` is different to the one specified in the query.
5+
6+
== Explanation
7+
8+
9+
== Example scenario
10+
11+
[source,cypher]
12+
----
13+
ALTER CURRENT GRAPH TYPE SET {
14+
(p:Person => {name :: STRING })
15+
}
16+
----
17+
18+
Execute the query:
19+
20+
[source,cypher]
21+
----
22+
ALTER CURRENT GRAPH TYPE DROP {
23+
(p:Person => :Student)
24+
}
25+
----
26+
27+
The query returns an error with GQLSTATUS 22NCC and the status description:
28+
29+
[source]
30+
----
31+
error: data exception - node element type specified incorrectly. The node element type identified by the label `Person` is different to the one specified in the query.
32+
----
33+
34+
To fix this, change the query as follows:
35+
36+
[source, cypher]
37+
----
38+
ALTER CURRENT GRAPH TYPE DROP {
39+
(p:Person => )
40+
}
41+
----
42+
It is not necessary to specify the full element type to drop it.
43+
44+
ifndef::backend-pdf[]
45+
[discrete.glossary]
46+
== Glossary
47+
48+
include::partial$glossary.adoc[]
49+
endif::[]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
= 22NCD
2+
3+
== Status description
4+
error: data exception - relationship element type specified incorrectly. The relationship element type identified by the relationship type `{ <<relType>> }` is different to the one specified in the query.
5+
6+
== Explanation
7+
8+
== Example scenario
9+
10+
[source,cypher]
11+
----
12+
ALTER CURRENT GRAPH TYPE SET {
13+
()-[r:REL => {name :: STRING }]->()
14+
}
15+
----
16+
17+
Execute the query:
18+
19+
[source,cypher]
20+
----
21+
ALTER CURRENT GRAPH TYPE DROP {
22+
()-[r:REL => {name :: STRING, age :: INT }]->()
23+
}
24+
----
25+
26+
The query returns an error with GQLSTATUS 22NCD and the status description:
27+
28+
[source]
29+
----
30+
error: data exception - relationship element type specified incorrectly. The relationship element type identified by the relationship type `REL` is different to the one specified in the query.
31+
----
32+
33+
To fix this, change the query as follows:
34+
35+
[source, cypher]
36+
----
37+
ALTER CURRENT GRAPH TYPE DROP {
38+
()-[r:REL => ]->()
39+
}
40+
----
41+
It is not necessary to specify the full element type to drop it.
42+
43+
44+
ifndef::backend-pdf[]
45+
[discrete.glossary]
46+
== Glossary
47+
48+
include::partial$glossary.adoc[]
49+
endif::[]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
= 22NCE
2+
3+
== Status description
4+
error: data exception - node element type in use. The node element type identified by the label `<<label>>` is referenced in the graph type element '{ <<graphTypeReference>> }' and cannot be dropped.
5+
6+
== Explanation
7+
8+
== Example scenario
9+
10+
[source,cypher]
11+
----
12+
ALTER CURRENT GRAPH TYPE SET {
13+
(p:Person => {name :: STRING })
14+
(p)-[:DRIVES]->(:Car)
15+
}
16+
----
17+
18+
Execute the query:
19+
20+
[source,cypher]
21+
----
22+
ALTER CURRENT GRAPH TYPE DROP {
23+
(p:Person => )
24+
}
25+
----
26+
27+
The query returns an error with GQLSTATUS 22NCE and the status description:
28+
29+
[source]
30+
----
31+
error: data exception - node element type in use. The node element type identified by the label `Car` is referenced in the graph type element '()-[:`DRIVES` =>]->()' and cannot be dropped.
32+
----
33+
34+
To fix this, change the query as follows:
35+
36+
[source, cypher]
37+
----
38+
39+
----
40+
41+
42+
ifndef::backend-pdf[]
43+
[discrete.glossary]
44+
== Glossary
45+
46+
include::partial$glossary.adoc[]
47+
endif::[]
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
= 22NCF
2+
3+
== Status description
4+
error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `{ <<graphTypeOperation>> }` operation.
5+
6+
== Explanation
7+
8+
== Example scenario
9+
10+
=== ALTER
11+
12+
Given the existing graph type:
13+
14+
[source,cypher]
15+
----
16+
ALTER CURRENT GRAPH TYPE SET {
17+
CONSTRAINT c1 FOR (s:Student) REQUIRE s.studentId :: INTEGER
18+
}
19+
----
20+
21+
Execute the query:
22+
23+
[source,cypher]
24+
----
25+
ALTER CURRENT GRAPH TYPE ALTER {
26+
CONSTRAINT c1 FOR (s:Student) REQUIRE s.studentId :: STRING
27+
}
28+
----
29+
30+
The query returns an error with GQLSTATUS 22NCF and the status description:
31+
32+
33+
[source]
34+
----
35+
error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `ALTER GRAPH TYPE ALTER` operation.
36+
----
37+
38+
To fix this, change the query as follows:
39+
40+
[source, cypher]
41+
----
42+
ALTER CURRENT GRAPH TYPE DROP {
43+
CONSTRAINT c1
44+
}
45+
ALTER CURRENT GRAPH TYPE ADD {
46+
CONSTRAINT c1 FOR (s:Student) REQUIRE s.studentId :: STRING
47+
}
48+
----
49+
50+
=== DROP
51+
52+
In this example we attempt to drop an undesignated constraint with an ALTER CURRENT GRAPH TYPE DROP query.
53+
54+
[source,cypher]
55+
----
56+
ALTER CURRENT GRAPH TYPE DROP {
57+
( :Person => {name :: STRING IS KEY})
58+
}
59+
----
60+
61+
The query returns an error with GQLSTATUS 22NCF and the status description:
62+
63+
64+
[source]
65+
----
66+
error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `ALTER GRAPH TYPE DROP` operation.
67+
----
68+
69+
To fix this, change the query as follows:
70+
71+
[source, cypher]
72+
----
73+
ALTER CURRENT GRAPH TYPE DROP {
74+
CONSTRAINT nameOfKeyConstraint
75+
}
76+
77+
----
78+
79+
80+
ifndef::backend-pdf[]
81+
[discrete.glossary]
82+
== Glossary
83+
84+
include::partial$glossary.adoc[]
85+
endif::[]

modules/ROOT/pages/errors/gql-errors/index.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ Status description:: error: data exception - graph type contains duplicated toke
670670

671671
Status description:: error: data exception - invalid element type constraints in graph type. A `{ <<entityType>>1 }` element type property `{ <<context>> }` constraint cannot be specified inline of a `{ <<entityType>>2 }` element type.
672672

673-
674673
[[invalid-transaction-state]]
675674
== Invalid transaction state
676675

modules/ROOT/partials/glossary.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
[[graph]]$graph:: The name of a graph, for example, `myGraph`.
4747
[[graphTypeDependence]]$graphTypeDependence:: Graph type dependencency for constraint, one of `UNDESIGNATED`, `INDEPENDENT`, or `DEPENDENT`.
4848
[[graphTypeReference]]$graphTypeReference:: Graph type reference, for example, `(:Node =>)` or `p`.
49+
[[graphTypeOperation]]$graphTypeOperation:: Graph type operation, for example, one of `SET`, `ADD`, `DROP` or `ALTER`.
4950
[[hint]]$hint:: Freeform description of a hint, for example, `USING INDEX n:N(prop)`.
5051
[[hintList]]$hintList:: A list of free form descriptions of hints like `USING INDEX n:N(prop)`.
5152
[[idx]]$idx:: Index name, `my_index`.

0 commit comments

Comments
 (0)