Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@
**** xref:errors/gql-errors/22NBD.adoc[]
**** xref:errors/gql-errors/22NBE.adoc[]
**** xref:errors/gql-errors/22NBF.adoc[]
**** xref:errors/gql-errors/22NC1.adoc[]
**** xref:errors/gql-errors/22NC2.adoc[]
**** xref:errors/gql-errors/22NC3.adoc[]
**** xref:errors/gql-errors/22NC4.adoc[]
**** xref:errors/gql-errors/22NC5.adoc[]
**** xref:errors/gql-errors/22NC6.adoc[]
**** xref:errors/gql-errors/22NC7.adoc[]
**** xref:errors/gql-errors/22NC8.adoc[]
**** xref:errors/gql-errors/22NC9.adoc[]
**** xref:errors/gql-errors/22NCA.adoc[]
**** xref:errors/gql-errors/22NCB.adoc[]
**** xref:errors/gql-errors/22NCC.adoc[]
**** xref:errors/gql-errors/22NCD.adoc[]
**** xref:errors/gql-errors/22NCE.adoc[]
**** xref:errors/gql-errors/22NCF.adoc[]
*** xref:errors/gql-errors/index.adoc#invalid-transaction-state[Invalid transaction state]
**** xref:errors/gql-errors/25G02.adoc[]
**** xref:errors/gql-errors/25N01.adoc[]
Expand Down
41 changes: 41 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC1.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:page-role: new-2025.x cypher-25
= 22NC1

== Status description
error: data exception - graph type element contains duplicated tokens. The graph type element includes a property key with name `{ <<propKey>> }` more than once.

== Explanation
When defining a graph type, node and relationship element types may only define a property once.

== Example scenario
For example, try to set a graph type as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(n:Node => {prop::STRING, prop::INTEGER})
}
----

The query returns an error with GQLSTATUS 22NC1 and the status description:

[source]
----
error: data exception - graph type element contains duplicated tokens. The graph type element includes a property key with name `prop` more than once.
----

To fix this, remove the duplicate property key definition or uniquely name the property keys:

[source, cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Node => {prop :: STRING, prop2 :: INTEGER})
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
41 changes: 41 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC2.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:page-role: new-2025.x cypher-25
= 22NC2

== Status description
error: data exception - node element type has no effect. The node element type `{ <<label>> }` must contain one or more implied labels, or at least one property type.

== Explanation
When defining a graph type, node element types must have some effect; otherwise, they are not allowed.

== Example scenario
For example, try to set a graph type as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(n:Node => )
}
----

The query returns an error with GQLSTATUS 22NC2 and the status description:

[source]
----
error: data exception - node element type is has no effect. The node element type `Node` must contain one or more implied labels, or at least one property type.
----

To fix this, define at least one property type or add an implied label, for example:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(n:Node => { prop :: ANY NOT NULL })
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
46 changes: 46 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
:page-role: new-2025.x cypher-25
= 22NC3

== Status description
error: data exception - relationship element type has no effect. The relationship element type `{ <<relType>> }` must define a source, destination, or at least one property type.

== Explanation
When defining a graph type, relationship element types must have some effect.
To be effective, a relationship element type must define at least one of the following:

* a source node element type or label
* a destination node element type or label
* at least one property type

== Example scenario
For example, try to set a graph type as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
()-[:REL =>]->()
}
----

The query returns an error with GQLSTATUS 22NC3 and the status description:

[source]
----
error: data exception - relationship element type has no effect. The relationship element type `REL` must define a source or destination, or at least one property type.
----

To fix this, define at least one property type or add a node element type, for example:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
()-[:REL => {prop: ANY NOT NULL }]->()
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
46 changes: 46 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC4.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
:page-role: new-2025.x cypher-25
= 22NC4

== Status description
error: data exception - a label cannot be both identifying and implied. The label(s) `{ <<labelList>> }` are defined as both identifying and implied.

== Explanation
When defining a graph type, labels and relationships must be assigned clear roles.
A label cannot be both "identifying" (to uniquely identify nodes) and "implied" (automatically assigned based on other schema rules) at the same time.
Attempting to define a label as both will result in this error, as it creates ambiguity in the schema definition and node identification process.

== Example scenario
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 as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Person => {name :: STRING}),
(s:Student => :Person )
}
----

The query returns an error with GQLSTATUS 22NC4 and the status description:

[source]
----
error: data exception - a label cannot be both identifying and implied. The label(s) `Person` are defined as both identifying and implied.
----

One way to fix this is to add another label to both nodes and capture the property type on `name` there:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Person => :Named),
(s:Student => :Named),
CONSTRAINT FOR (:Named) REQUIRE name IS :: STRING
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
95 changes: 95 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC5.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
:page-role: new-2025.x cypher-25
= 22NC5

== Status description
error: data exception - graph type element not found. The `{ <<entityType>> }` element type referenced by `{ <<graphTypeReference>> }` does not exist.

== Explanation
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.
If the referenced node or relationship type does not exist, the operation cannot proceed and will return an error to indicate the missing element.

== Example scenarios

=== Node element reference does not exist
For example, try to set a graph type with an identifying node element reference that does not exist as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(:Node =>)-[e:REL => { prop :: STRING }]->()
}
----

The query returns an error with GQLSTATUS 22NC5 and the status description:

[source]
----
error: data exception - graph type element not found. The node type element referenced by '(:Node =>)' does not exist.
----
In this case, you can make the reference non-identifying, or you can define the node type element before this operation:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(:Node)-[e:REL => { prop :: STRING }]->()
}
----

=== Relationship element reference does not exist
For example, try to set a graph type with a relationship element reference that does not exist as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR ()-[b]->() REQUIRE (b.prop) IS KEY
}

----

The query returns an error with GQLSTATUS 22NC5 and the status description:

[source]
----
error: data exception - graph type element not found. The relationship type element referenced by 'b' does not exist.
----
In this case, the reference could be fixed by providing a relationship type:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR ()-[b:REL]->() REQUIRE (b.prop) IS KEY
}
----

=== Element reference omitted from constraint definition
For example, try to define a constraint with an empty node element type reference, which is not allowed as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR () REQUIRE n.prop IS UNIQUE
}
----

The query returns an error with GQLSTATUS 22NC5 and the status description:

[source]
----
error: data exception - graph type element not found. The node type element referenced by 'n' was does not exist.
----
In this case, the reference can be fixed by providing a label for the constraint:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR (n:Node) REQUIRE n.prop IS UNIQUE
}
----


ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
44 changes: 44 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC6.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
:page-role: new-2025.x cypher-25
= 22NC6

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

== Explanation
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.
A label cannot simultaneously serve as an identifying label and be referenced in an independent constraint.

== Example scenario
For example, try to set a property existence constraint on a property for the label `:Person`, where `:Person` is also defined as an identifying label in the graph type as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Person => {name :: STRING}),
CONSTRAINT FOR (p:Person =>) REQUIRE p.name IS NOT NULL
}
----

The query returns an error with GQLSTATUS 22NC6 and the status description:

[source]
----
error: data exception - independent constraint and node element type have the same label. The independent constraint 'Constraint( type='NODE_PROPERTY_EXISTENCE', schema=(:`Person` {`name`}) )' is using the same label `Person` as a node element type.
----

To fix this, define the property existence constraint as part of the node element type:

[source, cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Person => {name :: STRING NOT NULL})
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
44 changes: 44 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC7.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
:page-role: new-2025.x cypher-25
= 22NC7

== Status description
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.

== Explanation
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.
A relationship type cannot simultaneously serve as an identifying relationship type and be referenced in an independent constraint.

== Example scenario
For example, try to set a property type constraint on a property for the relationship type `:REL`, where `:REL` is also defined as an identifying relationship type in the graph type as follows:

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
()-[:REL => {name :: ANY NOT NULL}]->(),
CONSTRAINT FOR ()-[r:REL =>]->() REQUIRE r.name IS :: STRING
}
----

The query returns an error with GQLSTATUS 22NC7 and the status description:

[source]
----
error: data exception - independent constraint and relationship element type have the same relationship type. The independent constraint 'Constraint( type='RELATIONSHIP_PROPERTY_TYPE', schema=()-[:`REL` {`name`}]-(), propertyType=STRING )' is using the same relationship type `REL` as a relationship element type.
----

To fix this, define the property type constraint as part of the relationship element type:

[source, cypher]
----
ALTER CURRENT GRAPH TYPE SET {
()-[:REL => {name :: STRING NOT NULL}]->()
}
----

ifndef::backend-pdf[]
[discrete.glossary]
== Glossary

include::partial$glossary.adoc[]
endif::[]
Loading