Skip to content

Commit b4446dd

Browse files
committed
WIP
1 parent 6aca200 commit b4446dd

File tree

13 files changed

+402
-0
lines changed

13 files changed

+402
-0
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@
152152
**** xref:errors/gql-errors/22NB8.adoc[]
153153
**** xref:errors/gql-errors/22NB9.adoc[]
154154
**** xref:errors/gql-errors/22NBA.adoc[]
155+
**** xref:errors/gql-errors/22NC1.adoc[]
156+
**** xref:errors/gql-errors/22NC2.adoc[]
157+
**** xref:errors/gql-errors/22NC3.adoc[]
158+
**** xref:errors/gql-errors/22NC4.adoc[]
159+
**** xref:errors/gql-errors/22NC5.adoc[]
160+
**** xref:errors/gql-errors/22NC6.adoc[]
161+
**** xref:errors/gql-errors/22NC7.adoc[]
162+
**** xref:errors/gql-errors/22NC8.adoc[]
163+
**** xref:errors/gql-errors/22NC9.adoc[]
164+
**** xref:errors/gql-errors/22NCA.adoc[]
165+
**** xref:errors/gql-errors/22NCB.adoc[]
155166
*** xref:errors/gql-errors/index.adoc#invalid-transaction-state[Invalid transaction state]
156167
**** xref:errors/gql-errors/25G02.adoc[]
157168
**** xref:errors/gql-errors/25N01.adoc[]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
= 22NC1
2+
3+
== Status description
4+
The graph type element includes a property key with name `{ <<propKey>> }` more than once.
5+
6+
== Explanation
7+
When defining a graph type, node element types, and relationship element types may only define a property once.
8+
9+
== Example scenario
10+
For example, try to set a graph type with :
11+
12+
[source,cypher]
13+
----
14+
ALTER CURRENT GRAPH TYPE SET {
15+
(n:Node => {prop::STRING, prop::INTEGER})
16+
}
17+
----
18+
19+
An error will be thrown with GQLSTATUS 22NC1 and the status description:
20+
21+
[source]
22+
----
23+
error: data exception - graph type element contains duplicated tokens. The graph type element includes a property key with name `prop` more than once.
24+
----
25+
26+
ifndef::backend-pdf[]
27+
[discrete.glossary]
28+
== Glossary
29+
30+
include::partial$glossary.adoc[]
31+
endif::[]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
= 22NC2
2+
3+
== Status description
4+
The node element type `{ <<label>> }` must contain one or more implied labels, or define at least one property type.
5+
6+
== Explanation
7+
When defining a graph type, node element types have some effect.
8+
Ineffectual node element types are not permitted.
9+
10+
== Example scenario
11+
For example, try to set a graph type with :
12+
13+
[source,cypher]
14+
----
15+
ALTER CURRENT GRAPH TYPE SET {
16+
(n:Node => )
17+
}
18+
----
19+
20+
An error will be thrown with GQLSTATUS 22NC2 and the status description:
21+
22+
[source]
23+
----
24+
error: data exception - node element type is empty. The node element type `Node` must contain one or more implied labels, or define at least one property type.
25+
----
26+
27+
ifndef::backend-pdf[]
28+
[discrete.glossary]
29+
== Glossary
30+
31+
include::partial$glossary.adoc[]
32+
endif::[]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
= 22NC3
2+
3+
== Status description
4+
The relationship element type `{ <<relType>> }` must define a node element type for source or destination, or define at least one property type.
5+
6+
== Explanation
7+
When defining a graph type, relationship element types must have some effect.
8+
Ineffectual relationship element types are not permitted.
9+
10+
== Example scenario
11+
For example, try to set a graph type with :
12+
13+
[source,cypher]
14+
----
15+
ALTER CURRENT GRAPH TYPE SET {
16+
()-[:REL =>]-()
17+
}
18+
----
19+
20+
An error will be thrown with GQLSTATUS 22NC3 and the status description:
21+
22+
[source]
23+
----
24+
error: data exception - relationship element type is empty. The relationship element type `REL` must define a node element type for source or destination, or define at least one property type.
25+
----
26+
27+
ifndef::backend-pdf[]
28+
[discrete.glossary]
29+
== Glossary
30+
31+
include::partial$glossary.adoc[]
32+
endif::[]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
= 22NC4
2+
3+
== Status description
4+
The label(s) `{ <<labelList>> }` are defined as both identifying and implied.
5+
6+
== Explanation
7+
When defining a graph type, labels and relationships must be assigned clear roles.
8+
A label cannot be both "identifying" (used to uniquely identify nodes) and "implied" (automatically assigned based on other schema rules) at the same time.
9+
Attempting to define a label as both will result in this error, as it creates ambiguity in the schema definition and node identification process.
10+
11+
== Example scenario
12+
For example, try to set a graph type which defines the node element types 'Person and 'Student' with the label 'Person' also declared as an implied label on the 'Student' node element type:
13+
14+
[source,cypher]
15+
----
16+
ALTER CURRENT GRAPH TYPE SET {
17+
(p:Person => {name :: STRING}),
18+
(s:Student => :Person )
19+
}
20+
----
21+
22+
An error will be thrown with GQLSTATUS 22NC4 and the status description:
23+
24+
[source]
25+
----
26+
error: data exception - a label cannot both identifying and implied. The label(s) `Person` are defined as both identifying and implied.
27+
----
28+
29+
ifndef::backend-pdf[]
30+
[discrete.glossary]
31+
== Glossary
32+
33+
include::partial$glossary.adoc[]
34+
endif::[]
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
= 22NC5
2+
3+
== Status description
4+
The `{ <<entityType>> }` element type referenced by `{ <<graphTypeReference>> }` was not found.
5+
6+
== Explanation
7+
This error occurs when a graph type definition references an element type (such as a node or relationship) using an alias that has not been defined, or by an identifying reference where there is no graph type element identified by that reference.
8+
If the referenced node or relationship type does not exist, the operation cannot proceed and this error is returned to indicate the missing element.
9+
10+
== Example scenarios
11+
12+
=== Node element reference not found ===
13+
For example, try to set a graph type with an identiying node element reference that does not exist:
14+
15+
[source,cypher]
16+
----
17+
ALTER CURRENT GRAPH TYPE SET {
18+
(:Node =>)-[e:REL => { prop :: STRING }]->()
19+
}
20+
----
21+
22+
An error will be thrown with GQLSTATUS 22NC5 and the status description:
23+
24+
[source]
25+
----
26+
error: data exception - graph type element not found. The node type element referenced by '(:Node =>)' was not found.
27+
----
28+
In this case, the reference could be corrected to be non-identifying, or the node type element could be defined before this operation.
29+
30+
=== Relationship element reference not found ===
31+
For example, try to set a graph type with a relationship element reference that does not exist:
32+
33+
[source,cypher]
34+
----
35+
ALTER CURRENT GRAPH TYPE SET {
36+
CONSTRAINT FOR ()-[b]->() REQUIRE (b.prop) IS KEY
37+
}
38+
39+
----
40+
41+
An error will be thrown with GQLSTATUS 22NC5 and the status description:
42+
43+
[source]
44+
----
45+
error: data exception - graph type element not found. The relationship type element referenced by 'b' was not found.
46+
----
47+
48+
ifndef::backend-pdf[]
49+
[discrete.glossary]
50+
== Glossary
51+
52+
include::partial$glossary.adoc[]
53+
endif::[]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
= 22NC6
2+
3+
== Status description
4+
The independent constraint `{ <<constrDescrOrName>> }`` was defined using the same label `{ <<label>> }` as a node type element.
5+
6+
== 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+
A label cannot serve as both an identifying label and be referenced in an independent constraint at the same time.
9+
10+
== Example scenario
11+
For example, try to set an existance constraint on a property for the label `:Person`` where `:Person` is also defined as an identifying label in the graph type:
12+
13+
[source,cypher]
14+
----
15+
ALTER CURRENT GRAPH TYPE SET {
16+
(p:Person => {name :: STRING}),
17+
CONSTRAINT FOR (p:Person =>) REQUIRE p.name IS NOT NULL,
18+
}
19+
----
20+
21+
An error will be thrown with GQLSTATUS 22NC6 and the status description:
22+
23+
[source]
24+
----
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+
----
27+
28+
ifndef::backend-pdf[]
29+
[discrete.glossary]
30+
== Glossary
31+
32+
include::partial$glossary.adoc[]
33+
endif::[]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
= 22NC7
2+
3+
== Status description
4+
The independent constraint `{ <<constrDescrOrName>> }` was defined using the same relationship type `{ <<relType>> }` as a relationship type element.
5+
6+
== 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.
8+
A label cannot serve as both an identifying label and be referenced in an independent constraint at the same time.
9+
10+
== 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:
12+
13+
[source,cypher]
14+
----
15+
ALTER CURRENT GRAPH TYPE SET {
16+
()-[:REL => {name :: STRING}]->(),
17+
CONSTRAINT FOR ()-[r:REL =>]->() REQUIRE r.name IS NOT NULL,
18+
}
19+
----
20+
21+
An error will be thrown with GQLSTATUS 22NC6 and the status description:
22+
23+
[source]
24+
----
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+
----
27+
28+
ifndef::backend-pdf[]
29+
[discrete.glossary]
30+
== Glossary
31+
32+
include::partial$glossary.adoc[]
33+
endif::[]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
= 22NC8
2+
3+
== Status description
4+
The empty node type `()` is not a valid target for a constraint
5+
6+
== Explanation
7+
This error occurs when you attempt to define a constraint on an empty node type.
8+
Constraints must target specific node types using a label.
9+
Using an empty node type means there is no label or type specified, which is not valid for constraint definitions.
10+
11+
== Example scenario
12+
Attempt to define a constraint on an empty node reference as follows:
13+
14+
[source,cypher]
15+
----
16+
ALTER CURRENT GRAPH TYPE SET {
17+
CONSTRAINT FOR () REQUIRE n.badger IS UNIQUE
18+
}
19+
----
20+
21+
An error will be thrown with GQLSTATUS 22NC6 and the status description:
22+
23+
[source]
24+
----
25+
error: data exception - constraint does not have a label or relationship type. The empty node type `()` is not a valid target for a constraint.
26+
----
27+
28+
ifndef::backend-pdf[]
29+
[discrete.glossary]
30+
== Glossary
31+
32+
include::partial$glossary.adoc[]
33+
endif::[]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
= 22NC9
2+
3+
== Status description
4+
The graph type includes a label, relationship type or alias with name `{ <<token>> }` more than once
5+
6+
== Explanation
7+
This error occurs when a graph type definition attempts to use the same name for more than one label, relationship type, or alias within the same scope.
8+
Each label, relationship type, or alias must have a unique name to avoid ambiguity in the graph schema.
9+
To resolve this error, ensure that all labels, relationship types, and aliases are uniquely named within the graph type definition.
10+
11+
== Example scenarios
12+
13+
=== Aliases
14+
15+
Attempt to define two node element types using the same alias.
16+
17+
[source,cypher]
18+
----
19+
ALTER CURRENT GRAPH TYPE SET {
20+
( p: Person => { prop :: STRING } ),
21+
( p: Property => { prop :: STRING } )
22+
}
23+
----
24+
25+
An error will be thrown with GQLSTATUS 22NC9 and the status description:
26+
27+
[source]
28+
----
29+
error: data exception - graph type contains duplicated tokens. The graph type includes a label, relationship type or alias with name 'p' more than once.
30+
----
31+
32+
=== Identifiers
33+
34+
Attempt to define two node element types using the same alias.
35+
36+
[source,cypher]
37+
----
38+
ALTER CURRENT GRAPH TYPE SET {
39+
()-[n:REL => { prop :: STRING }]->(),
40+
()-[m:REL => { prop :: STRING }]->()
41+
}
42+
----
43+
44+
An error will be thrown with GQLSTATUS 22NC9 and the status description:
45+
46+
[source]
47+
----
48+
error: data exception - graph type contains duplicated tokens. The graph type includes a label, relationship type or alias with name ':REL' more than once.
49+
----
50+
51+
ifndef::backend-pdf[]
52+
[discrete.glossary]
53+
== Glossary
54+
55+
include::partial$glossary.adoc[]
56+
endif::[]

0 commit comments

Comments
 (0)