diff --git a/modules/ROOT/pages/appendix/gql-conformance/index.adoc b/modules/ROOT/pages/appendix/gql-conformance/index.adoc index b269905ad..718d85745 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/index.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/index.adoc @@ -1,7 +1,7 @@ :description: Overview of Cypher's conformance to GQL. = GQL conformance -*Last updated*: 2 June 2025 + +*Last updated*: 18 June 2025 + *Neo4j version*: 2025.06 GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases. diff --git a/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc index 12bfb44a1..f76c5ca04 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc @@ -211,10 +211,8 @@ In Cypher, `trim()` removes any whitespace character. | 21.1 | Names and variables | xref:syntax/index.adoc[] -| Cypher supports GQL’s lexical elements, with the following caveats: +| Cypher supports GQL’s lexical elements, with the following caveat: -* GQL allows for extended parameter identifiers. -For example: `RETURN $0hello` is allowed in GQL but not Cypher. * GQL allows identifiers that are not variables to be delimited with both backticks and quotes. Cypher only allows backticks. For example: `MATCH (n) RETURN n."a prop"` is allowed in GQL but not Cypher. diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index 59798c060..61354701b 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -59,10 +59,10 @@ label:removed[] RETURN 1 as my\u0085identifier ---- a| -The Unicode character \`\u0085` has been removed for unescaped identifiers and is now considered a whitespace character. -To continue using it, escape the identifier by adding backticks around it. +The Unicode character `\u0085` (`Next Line`) has been removed for unescaped identifiers and is now considered a whitespace character. +To continue using it, escape the identifier by adding backticks (++``++) around it. 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`. +In the given example, the quoted identifier would be `my\u0085identifier`. a| label:functionality[] @@ -72,23 +72,24 @@ label:removed[] RETURN 1 as my$Identifier ---- a| -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. -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`. +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. +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`. The following Unicode Characters are removed in identifiers: -'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007', -'\u0008', '\u000E', '\u000F', '\u0010', '\u0011', '\u0012', '\u0013', '\u0014', -'\u0015', '\u0016', '\u0017', '\u0018', '\u0019', '\u001A', '\u001B', '\u007F', -'\u0080', '\u0081', '\u0082', '\u0083', '\u0084', '\u0086', '\u0087', '\u0088', -'\u0089', '\u008A', '\u008B', '\u008C', '\u008D', '\u008E', '\u008F', '\u0090', -'\u0091', '\u0092', '\u0093', '\u0094', '\u0095', '\u0096', '\u0097', '\u0098', -'\u0099', '\u009A', '\u009B', '\u009C', '\u009D', '\u009E', '\u009F', '\u0024', -'\u00A2', '\u00A3', '\u00A4', '\u00A5', '\u00AD', '\u0600', '\u0601', '\u0602', -'\u0603', '\u0604', '\u0605', '\u061C', '\u06DD', '\u070F', '\u08E2', '\u180E', -'\u200B', '\u200C', '\u200D', '\u200E', '\u200F', '\u202A', '\u202B', '\u202C', -'\u202D', '\u202E', '\u2060', '\u2061', '\u2062', '\u2063', '\u2064', '\u2066', -'\u2067', '\u2068', '\u2069', '\u206A', '\u206B', '\u206C', '\u206D', '\u206E', -'\u206F', '\u2E2F', '\uFEFF', '\uFFF9', '\uFFFA', '\uFFFB' +`\u0000`, `\u0001`, `\u0002`, `\u0003`, `\u0004`, `\u0005`, `\u0006`, `\u0007`, +`\u0008`, `\u000E`, `\u000F`, `\u0010`, `\u0011`, `\u0012`, `\u0013`, `\u0014`, +`\u0015`, `\u0016`, `\u0017`, `\u0018`, `\u0019`, `\u001A`, `\u001B`, `\u007F`, +`\u0080`, `\u0081`, `\u0082`, `\u0083`, `\u0084`, `\u0086`, `\u0087`, `\u0088`, +`\u0089`, `\u008A`, `\u008B`, `\u008C`, `\u008D`, `\u008E`, `\u008F`, `\u0090`, +`\u0091`, `\u0092`, `\u0093`, `\u0094`, `\u0095`, `\u0096`, `\u0097`, `\u0098`, +`\u0099`, `\u009A`, `\u009B`, `\u009C`, `\u009D`, `\u009E`, `\u009F`, `\u0024`, +`\u00A2`, `\u00A3`, `\u00A4`, `\u00A5`, `\u00AD`, `\u0600`, `\u0601`, `\u0602`, +`\u0603`, `\u0604`, `\u0605`, `\u061C`, `\u06DD`, `\u070F`, `\u08E2`, `\u180E`, +`\u200B`, `\u200C`, `\u200D`, `\u200E`, `\u200F`, `\u202A`, `\u202B`, `\u202C`, +`\u202D`, `\u202E`, `\u2060`, `\u2061`, `\u2062`, `\u2063`, `\u2064`, `\u2066`, +`\u2067`, `\u2068`, `\u2069`, `\u206A`, `\u206B`, `\u206C`, `\u206D`, `\u206E`, +`\u206F`, `\u2E2F`, `\uFEFF`, `\uFFF9`, `\uFFFA`, `\uFFFB` a| label:functionality[] @@ -186,6 +187,35 @@ For more information, see link:{neo4j-docs-base-uri}/operations-manual/current/d | Feature | Details +a| +label:functionality[] +label:updated[] +[source, cypher, role="noheader"] +---- +WITH 1 AS g +RETURN COLLECT { + UNWIND [1,2,3] AS x + WITH * WHERE x < 0 + WITH count(*) AS agg + RETURN agg + g +} AS x +---- + +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. +The example query previously returned no results (`[]`) because the imported variable was used incorrectly as an implicit grouping key. +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`. + +a| +label:functionality[] +label:updated[] +[source, cypher, role="noheader"] +---- +RETURN $0hello +---- + +a| Parameters can start with extended identifier characters (such as numbers), in line with the xref:appendix/gql-conformance/index.adoc[GQL] standard. +For more information, see xref:syntax/parameters.adoc[]. + a| label:functionality[] label:updated[] diff --git a/modules/ROOT/pages/syntax/parameters.adoc b/modules/ROOT/pages/syntax/parameters.adoc index 2ffe9de69..1820abd17 100644 --- a/modules/ROOT/pages/syntax/parameters.adoc +++ b/modules/ROOT/pages/syntax/parameters.adoc @@ -26,7 +26,9 @@ Parameters cannot be used for the following constructs, as these form part of th * Relationship types; `MATCH (n)-[:$param]->(m)` is invalid. * Node labels; `MATCH (n:$param)` is invalid. -Parameters may consist of letters and numbers, and any combination of these, but cannot start with a number or a currency symbol. +Parameter names can start with and contain underscores, letters, numbers, and combining marks such as accents (e.g., `é`). +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. +For example, `$héllo`, `$0param`, and `$_param` are valid, while `$€value`, `$hello!`, and `$bad param` are not. Setting parameters when running a query is dependent on the client environment. For example: