Skip to content

Commit d8ee85e

Browse files
images
1 parent e63181f commit d8ee85e

File tree

6 files changed

+72
-47
lines changed

6 files changed

+72
-47
lines changed

modules/ROOT/images/different-relationships-graph.svg

Lines changed: 9 additions & 0 deletions
Loading

modules/ROOT/images/match-modes-graph.svg

Lines changed: 33 additions & 0 deletions
Loading

modules/ROOT/images/match-modes-reference.svg

Lines changed: 14 additions & 8 deletions
Loading

modules/ROOT/images/repeatable-elements-graph.svg

Lines changed: 9 additions & 0 deletions
Loading

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,45 +21,6 @@ Replacement syntax for deprecated and removed features are also indicated.
2121
Cypher 25 was introduced in Neo4j 2025.06 and can only be used on Neo4j 2025.06+ databases.
2222
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.
2323

24-
[[cypher-deprecations-additions-removals-2025.xx]]
25-
== Neo4j 2025.xx
26-
27-
=== New in Cypher 25
28-
29-
[cols="2", options="header"]
30-
|===
31-
| Feature
32-
| Details
33-
34-
a|
35-
label:functionality[]
36-
label:new[]
37-
[source, cypher, role="noheader"]
38-
----
39-
MATCH REPEATABLE ELEMENTS p = (:B)->{,5}()
40-
RETURN [n IN nodes(p) | n.q] AS nodes
41-
----
42-
43-
a|
44-
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.
60-
61-
|===
62-
6324
[[cypher-deprecations-additions-removals-2025.06]]
6425
== Neo4j 2025.06
6526

modules/ROOT/pages/patterns/match-modes.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This match mode is required in order for paths to be able to traverse a relation
1616

1717
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.
1818

19+
image::match-modes-graph.svg[Graph showing the seven bridges of Königsberg, width=400, role=popup]
20+
1921
To recreate the graph, run the following query against an empty Neo4j database:
2022

2123
[source, cypher, role=test-setup]
@@ -106,6 +108,8 @@ RETURN pathCount,
106108
3+d|Rows: 1
107109
|===
108110

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`._
109113

110114
However, if the relationship count is increased to `7`, `0` paths are returned.
111115

@@ -195,6 +199,9 @@ RETURN [n IN nodes(p) | n.name] AS visitedLocations,
195199

196200
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`.
197201

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+
198205
For more information about this match mode, see xref:patterns/reference.adoc#match-modes-rules-repeatable-elements[Syntax and semantics -> `REPEATABLE ELEMENTS`].
199206

200207
[[bounded-path-length]]

0 commit comments

Comments
 (0)