Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NC5.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For example, try to define a constraint with an empty node element type referenc
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR () REQUIRE n.prop IS UNIQUE
}
----

The query returns an error with GQLSTATUS 22NC5 and the status description:
Expand All @@ -81,6 +82,7 @@ In this case, the reference can be fixed by providing a label for the constraint
----
ALTER CURRENT GRAPH TYPE SET {
CONSTRAINT FOR (n:Node) REQUIRE n.prop IS UNIQUE
}
----


Expand Down
4 changes: 2 additions & 2 deletions modules/ROOT/pages/errors/gql-errors/22NCB.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
= 22NCB

== Status description
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `{ <<relType>> }` already exists in the graph type."
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `{ <<relType>> }` already exists in the graph type.

== Explanation

Expand Down Expand Up @@ -31,7 +31,7 @@ The query returns an error with GQLSTATUS 22NCB and the status description:

[source]
----
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `REL` already exists in the graph type."
error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `REL` already exists in the graph type.
----

To fix this, change the query as follows:
Expand Down
6 changes: 4 additions & 2 deletions modules/ROOT/pages/errors/gql-errors/22NCC.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
= 22NCC

== Status description
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.
error: data exception - node element type specified incorrectly. The node element type `{ <<graphTypeElement>> }` identified by the label `{ <<label>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.

== Explanation
This error occurs when attempting to drop a node element type from the graph type, but the specified element type does not match the existing one for the given label.

When dropping an element type, it is not necessary to specify the full element type; you can simply specify the label. If you do specify an element type, it must match exactly with the existing one in the graph type.

== Example scenario

Expand All @@ -28,7 +30,7 @@ The query returns an error with GQLSTATUS 22NCC and the status description:

[source]
----
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.
error: data exception - node element type specified incorrectly. The node element type (`p`:`Person` => {`name` :: STRING }) identified by the label `Person` is different to the one specified in the query (`p`:`Person` => :`Student`).
----

To fix this, change the query as follows:
Expand Down
7 changes: 5 additions & 2 deletions modules/ROOT/pages/errors/gql-errors/22NCD.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
= 22NCD

== Status description
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.
error: data exception - relationship element type specified incorrectly. The relationship element type `{ <<graphTypeElement>> }` identified by the relationship type `{ <<relType>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.

== Explanation
This error occurs when attempting to drop a relationship element type from the graph type, but the specified element type does not match the existing one for the given relationship type.

When dropping an element type, it is not necessary to specify the full element type; you can simply specify the relationship type. If you do specify an element type, it must match exactly with the existing one in the graph type.

== Example scenario

Expand All @@ -27,7 +30,7 @@ The query returns an error with GQLSTATUS 22NCD and the status description:

[source]
----
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.
error: data exception - relationship element type specified incorrectly. The relationship element type ()-[r:`REL` => {`name` :: STRING }]->() identified by the relationship type `REL` is different to the one specified in the query ()-[`r`:`REL` => {`name` :: STRING, `age` :: INT }]->().
----

To fix this, change the query as follows:
Expand Down
11 changes: 8 additions & 3 deletions modules/ROOT/pages/errors/gql-errors/22NCE.adoc
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
= 22NCE

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

== Explanation
This error occurs when attempting to drop a node element type from the graph type, but the node element type is still being referenced by a relationship element type in the graph type. To successfully drop the node element type, you must first drop any relationship element types that reference it, or remove it from the relationship element types.

== Example scenario

[source,cypher]
----
ALTER CURRENT GRAPH TYPE SET {
(p:Person => {name :: STRING })
(p:Person => {name :: STRING }),
(p)-[:DRIVES]->(:Car)
}
----
Expand All @@ -31,10 +32,14 @@ The query returns an error with GQLSTATUS 22NCE and the status description:
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.
----

To fix this, change the query as follows:
To fix this and drop both types, change the query as follows:

[source, cypher]
----
ALTER CURRENT GRAPH TYPE DROP {
(:Person => ),
()-[:DRIVES]->()
}

----

Expand Down
4 changes: 4 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/22NCF.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `{ <<graphTypeOperation>> }` operation.

== Explanation
This error occurs when an attempt is made to specify a graph type constraint using the DROP or AMEND operations, which does not support such operations.
Graph type constraints my only be dropped by name when using the DROP operation, and are completely invalid when using AMEND.
This also applies to graph type constraints defined inline of the graph type elements using `IS KEY` and `IS UNIQUE`

== Example scenario

Expand Down Expand Up @@ -42,6 +45,7 @@ To fix this, change the query as follows:
ALTER CURRENT GRAPH TYPE DROP {
CONSTRAINT c1
}

ALTER CURRENT GRAPH TYPE ADD {
CONSTRAINT c1 FOR (s:Student) REQUIRE s.studentId :: STRING
}
Expand Down
25 changes: 25 additions & 0 deletions modules/ROOT/pages/errors/gql-errors/index.adoc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is autogenerated. You don't need to update it.

Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,31 @@ Status description:: error: data exception - graph type contains duplicated toke

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.

=== xref:errors/gql-errors/22NCA.adoc[22NCA]

Status description:: error: data exception - node element type already exists. A node element type identified by the label `{ <<label>> }` already exists in the graph type.

=== xref:errors/gql-errors/22NCB.adoc[22NCB]

Status description:: error: data exception - relationship element type already exists. A relationship element type identified by the relationship type `{ <<relType>> }` already exists in the graph type.

=== xref:errors/gql-errors/22NCC.adoc[22NCC]

Status description:: error: data exception - node element type specified incorrectly. The node element type `{ <<graphTypeElement>> }` identified by the label `{ <<label>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.

=== xref:errors/gql-errors/22NCD.adoc[22NCD]

Status description:: error: data exception - relationship element type specified incorrectly. The relationship element type `{ <<graphTypeElement>> }` identified by the relationship type `{ <<relType>> }` is different to the one specified in the query `{ <<graphTypeElement>> }`.

=== xref:errors/gql-errors/22NCE.adoc[22NCE]

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

=== xref:errors/gql-errors/22NCF.adoc[22NCF]

Status description:: error: data exception - graph type constraint not supported. Graph type constraint definitions are not supported in the `{ <<graphTypeOperation>> }` operation.


[[invalid-transaction-state]]
== Invalid transaction state

Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/partials/glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
[[funType]]$funType:: Function type, e.g. non-deterministic or aggregate.
[[graph]]$graph:: The name of a graph, for example, `myGraph`.
[[graphTypeDependence]]$graphTypeDependence:: Graph type dependencency for constraint, one of `UNDESIGNATED`, `INDEPENDENT`, or `DEPENDENT`.
[[graphTypeElement]]$graphTypeElement:: An element of a graph type, for example `(:Node => { name :: STRING})`, or `(:Src)-[:REL =>]->(:Target)`.
[[graphTypeReference]]$graphTypeReference:: Graph type reference, for example, `(:Node =>)` or `p`.
[[graphTypeOperation]]$graphTypeOperation:: Graph type operation, for example, one of `SET`, `ADD`, `DROP` or `ALTER`.
[[hint]]$hint:: Freeform description of a hint, for example, `USING INDEX n:N(prop)`.
Expand Down