Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
* Appendix
** xref:styleguide.adoc[]
** xref:appendix/gql-conformance/index.adoc[]
*** xref:appendix/gql-conformance/supported-mandatory.adoc[]
*** xref:appendix/gql-conformance/unsupported-mandatory.adoc[]
*** xref:appendix/gql-conformance/supported-optional.adoc[]
*** xref:appendix/gql-conformance/analogous-cypher.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This page lists optional GQL features that have analogous but not identical Cyph
Optional GQL features are assigned a feature ID code.
These codes order the features in the table below.

[options="header",cols="a,3a,5a"]
[options="header",cols="2a,3a,5a"]
|===
| GQL Feature ID
| Description
Expand All @@ -16,16 +16,6 @@ These codes order the features in the table below.
| `ELEMENT_ID` function
| GQL's `ELEMENT_ID()` function is equivalent to Cypher's xref:functions/scalar.adoc#functions-elementid[`elementId()`] function.

| GF01
| Enhanced numeric functions
| GQL supports `CEILING()` as a synonym to the `CEIL()` function.
Cypher only supports xref:functions/mathematical-numeric.adoc#functions-ceil[`ceil()`].

| GF03
| Logarithmic functions
| * Cypher uses the xref:functions/mathematical-logarithmic.adoc#functions-log[`log()`] function instead of GQL's `LN()` function.
* Cypher uses the xref:syntax/operators.adoc#syntax-using-the-exponentiation-operator[exponentiation operator (`^`)] instead of GQL's `POWER()` function.

| GF04
| Enhanced path functions
| GQL's `PATH_LENGTH()` function is equivalent to Cypher's xref:functions/scalar.adoc#functions-length[`length()`] function.
Expand Down Expand Up @@ -69,25 +59,6 @@ Unlike the `FOR` statement, `UNWIND` does not support yielding indexes and offse
| 64-bit floating number
| GQL’s `FLOAT64` type is equivalent to Cypher’s xref:values-and-types/property-structural-constructed.adoc#_property_type_details[`FLOAT`] type.

| GV39
| xref:values-and-types/temporal.adoc[Temporal types: date, local datetime, and local time support]
| Cypher supports GQL’s local temporal types, with the following exceptions:

* GQL defines a parameterless version of the xref:functions/temporal/index.adoc#functions-date[`date()`] function not in Cypher: `CURRENT_DATE`.
* GQL’s `LOCAL_TIME()` function is equivalent to Cypher’s xref:functions/temporal/index.adoc#functions-localtime[`localtime()`] function.
GQL also defines a parameterless version of the function not in Cypher: `LOCAL_TIME`.
* GQL’s `LOCAL_DATETIME()` function is equivalent to Cypher’s xref:functions/temporal/index.adoc#functions-localdatetime[`localdatetime()`] function.
GQL also defines a parameterless version of the function not in Cypher: `LOCAL_DATETIME`.

| GV40
| xref:values-and-types/temporal.adoc[Temporal types: zoned datetime and zoned time support]
| Cypher supports GQL’s zoned temporal types, with the following exceptions:

* GQL’s `ZONED_TIME()` function is equivalent to Cypher’s xref:functions/temporal/index.adoc#functions-time[`time()`] function.
GQL also defines a parameterless version of the function not in Cypher: `CURRENT_TIME`.
* GQL’s `ZONED_DATETIME()` function is equivalent to Cypher’s xref:functions/temporal/index.adoc#functions-datetime[`datetime()`] function.
GQL also defines a parameterless version of the function not in Cypher: `CURRENT_TIMESTAMP`.

| GV45
| Record types
| GQL's open `RECORD` type is equivalent to the xref:values-and-types/maps.adoc[`MAP`] type in Cypher.
Expand Down
11 changes: 5 additions & 6 deletions modules/ROOT/pages/appendix/gql-conformance/index.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:description: Overview of Cypher's conformance to GQL.
= GQL conformance

*Last updated*: 11 June 2024 +
*Last updated*: 5 July 2024 +
*Neo4j version*: 5.21

GQL is the new link:https://www.iso.org/home.html[ISO] International Standard query language for graph databases.
Expand All @@ -19,16 +19,15 @@ WHERE a.name = 'Tom Hanks'
RETURN m.title
----

Neo4j is working towards full GQL conformance (meaning full support of its mandatory features).
There are, however, currently some mandatory GQL features not implemented in Cypher.
Cypher supports the majority of mandatory GQL features.
For a full list, see xref:appendix/gql-conformance/supported-mandatory.adoc[].
There are, however, currently a few mandatory GQL features not implemented in Cypher.
These are listed in the page xref:appendix/gql-conformance/unsupported-mandatory.adoc[].

Neo4j is also working towards increasing its support of optional GQL features.
These are listed in the page xref:appendix/gql-conformance/supported-optional.adoc[].

Additionally, some optional GQL features not yet implemented in Cypher already have analogous Cypher equivalents.
For example, Cypher and GQL support a function to return the local time.
In Cypher, this is called xref:functions/temporal/index.adoc#functions-localtime[`localtime()`]; in GQL, it is called `LOCAL_TIME()`.
These features are listed in the page xref:appendix/gql-conformance/analogous-cypher.adoc[].

[[gql-minimum-conformance]]
Expand All @@ -43,5 +42,5 @@ Neo4j 5.14 added support for JavaSE 21 and version 15 of the Unicode Standard.
For more information, see xref:syntax/parsing.adoc##_using_unicodes_in_cypher[Parsing -> Using Unicode in Cypher].
* Cypher supports the following mandatory GQL property types: `BOOLEAN` (`BOOL`), `FLOAT` footnote:[The `FLOAT` type in Cypher always represents a 64-bit double-precision floating point number.], `INTEGER` (`SIGNED INTEGER`, or `INT`)footnote:[The `INTEGER` type in Cypher always represents a 64-bit `INTEGER`.], and `STRING` (`VARCHAR`).
+
Cypher also supports: `DATE`, `DURATION`, `LIST<INNER_TYPE NOT NULL>` (`ARRAY<INNER_TYPE NOT NULL>`, `INNER_TYPE LIST`, or `INNER_TYPE ARRAY`)footnote:[The `INNER_TYPE` cannot be a `LIST` type.], `LOCAL DATETIME` (`TIMESTAMP WITHOUT TIMEZONE`), `LOCAL TIME` (`TIME WITHOUT TIME ZONE`), `POINT`, `ZONED DATETIME` (`TIME WITH TIMEZONE`), and `ZONED TIME` (`TIMESTAMP WITH TIMEZONE`).
Cypher also supports the following optional GQL property types: `DATE`, `DURATION`, `LIST<INNER_TYPE NOT NULL>` (`ARRAY<INNER_TYPE NOT NULL>`, `INNER_TYPE LIST`, or `INNER_TYPE ARRAY`)footnote:[The `INNER_TYPE` cannot be a `LIST` type.], `LOCAL DATETIME` (`TIMESTAMP WITHOUT TIMEZONE`), `LOCAL TIME` (`TIME WITHOUT TIME ZONE`), `POINT`, `ZONED DATETIME` (`TIME WITH TIMEZONE`), and `ZONED TIME` (`TIMESTAMP WITH TIMEZONE`).
For more information, see xref:values-and-types/property-structural-constructed.adoc#_property_types[Values and types -> property types].
231 changes: 231 additions & 0 deletions modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
:description: Information about mandatory GQL features supported by Cypher.
= Supported mandatory GQL features

Unlike optional GQL features, mandatory GQL features are not assigned a GQL feature ID code.
The below table is instead listed in order of their appearance in the link:https://www.iso.org/standard/76120.html[ISO/IEC 39075:2024(en) GQL Standard].

[options="header",cols="2a,3a,2a,5a"]
|===
| GQL Standard subclause
| Description
| Documentation
| Comment

| 4.11
| Graph pattern matching
| xref:patterns/index.adoc[]
|

| 4.13
| GQL object types
| xref:values-and-types/property-structural-constructed.adoc#structural-types[Structural types], xref:values-and-types/property-structural-constructed.adoc#type-synonyms[Types and their synonyms].
| Includes: `NODE` (`ANY NODE`, `VERTEX`, `ANY VERTEX`) and `RELATIONSHIP` (`ANY RELATIONSHIP`, `EDGE`, `ANY EDGE`).

| 4.16
| Predefined value types
| xref:values-and-types/property-structural-constructed.adoc#property-types[Property types], xref:values-and-types/property-structural-constructed.adoc#type-synonyms[Types and their synonyms].
| Includes: `BOOLEAN` (`BOOL`), `FLOAT`, `INTEGER` (`SIGNED INTEGER`, `INT`), and `STRING` (`VARCHAR`).

Cypher supports the boolean type predicate for `TRUE`, `FALSE`, and `NULL` but does not support the GQL keyword `UNKNOWN`.

| 13.2
| <insert statement>
| xref:clauses/create.adoc#insert-as-synonym-of-create[`INSERT`]
|

| 13.3
| <set statement>
| xref:clauses/set.adoc[`SET`]
| GQL’s `SET` has no order dependencies because all right-hand side operations are completed before any assignments occur.
In Cypher’s `SET`, the order of rows can affect the outcome because changes made during execution may depend on the sequence of assignments.
The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.adoc[`ORDER BY`].

| 13.4
| <remove statement>
| xref:clauses/remove.adoc[`REMOVE`]
|

| 13.5
| <delete statement>
| xref:clauses/delete.adoc[`DELETE`]
|

| 14.4
| <match statement>
| xref:clauses/match.adoc[`MATCH`], xref:clauses/optional-match.adoc[`OPTIONAL MATCH`]
|

| 14.9
| <order by and page statement>
| xref:clauses/skip.adoc[`SKIP`]
| Cypher only supports `SKIP`, which is a GQL-supported synonym to `OFFSET`.


| 14.10
| <primitive result statement>
| xref:clauses/finish.adoc[`FINISH`]
|

| 14.11
| <return statement>
| xref:clauses/return.adoc[`RETURN`]
|

| 15.1
| <call procedure statement> and <procedure call>
| xref:clauses/call.adoc[`CALL` procedures], xref:subqueries/call-subquery.adoc[`CALL` subqueries].
| GQL defines an `OPTIONAL CALL` statement, enabling optional procedure and subquery calling.
This is not available in Cypher.

| 15.2
| <inline procedure call>
| xref:subqueries/call-subquery.adoc[`CALL` subqueries].
| GQL either imports variables implicitly, or explicitly using a variable scope clause.
In Cypher, `CALL` subqueries require an explicit importing `WITH` clause.

| 15.3
| <named procedure call>
| xref:clauses/call.adoc[`CALL` procedure]
|

| 16.2
| <limit clause>
| xref:clauses/limit.adoc[`LIMIT`]
|

| 16.4
| <graph pattern>
| xref:patterns/reference.adoc#graph-patterns[Graph patterns]
|

| 16.5
| <insert graph pattern>
| xref:clauses/create.adoc#[`CREATE`]
|

| 16.6
| <order by clause>
| xref:clauses/order-by.adoc[`ORDER-BY`]
|

| 16.7
| <path pattern expression>
| xref:patterns/reference.adoc#path-patterns[Path patterns]
|

| 16.8
| <label expression>
| xref:patterns/reference.adoc#label-expressions[Label expressions]
|

| 16.9
| <path variable reference>
| xref:patterns/reference.adoc[Patterns -> Syntax and semantics]
|

| 16.11
| <graph pattern quantifier>
| xref:patterns/reference.adoc#quantifiers[Quantifiers]
|

| 16.17
| <sort specification list>
| xref:clauses/order-by.adoc#order-nodes-in-descending-order[Order results in ascending or descending order]
|

| 16.19
| <offset clause>
| xref:clauses/skip.adoc[`SKIP`]
| Cypher only supports `SKIP` , which is a GQL-supported synonym to `OFFSET`.

| 19.3
| <comparison predicate>
| xref:syntax/operators.adoc##query-operators-comparison[Comparison operators]
|

| 19.4
| <exists predicate>
| xref:functions/predicate.adoc#function-exists[`exists()`]
|

| 19.5
| <null predicate>
| xref:values-and-types/type-predicate.adoc#type-predicate-null[Type predicate expressions for `NULL`]
|

| 19.6
| <value type predicate>
| xref:values-and-types/type-predicate.adoc#[]
|

| 19.7
| <normalized predicate>
| xref:syntax/operators.adoc#match-string-is-normalized[`IS NORMALIZED`], xref:syntax/operators.adoc#match-string-is-not-normalized[`IS NOT NORMALIZED`]
|

| 20.2
| <value expression primary>
| xref:queries/expressions.adoc[]
|

| 20.3
| <value specification>
|
| GQL defines the `SESSION_USER` value expression, which enables accessing a user’s username within a query.
In Cypher, current user details can be seen using the link:{neo4j-docs-base-uri}/operations-manual/{page-version}/authentication-authorization/manage-users/#access-control-current-users[`SHOW CURRENT USER` command].

| 20.7
| <case expression>
| xref:queries/case.adoc[`CASE`], xref:functions/scalar.adoc#functions-nullIf[`nullIf()`], xref:functions/scalar.adoc#functions-coalesce[`coalesce()`]
|

| 20.9
| <aggregate function>
| xref:functions/aggregating.adoc#functions-avg[`avg()`], xref:functions/aggregating.adoc#functions-count[`count()`], xref:functions/aggregating.adoc#functions-max[`max`], xref:functions/aggregating.adoc#functions-mind[`min()`], xref:functions/aggregating.adoc#functions-sum[`sum()`]
| Cypher and GQL handle `NULL` values differently for the `sum()` function when queries return 0 rows.
For example, `RETURN sum(<expr>)` on an empty table returns `NULL` in GQL, but in Cypher it returns `0`.

| 20.11
| <property reference>
| xref:queries/concepts.adoc[Core concepts]
|

| 20.21
| <numeric value expression>
| xref:syntax/operators.adoc#query-operators-mathematical[Mathematical operators]
|

| 20.22
| <numeric value function>
| xref:functions/scalar.adoc#functions-char_length[`char_length()`], xref:functions/scalar.adoc#functions-character_length[`character_length()`]
|

| 20.23
| <string value expression>
| xref:syntax/operators.adoc#syntax-concatenating-two-strings-doublebar[`STRING` concatenation operator (`\|\|`)]
|

| 20.24
| <character string function>
| xref:functions/string.adoc#functions-left[`left()`], xref:functions/string.adoc#functions-lower[`lower()`], xref:functions/string.adoc#functions-normalize[`normalize()`], xref:functions/string.adoc#functions-right[`right()`], xref:functions/string.adoc#functions-trim[`trim()`], xref:functions/string.adoc#functions-upper[`upper()`]
| In GQL, `TRIM()` removes only space characters.
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:

* 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.

| 22.15
| Grouping operations
| xref:functions/aggregating.adoc##counting_with_and_without_duplicates[Counting with and without duplicates]
|

|===

Loading