Skip to content

Commit e509773

Browse files
Add missing Cypher 25 updates (GQL extended identifiers + subqeury expression change) (#1313)
1 parent 0e14511 commit e509773

File tree

4 files changed

+53
-23
lines changed

4 files changed

+53
-23
lines changed

modules/ROOT/pages/appendix/gql-conformance/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:description: Overview of Cypher's conformance to GQL.
22
= GQL conformance
33

4-
*Last updated*: 2 June 2025 +
4+
*Last updated*: 18 June 2025 +
55
*Neo4j version*: 2025.06
66

77
GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases.

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ In Cypher, `trim()` removes any whitespace character.
211211
| 21.1
212212
| Names and variables
213213
| xref:syntax/index.adoc[]
214-
| Cypher supports GQL’s lexical elements, with the following caveats:
214+
| Cypher supports GQL’s lexical elements, with the following caveat:
215215

216-
* GQL allows for extended parameter identifiers.
217-
For example: `RETURN $0hello` is allowed in GQL but not Cypher.
218216
* GQL allows identifiers that are not variables to be delimited with both backticks and quotes.
219217
Cypher only allows backticks.
220218
For example: `MATCH (n) RETURN n."a prop"` is allowed in GQL but not Cypher.

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

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ label:removed[]
5959
RETURN 1 as my\u0085identifier
6060
----
6161
a|
62-
The Unicode character \`\u0085` has been removed for unescaped identifiers and is now considered a whitespace character.
63-
To continue using it, escape the identifier by adding backticks around it.
62+
The Unicode character `\u0085` (`Next Line`) has been removed for unescaped identifiers and is now considered a whitespace character.
63+
To continue using it, escape the identifier by adding backticks (++``++) around it.
6464
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names, or parameters.
65-
In the given example, the quoted identifier would be \`my�identifier`.
65+
In the given example, the quoted identifier would be `my\u0085identifier`.
6666

6767
a|
6868
label:functionality[]
@@ -72,23 +72,24 @@ label:removed[]
7272
RETURN 1 as my$Identifier
7373
----
7474
a|
75-
The character with the Unicode representation \`\u0024` has been removed for unescaped identifiers. To continue using it, escape the identifier by adding backticks around the identifier.
76-
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names, or parameters. In the given example, the quoted identifier would be \`my$identifier`.
75+
The character with the Unicode representation `\u0024` (`$`) has been removed for unescaped identifiers.
76+
To continue using it, escape the identifier by adding backticks (++``++) around the identifier.
77+
This applies to all unescaped identifiers in Cypher, such as label expressions, properties, variable names, or parameters. In the given example, the quoted identifier would be `my\u0024identifier`.
7778

7879
The following Unicode Characters are removed in identifiers:
79-
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007',
80-
'\u0008', '\u000E', '\u000F', '\u0010', '\u0011', '\u0012', '\u0013', '\u0014',
81-
'\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u007F',
82-
'\u0080', '\u0081', '\u0082', '\u0083', '\u0084', '\u0086', '\u0087', '\u0088',
83-
'\u0089', '\u008A', '\u008B', '\u008C', '\u008D', '\u008E', '\u008F', '\u0090',
84-
'\u0091', '\u0092', '\u0093', '\u0094', '\u0095', '\u0096', '\u0097', '\u0098',
85-
'\u0099', '\u009A', '\u009B', '\u009C', '\u009D', '\u009E', '\u009F', '\u0024',
86-
'\u00A2', '\u00A3', '\u00A4', '\u00A5', '\u00AD', '\u0600', '\u0601', '\u0602',
87-
'\u0603', '\u0604', '\u0605', '\u061C', '\u06DD', '\u070F', '\u08E2', '\u180E',
88-
'\u200B', '\u200C', '\u200D', '\u200E', '\u200F', '\u202A', '\u202B', '\u202C',
89-
'\u202D', '\u202E', '\u2060', '\u2061', '\u2062', '\u2063', '\u2064', '\u2066',
90-
'\u2067', '\u2068', '\u2069', '\u206A', '\u206B', '\u206C', '\u206D', '\u206E',
91-
'\u206F', '\u2E2F', '\uFEFF', '\uFFF9', '\uFFFA', '\uFFFB'
80+
`\u0000`, `\u0001`, `\u0002`, `\u0003`, `\u0004`, `\u0005`, `\u0006`, `\u0007`,
81+
`\u0008`, `\u000E`, `\u000F`, `\u0010`, `\u0011`, `\u0012`, `\u0013`, `\u0014`,
82+
`\u0015`, `\u0016`, `\u0017`, `\u0018`, `\u0019`, `\u001A`, `\u001B`, `\u007F`,
83+
`\u0080`, `\u0081`, `\u0082`, `\u0083`, `\u0084`, `\u0086`, `\u0087`, `\u0088`,
84+
`\u0089`, `\u008A`, `\u008B`, `\u008C`, `\u008D`, `\u008E`, `\u008F`, `\u0090`,
85+
`\u0091`, `\u0092`, `\u0093`, `\u0094`, `\u0095`, `\u0096`, `\u0097`, `\u0098`,
86+
`\u0099`, `\u009A`, `\u009B`, `\u009C`, `\u009D`, `\u009E`, `\u009F`, `\u0024`,
87+
`\u00A2`, `\u00A3`, `\u00A4`, `\u00A5`, `\u00AD`, `\u0600`, `\u0601`, `\u0602`,
88+
`\u0603`, `\u0604`, `\u0605`, `\u061C`, `\u06DD`, `\u070F`, `\u08E2`, `\u180E`,
89+
`\u200B`, `\u200C`, `\u200D`, `\u200E`, `\u200F`, `\u202A`, `\u202B`, `\u202C`,
90+
`\u202D`, `\u202E`, `\u2060`, `\u2061`, `\u2062`, `\u2063`, `\u2064`, `\u2066`,
91+
`\u2067`, `\u2068`, `\u2069`, `\u206A`, `\u206B`, `\u206C`, `\u206D`, `\u206E`,
92+
`\u206F`, `\u2E2F`, `\uFEFF`, `\uFFF9`, `\uFFFA`, `\uFFFB`
9293

9394
a|
9495
label:functionality[]
@@ -186,6 +187,35 @@ For more information, see link:{neo4j-docs-base-uri}/operations-manual/current/d
186187
| Feature
187188
| Details
188189

190+
a|
191+
label:functionality[]
192+
label:updated[]
193+
[source, cypher, role="noheader"]
194+
----
195+
WITH 1 AS g
196+
RETURN COLLECT {
197+
UNWIND [1,2,3] AS x
198+
WITH * WHERE x < 0
199+
WITH count(*) AS agg
200+
RETURN agg + g
201+
} AS x
202+
----
203+
204+
a| Imported variables are now correctly handled as constants inside xref:subqueries/collect.adoc[`COLLECT`], xref:subqueries/count.adoc[`COUNT`], and xref:subqueries/existential.adoc[`EXISTS`] subquery expressions.
205+
The example query previously returned no results (`[]`) because the imported variable was used incorrectly as an implicit grouping key.
206+
It now returns `[1]`, since the variable is not used as a grouping key, allowing `count(*)` to return `0` and `0 + g` to evaluate to `1`.
207+
208+
a|
209+
label:functionality[]
210+
label:updated[]
211+
[source, cypher, role="noheader"]
212+
----
213+
RETURN $0hello
214+
----
215+
216+
a| Parameters can start with extended identifier characters (such as numbers), in line with the xref:appendix/gql-conformance/index.adoc[GQL] standard.
217+
For more information, see xref:syntax/parameters.adoc[].
218+
189219
a|
190220
label:functionality[]
191221
label:updated[]

modules/ROOT/pages/syntax/parameters.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Parameters cannot be used for the following constructs, as these form part of th
2626
* Relationship types; `MATCH (n)-[:$param]->(m)` is invalid.
2727
* Node labels; `MATCH (n:$param)` is invalid.
2828

29-
Parameters may consist of letters and numbers, and any combination of these, but cannot start with a number or a currency symbol.
29+
Parameter names can start with and contain underscores, letters, numbers, and combining marks such as accents (e.g., `é`).
30+
Currency symbols (e.g., `$` and `€`), non-printable Unicode control characters that only affect formatting (e.g., `\t` for Tab), punctuation (e.g., `!`), and whitespaces are not allowed in any position of a parameter name.
31+
For example, `$héllo`, `$0param`, and `$_param` are valid, while `$€value`, `$hello!`, and `$bad param` are not.
3032

3133
Setting parameters when running a query is dependent on the client environment.
3234
For example:

0 commit comments

Comments
 (0)