Skip to content

Commit 7366a5a

Browse files
Merge branch 'cypher-25' into conditional_clause
2 parents e7adf62 + 05d4b34 commit 7366a5a

File tree

14 files changed

+688
-260
lines changed

14 files changed

+688
-260
lines changed

antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ nav:
66
- modules/ROOT/content-nav.adoc
77
asciidoc:
88
attributes:
9-
neo4j-version: '2025.02'
9+
neo4j-version: '2025.03'

modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ These codes order the features in the table below.
9898
| xref:syntax/naming.adoc#identifier-length-limit[Naming rules and recommendations -> Identifier length limit]
9999
|
100100

101+
| GD01
102+
| Updatable graphs
103+
| xref:clauses/clause-composition.adoc#writing-clauses[Cypher clauses -> Writing clauses]
104+
| * Feature GD01 implies compliance with GQL feature GT01, "Explicit transaction commands", which states that conforming languages shall contain the following transaction control commands: `START TRANSACTION`, `ROLLBACK`, and `COMMIT`.
105+
These are not present in Cypher.
106+
However, Neo4j offers transaction management through the link:{neo4j-docs-base-uri}/create-applications[driver] transaction API.
107+
Cypher Shell also offers specific link:{neo4j-docs-base-uri}/operations-manual/current/tools/cypher-shell/#cypher-shell-commands[commands] to manage transactions.
108+
* Feature GD01 implies conformance to GQL's `<set-statement>` (subclause 13.3).
109+
GQL’s `SET` has no order dependencies because all right-hand side operations are completed before any assignments occur.
110+
However, In Cypher’s `SET`, the order of rows can affect the outcome because changes made during execution may depend on the sequence of assignments.
111+
The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.adoc[`ORDER BY`].
112+
101113
| GF01
102114
| Enhanced numeric functions
103115
| xref:functions/mathematical-numeric.adoc#functions-abs[`abs()`], xref:functions/mathematical-numeric.adoc#functions-floor[`floor()`], xref:functions/mathematical-logarithmic.adoc#functions-sqrt[`sqrt()`].

modules/ROOT/pages/clauses/call.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CALL dbms.checkConfigValue('server.bolt.enabled', 'true')
8686
| "valid" | "message"
8787
| true | "requires restart"
8888
89-
2+d|Rows: 2
89+
2+d|Rows: 1
9090
|===
9191
9292
====
@@ -118,7 +118,7 @@ CALL dbms.checkConfigValue($setting, $value)
118118
| "valid" | "message"
119119
| true | "requires restart"
120120
121-
2+d|Rows: 2
121+
2+d|Rows: 1
122122
|===
123123
124124
[NOTE]
@@ -153,7 +153,7 @@ CALL dbms.checkConfigValue($setting, 'true')
153153
| "valid" | "message"
154154
| true | "requires restart"
155155
156-
2+d|Rows: 2
156+
2+d|Rows: 1
157157
|===
158158
159159
====

modules/ROOT/pages/clauses/where.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ For more information, see the section about the xref:syntax/operators.adoc#match
368368
| 'Andy'
369369
| 'Timothy'
370370
| 'Peter'
371-
1+|Rows: 3
371+
372+
1+d|Rows: 3
372373
|===
373374

374375
Note that the `IS NORMALIZED` operator returns `null` when used on a non-`STRING` value.

modules/ROOT/pages/clauses/with.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ Another use is to filter on aggregated values.
2525
`WITH` is used to introduce aggregates which can then be used in predicates in `WHERE`.
2626
These aggregate expressions create new bindings in the results.
2727

28-
`WITH` is also used to separate reading from updating of the graph.
29-
Every part of a query must be either read-only or write-only.
30-
When going from a writing part to a reading part, the switch must be done with a `WITH` clause.
31-
3228
image:graph_with_clause.svg[]
3329

3430
////

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ New features are added to the language continuously, and occasionally, some feat
1616
This section lists all of the features that have been removed, deprecated, added, or extended in different Cypher versions.
1717
Replacement syntax for deprecated and removed features are also indicated.
1818

19-
[[cypher-deprecations-additions-removals-2025.02]]
20-
== Neo4j 2025.02
19+
[[cypher-deprecations-additions-removals-2025.03]]
20+
== Neo4j 2025.03
2121

2222
=== Removed features
2323
[cols="2", options="header"]
@@ -173,6 +173,18 @@ Graph name parts with special characters may require additional escaping of thos
173173

174174
Note that escaping graph names within the graph functions string argument is not supported in Cypher 5.
175175

176+
a|
177+
label:functionality[]
178+
label:updated[]
179+
[source, cypher, role="noheader"]
180+
----
181+
CREATE (:Person)
182+
MATCH (p:Person)
183+
RETURN count(p) AS count
184+
----
185+
186+
| Queries no longer require xref:clauses/with.adoc[`WITH`] to transition between reading and writing operations.
187+
176188
|===
177189

178190
=== New features

modules/ROOT/pages/functions/aggregating.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ The `Guy Pearce` node will, therefore, get counted twice when not using `DISTINC
312312
313313
| friendOfFriend.name | count(friendOfFriend) | count(ALL friendOfFriend) | count(DISTINCT friendOfFriend)
314314
| "Guy Pearce" | 2 | 2 | 1
315-
4+d|Rows: 1
316315
316+
4+d|Rows: 1
317317
|===
318318
319319
======

modules/ROOT/pages/functions/temporal/duration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See also xref::values-and-types/temporal.adoc[Temporal values] and xref::syntax/
1919
| *Syntax* 3+| `duration(input)`
2020
| *Description* 3+| Creates a `DURATION` value.
2121
.2+| *Arguments* | *Name* | *Type* | *Description*
22-
| `input` | `ANY` | A map optionally containing the following keys: 'years', 'quarters', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', or 'nanoseconds'.
22+
| `input` | `ANY` | A map optionally containing the following keys: 'years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', or 'nanoseconds'.
2323
| *Returns* 3+| `DURATION`
2424
|===
2525

modules/ROOT/pages/genai-integrations.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,27 +177,29 @@ CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) //
177177
[source, cypher, role=test-skip]
178178
----
179179
MATCH (m:Movie WHERE m.plot IS NOT NULL)
180-
WITH collect(m) AS moviesList // <1>
180+
WITH collect(m) AS moviesList, // <1>
181181
count(*) AS total,
182182
100 AS batchSize // <2>
183-
UNWIND range(0, total, batchSize) AS batchStart // <3>
183+
UNWIND range(0, total-1, batchSize) AS batchStart // <3>
184184
CALL (moviesList, batchStart, batchSize) { // <4>
185185
WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5>
186186
CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $token }) YIELD index, vector
187187
CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6>
188-
} IN TRANSACTIONS OF 1 ROW <7>
188+
} IN CONCURRENT TRANSACTIONS OF 1 ROW <7>
189189
----
190190
191191
<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST<NODE>`.
192192
<2> `batchSize` defines the number of nodes in `moviesList` to be processed at once.
193193
Because vector embeddings can be very large, a larger batch size may require significantly more memory on the Neo4j server.
194194
Too large a batch size may also exceed the provider's threshold.
195195
<3> Process `Movie` nodes in increments of `batchSize`.
196+
The end range `total-1` is due to `range` being inclusive on both ends.
196197
<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch.
197198
Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause].
198199
<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie.
199200
<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`.
200201
<7> Set to `1` the amount of batches to be processed at once.
202+
For more information on concurrency in transactions, see xref:subqueries/subqueries-in-transactions.adoc#concurrent-transactions[`CALL` subqueries -> Concurrent transactions]).
201203
202204
[NOTE]
203205
This example may not scale to larger datasets, as `collect(m)` requires the whole result set to be loaded in memory.

modules/ROOT/pages/patterns/shortest-paths.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CREATE (asc)-[:LINK {distance: 7.25}]->(cnm),
6464
(wof)-[:LINK {distance: 0.65}]->(wos)
6565
----
6666

67-
The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match, and can be either an `INTEGER` literal or, as of Neo4j 2025.02, a parameter which resolves to an `INTEGER`.
67+
The paths matched by a xref:patterns/fixed-length-patterns.adoc#path-patterns[path pattern] can be restricted to only the shortest (by number of hops) by including the keyword `SHORTEST k`, where `k` is the number of paths to match, and can be either an `INTEGER` literal or, as of Neo4j 2025.03, a parameter which resolves to an `INTEGER`.
6868
For example, the following example uses `SHORTEST 1` to return the length of the shortest path between `Worcester Shrub Hill` and `Bromsgrove`:
6969

7070
.Query

0 commit comments

Comments
 (0)