You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc
-39Lines changed: 0 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,45 +21,6 @@ Replacement syntax for deprecated and removed features are also indicated.
21
21
Cypher 25 was introduced in Neo4j 2025.06 and can only be used on Neo4j 2025.06+ databases.
22
22
Features removed in Cypher 25 are still available on Neo4j 2025.06+ databases either by prepending a query with `CYPHER 5` or by having Cypher 5 as the default language for the database.
New match mode, xref:patterns/match-modes.adoc#repeatable-elements[`REPEATABLE ELEMENTS]`.
45
-
This is a non-restrictive match mode, in which relationships matched across all constituent path patterns in a graph patterns can be repeatedly traversed.
46
-
47
-
|
48
-
label:functionality[]
49
-
label:new[]
50
-
[source, cypher, role="noheader"]
51
-
----
52
-
MATCH DIFFERENT RELATIONSHIPS p = (:B)->{,5}()
53
-
RETURN [n IN nodes(p) | n.q] AS nodes
54
-
----
55
-
56
-
a|
57
-
New keyword, `DIFFERENT RELATIONSHIPS`, which enables explicitly specifying Cypher's default mode.
58
-
This is a restrictive match mode, which requires that all relationships matched across all constituent path patterns in a graph pattern must be unique.
59
-
Specifying `DIFFERENT RELATIONSHIPS` is functionally equivalent to not specifying a match mode.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/patterns/match-modes.adoc
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ This match mode is required in order for paths to be able to traverse a relation
16
16
17
17
To explain match modes, this page will use the scenario of the link:https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg[seven bridges of Königsberg], a problem studied by link:https://en.wikipedia.org/wiki/Leonhard_Euler[Leonhard Euler] in 1736 to determine if one could cross all seven bridges of Königsberg exactly once and return to the same starting location.
18
18
19
+
image::match-modes-graph.svg[Graph showing the seven bridges of Königsberg, width=400, role=popup]
20
+
19
21
To recreate the graph, run the following query against an empty Neo4j database:
20
22
21
23
[source, cypher, role=test-setup]
@@ -106,6 +108,8 @@ RETURN pathCount,
106
108
3+d|Rows: 1
107
109
|===
108
110
111
+
image::different-relationships-graph.svg[Graph showing all but one of the seven bridges of Königsberg traversed, width=500, role=popup]
112
+
_In the `samplePath` with a length of `6` returned by `DIFFERENT RELATIONSHIPS`, all bridges are traversed except for bridge `3`._
109
113
110
114
However, if the relationship count is increased to `7`, `0` paths are returned.
111
115
@@ -195,6 +199,9 @@ RETURN [n IN nodes(p) | n.name] AS visitedLocations,
195
199
196
200
The query now returns solutions, and the order of the bridges traversed in the path returned demonstrates that bridges `2` and `4` were crossed twice in order to return to `Kneiphof`.
197
201
202
+
image::repeatable-elements-graph.svg[Several graphs showing order of traversals when using repeatable elements match mode, width=500, role=popup]
203
+
_Sequence of bridge traversals when using `REPEATABLE ELEMENTS`._
204
+
198
205
For more information about this match mode, see xref:patterns/reference.adoc#match-modes-rules-repeatable-elements[Syntax and semantics -> `REPEATABLE ELEMENTS`].
0 commit comments