From 89c81196fe5381ed5048c0a980ad287be61d1f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:56:51 +0200 Subject: [PATCH] prototype --- modules/ROOT/pages/clauses/with.adoc | 15 +++++++++++++++ modules/ROOT/pages/introduction/index.adoc | 22 ++++++++++++++++++---- modules/ROOT/pages/patterns/index.adoc | 5 +++++ modules/ROOT/pages/queries/index.adoc | 8 ++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/modules/ROOT/pages/clauses/with.adoc b/modules/ROOT/pages/clauses/with.adoc index 7060b7889..3157f7510 100644 --- a/modules/ROOT/pages/clauses/with.adoc +++ b/modules/ROOT/pages/clauses/with.adoc @@ -202,6 +202,11 @@ For more information, see xref:subqueries/call-subquery.adoc#import-variables[`C == Bind values to variables `WITH` can be used to assign the values of expressions to variables. + +[TIP] +Cypher 25 introduces the `LET` clause which binds variables to expression results and can allow for a more succinct and readable alternative to `WITH`. +For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/let/[Cypher 25 Manual -> `LET`]. + In the below query, the value of the `STRING` concatenation expression is bound to a new variable `customerFullName`, and the value from the expression `chocolate.price * (1 - customer.discount)` is bound to `chocolateNetPrice`, both of which are then available in the `RETURN` clause. .Bind values to variables @@ -466,6 +471,11 @@ RETURN p.name AS product, `WITH` can be followed by the xref:clauses/where.adoc[`WHERE`] subclause to filter results. Similar to the subclauses used for xref:clauses/with.adoc#ordering-pagination[ordering and pagination], `WHERE` should be understood as part of the result manipulation performed by `WITH` -- not as a standalone clause -- before the results are passed on to subsequent clauses. +[TIP] +Cypher 25 introduces the `FILTER` clause to filter queries. +`FILTER` can be used as a more concise substitute for `WITH * WHERE ` constructs. +For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/filter/[Cypher 25 Manual -> `FILTER`]. + .Filter using `WITH` and `WHERE` [source, cypher] ---- @@ -520,6 +530,11 @@ RETURN s.name AS supplier, If a write clause is followed by a read clause, `WITH` must be used as a separator between the two. +[TIP] +Cypher 25 removes the need to use `WITH` as a separator between write and read clauses. +For more information, see link:https://neo4j.com/docs/cypher-manual/25/clauses/with/[Cypher 25 Manual -> `WITH`]. + + .`WITH` used as a separator between a write clause and a read clause // tag::clauses_with_combine_write_read[] [source, cypher] diff --git a/modules/ROOT/pages/introduction/index.adoc b/modules/ROOT/pages/introduction/index.adoc index 01fef1f03..adc48d096 100644 --- a/modules/ROOT/pages/introduction/index.adoc +++ b/modules/ROOT/pages/introduction/index.adoc @@ -7,13 +7,27 @@ ifndef::backend-pdf[] :description: This section provides an introduction to the Cypher query language. endif::[] -Welcome to the Neo4j Cypher Manual. +Welcome to the Neo4j Cypher Manual. -Cypher is Neo4j’s declarative query language, allowing users to unlock the full potential of property graph databases. +Cypher is Neo4j’s declarative query language, allowing users to unlock the full potential of property graph databases. -The Cypher Manual aims to be as instructive as possible to readers from a variety of backgrounds and professions, such as developers, administrators, and academic researchers. +[NOTE] +==== +This manual covers Cypher 5 -- the default language for Neo4j databases. +As of Neo4j, Cypher 5 is in a frozen state. +That is, no new features will be added to it (only bug fixes and performance improvements). +Cypher 25 was released with Neo4j 2025.06. +From this release on, all new Cypher features will be exclusively added to Cypher 25. +For more details, see: -If you are new to Cypher and Neo4j, you can visit the link:{neo4j-docs-base-uri}/getting-started/current/cypher-intro/[Getting Started Guide -> Introduction to Cypher] chapter. +* link:...[Select Cypher versions] +* link:https://neo4j.com/docs/cypher-manual/25/introduction/[Cypher 25 Manual] +* link:https://neo4j.com/docs/cypher-manual/25/deprecations-additions-removals-compatibility/[Cypher 25 Manual -> Deprecations, additions, and compatibility] +==== + +The Cypher Manual aims to be as instructive as possible to readers from a variety of backgrounds and professions, such as developers, administrators, and academic researchers. + +If you are new to Cypher and Neo4j, you can visit the link:{neo4j-docs-base-uri}/getting-started/current/cypher-intro/[Getting Started Guide -> Introduction to Cypher] chapter. Additionally, https://graphacademy.neo4j.com/[Neo4j GraphAcademy] has a variety of free courses tailored for all levels of experience. For a reference of all available Cypher features, see the link:{neo4j-docs-base-uri}/cypher-cheat-sheet/current/[Cypher Cheat Sheet]. diff --git a/modules/ROOT/pages/patterns/index.adoc b/modules/ROOT/pages/patterns/index.adoc index c4b480a2e..1fe9bd029 100644 --- a/modules/ROOT/pages/patterns/index.adoc +++ b/modules/ROOT/pages/patterns/index.adoc @@ -28,5 +28,10 @@ This chapter includes the following sections: * xref:patterns/non-linear-patterns.adoc[] - information about equijoins and graph patterns (combined path patterns). * xref:patterns/reference.adoc[] - a reference for looking up the syntax and semantics of graph pattern matching. +[TIP] +Cypher 25 introduces the ability to specify different match modes. +For more information, see the link:https://neo4j.com/docs/cypher-manual/25/patterns/match-modes/[Cypher 25 Manual -> Match modes]. + + The model data in the examples used in this chapter are based on the UK national rail network, using https://www.raildeliverygroup.com/our-services/rail-data/fares-timetable-data.html[publicly available datasets]. diff --git a/modules/ROOT/pages/queries/index.adoc b/modules/ROOT/pages/queries/index.adoc index c6abd82a7..e6db908e5 100644 --- a/modules/ROOT/pages/queries/index.adoc +++ b/modules/ROOT/pages/queries/index.adoc @@ -8,3 +8,11 @@ It also discusses how to compose combined queries using `UNION`. * xref:queries/basic.adoc[] * xref:queries/combined-queries.adoc[] +[TIP] +==== +Cypher 25 introduces conditional and sequential queries. +For more information, see the following pages in the Cypher 25 Manual: + +* link:https://neo4j.com/docs/cypher-manual/25/queries/composed-queries/conditional-queries/[Conditional queries (`WHEN`)] +* link:https://neo4j.com/docs/cypher-manual/25/queries/composed-queries/sequential-queries/[Sequential queries (`NEXT`)] +====