diff --git a/modules/ROOT/content-nav.adoc b/modules/ROOT/content-nav.adoc index 02c4fb3f8..5b947b624 100644 --- a/modules/ROOT/content-nav.adoc +++ b/modules/ROOT/content-nav.adoc @@ -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[] diff --git a/modules/ROOT/pages/appendix/gql-conformance/analogous-cypher.adoc b/modules/ROOT/pages/appendix/gql-conformance/analogous-cypher.adoc index a121d65a8..0a13525c5 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/analogous-cypher.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/analogous-cypher.adoc @@ -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 @@ -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. @@ -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. diff --git a/modules/ROOT/pages/appendix/gql-conformance/index.adoc b/modules/ROOT/pages/appendix/gql-conformance/index.adoc index ce4f56276..4c4da7984 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*: 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. @@ -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]] @@ -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` (`ARRAY`, `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` (`ARRAY`, `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]. diff --git a/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc new file mode 100644 index 000000000..42cd41056 --- /dev/null +++ b/modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc @@ -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 +| +| xref:clauses/create.adoc#insert-as-synonym-of-create[`INSERT`] +| + +| 13.3 +| +| 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 +| +| xref:clauses/remove.adoc[`REMOVE`] +| + +| 13.5 +| +| xref:clauses/delete.adoc[`DELETE`] +| + +| 14.4 +| +| xref:clauses/match.adoc[`MATCH`], xref:clauses/optional-match.adoc[`OPTIONAL MATCH`] +| + +| 14.9 +| +| xref:clauses/skip.adoc[`SKIP`] +| Cypher only supports `SKIP`, which is a GQL-supported synonym to `OFFSET`. + + +| 14.10 +| +| xref:clauses/finish.adoc[`FINISH`] +| + +| 14.11 +| +| xref:clauses/return.adoc[`RETURN`] +| + +| 15.1 +| and +| 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 +| +| 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 +| +| xref:clauses/call.adoc[`CALL` procedure] +| + +| 16.2 +| +| xref:clauses/limit.adoc[`LIMIT`] +| + +| 16.4 +| +| xref:patterns/reference.adoc#graph-patterns[Graph patterns] +| + +| 16.5 +| +| xref:clauses/create.adoc#[`CREATE`] +| + +| 16.6 +| +| xref:clauses/order-by.adoc[`ORDER-BY`] +| + +| 16.7 +| +| xref:patterns/reference.adoc#path-patterns[Path patterns] +| + +| 16.8 +|