Skip to content

Commit 7c955d2

Browse files
dogofbrianrenetapopova
authored andcommitted
Add examples and solutions
1 parent 82ad6cb commit 7c955d2

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

modules/ROOT/pages/errors/gql-errors/42I39.adoc

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
1+
:page-role: new-2025.11
12
= 42I39
23

34
== Status description
4-
error: syntax error or access rule violation - invalid use of shortest path function. Mixing the `{ <<fun>> }` function with path selectors, explicit match modes or explicit path modes is not allowed.
5+
error: syntax error or access rule violation - invalid use of shortest path function. Mixing the `{ <<fun>> }` function with path selectors, explicit match modes, or explicit path modes is not allowed.
6+
7+
== Example scenario
8+
For example, in the following query `REPEATABLE ELEMENTS` is used with the `shortestPath()` function:
9+
10+
[source,cypher]
11+
----
12+
MATCH p = ACYCLIC shortestPath((:A)-[:R*0..10]->(:B))
13+
WHERE any(x IN nodes(p) WHERE x:X)
14+
RETURN p
15+
----
16+
This will result in an error with GQLSTATUS xref:errors/gql-errors/42001.adoc[42001], with a cause detailed in xref:errors/gql-errors/42I39.adoc[42I39] and the following status description:
17+
18+
[source]
19+
----
20+
error: syntax error or access rule violation - invalid use of shortest path function. Mixing the `shortestPath()` function with path selectors, explicit match modes, or explicit path modes is not allowed.
21+
----
22+
23+
== Possible solution
24+
Replace `shortestPath()` with the `SHORTEST 1` path selector, and `allShortestPaths()` with the `SHORTEST ALL` path selector.
25+
26+
For example, the query above can be rewritten as:
27+
28+
[source,cypher]
29+
----
30+
MATCH p = SHORTEST 1 ACYCLIC (:A)-[:R*0..10]->(:B)
31+
WHERE any(x IN nodes(p) WHERE x:X)
32+
RETURN p
33+
----
534

635
ifndef::backend-pdf[]
736
[discrete.glossary]

modules/ROOT/pages/errors/gql-errors/42N60.adoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
:page-role: new-2025.11
12
= 42N60
23

34
== Status description
4-
error: syntax error or access rule violation - unsupported combination of match mode and path mode. REPEATABLE ELEMENTS with `{ <<pathMode>> }` path mode is not supported.
5+
error: syntax error or access rule violation - unsupported combination of match mode and path mode. `REPEATABLE ELEMENTS` with `{ <<pathMode>> }` path mode is not supported.
6+
7+
== Example scenario
8+
For example, in the following query `REPEATABLE ELEMENTS` is used with the `TRAIL` path mode:
9+
10+
[source,cypher]
11+
----
12+
MATCH REPEATABLE ELEMENTS p = TRAIL (:A)-[:R]->{,10}(:B)
13+
RETURN p
14+
----
15+
This will result in an error with GQLSTATUS xref:errors/gql-errors/42001.adoc[42001], with a cause detailed in xref:errors/gql-errors/42I60.adoc[42I60] and the following status description:
16+
17+
[source]
18+
----
19+
error: syntax error or access rule violation - unsupported combination of match mode and path mode. `REPEATABLE ELEMENTS` with `TRAIL` path mode is not supported.
20+
----
521

622
ifndef::backend-pdf[]
723
[discrete.glossary]

modules/ROOT/pages/errors/gql-errors/42N61.adoc

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
1+
:page-role: new-2025.11
12
= 42N61
23

34
== Status description
4-
error: syntax error or access rule violation - unsupported mixing of different path modes. Mixing `{ <<pathModeList>> }` in the same graph pattern is not supported. Split the pattern into separate MATCH clauses instead.
5+
error: syntax error or access rule violation - unsupported mixing of different path modes. Mixing `{ <<pathModeList>> }` in the same graph pattern is not supported. Split the pattern into separate `MATCH` clauses instead.
6+
7+
== Example scenario
8+
For example, in the following query `TRAIL` and `ACYCLIC` are used:
9+
10+
[source,cypher]
11+
----
12+
MATCH p = ACYCLIC (a:A)-[:P]->+(b:B),
13+
q = TRAIL (b)-[:Q]->+(a)
14+
RETURN p, q
15+
----
16+
This will result in an error with GQLSTATUS xref:errors/gql-errors/42001.adoc[42001], with a cause detailed in xref:errors/gql-errors/42N61.adoc[42N61] and the following status description:
17+
18+
[source]
19+
----
20+
error: syntax error or access rule violation - unsupported mixing of different path modes. Mixing `ACYCLIC` and `TRAIL` in the same graph pattern is not supported. Split the pattern into separate `MATCH` clauses instead.
21+
----
22+
23+
== Possible solution
24+
Split the graph pattern into separate `MATCH` clauses and use predicates to enforce relationship uniqueness across the set of paths.
25+
26+
For example, the above query can be rewritten as:
27+
28+
[source,cypher]
29+
----
30+
MATCH p = ACYCLIC (a:A)-[r1:P]->+(b:B)
31+
MATCH q = TRAIL (b)-[r2:Q WHERE NOT r2 IN r1]->+(a)
32+
RETURN p, q
33+
----
34+
35+
Here the predicate `NOT r2 IN r1` ensures that the relationships in path `q` do not overlap with those in path `p`, replicating the effect of Cypher's default match mode `DIFFERENT RELATIONSHIPS`.
536

637
ifndef::backend-pdf[]
738
[discrete.glossary]

0 commit comments

Comments
 (0)