From a532b28188e579a73a4ad6775d071477774a1c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:23:05 +0200 Subject: [PATCH 1/3] fix queries --- modules/ROOT/pages/clauses/use.adoc | 6 +++--- modules/ROOT/pages/patterns/match-modes.adoc | 11 +++++------ .../queries/composed-queries/sequential-queries.adoc | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index 68799cdfd..d4c489556 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -73,8 +73,8 @@ In subqueries, a `USE` clause may appear directly following the xref:subqueries/ [source, cypher, role=test-setup] ---- CREATE DATABASE myDatabase; -CREATE COMPOSITE DATABASE `myComposite`; -CREATE ALIAS `myComposite`.`myConstituent` FOR DATABASE `myDatabase`; +CREATE COMPOSITE DATABASE myComposite; +CREATE ALIAS myComposite.myConstituent FOR DATABASE myDatabase; ---- //// @@ -117,7 +117,7 @@ This example uses a composite database named `myComposite` that includes an alia .Query [source, cypher] ---- -USE graph.byName('myComposite.myConstituent') +USE graph.byName(myComposite.myConstituent) MATCH (n) RETURN n ---- diff --git a/modules/ROOT/pages/patterns/match-modes.adoc b/modules/ROOT/pages/patterns/match-modes.adoc index 0385bd384..29b283bc6 100644 --- a/modules/ROOT/pages/patterns/match-modes.adoc +++ b/modules/ROOT/pages/patterns/match-modes.adoc @@ -181,11 +181,10 @@ The next example matches paths starting and ending at the same `Location` (`Knei ---- MATCH REPEATABLE ELEMENTS p = (start:Location {name: 'Kneiphof'})-[:BRIDGE]-{,9}(start) // <1> WHERE all(bridge IN range(1,7) WHERE bridge IN [r IN relationships(p) | r.id]) // <2> -WITH p -ORDER BY length(p) -LIMIT 1 RETURN [n IN nodes(p) | n.name] AS visitedLocations, [r IN relationships(p) | r.id] AS crossedBridges +ORDER BY length(p), crossedBridges +LIMIT 1 ---- <1> Paths with a length of less than 9 relationships return no results because they do not allow enough moves to traverse all seven bridges at least once while forming a cycle back to Kneiphof. @@ -196,13 +195,13 @@ RETURN [n IN nodes(p) | n.name] AS visitedLocations, |=== | visitedLocations | crossedBridges -| ["Kneiphof", "South Bank", "Kneiphof", "South Bank", "Lomse", "Kneiphof", "North Bank", "Lomse", "North Bank", "Kneiphof"] -| [4, 6, 4, 3, 7, 5, 2, 2, 1] +| ["Kneiphof", "North Bank", "Kneiphof", "South Bank", "Lomse", "North Bank", "Kneiphof", "South Bank", "Lomse", "Kneiphof"] +| [1, 1, 4, 3, 2, 5, 6, 3, 7] 2+d|Rows: 1 |=== -The order of the bridges traversed in the path returned demonstrates that bridges `2` and `4` were crossed twice in order to return to `Kneiphof`. +The order of the bridges traversed in the path returned demonstrates that bridges `1` and `3` were crossed twice in order to return to `Kneiphof`. image::repeatable-elements-graph.svg[Several graphs showing order of traversals when using repeatable elements match mode, width=600, role=popup] _Sequence of bridge traversals when using `REPEATABLE ELEMENTS`._ diff --git a/modules/ROOT/pages/queries/composed-queries/sequential-queries.adoc b/modules/ROOT/pages/queries/composed-queries/sequential-queries.adoc index 6a0f33ca0..72f714b05 100644 --- a/modules/ROOT/pages/queries/composed-queries/sequential-queries.adoc +++ b/modules/ROOT/pages/queries/composed-queries/sequential-queries.adoc @@ -65,7 +65,7 @@ CREATE (techCorp:Supplier {name: 'TechCorp', email: 'contact@techcorp.com'}), == Syntax .`NEXT` syntax -[source, cypher] +[source, syntax] ---- From 097f93208f0bc7c70f7d249c8006a6e92ecad2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:39:10 +0200 Subject: [PATCH 2/3] mistake, maybe --- modules/ROOT/pages/clauses/use.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/clauses/use.adoc b/modules/ROOT/pages/clauses/use.adoc index d4c489556..69d43792d 100644 --- a/modules/ROOT/pages/clauses/use.adoc +++ b/modules/ROOT/pages/clauses/use.adoc @@ -117,7 +117,7 @@ This example uses a composite database named `myComposite` that includes an alia .Query [source, cypher] ---- -USE graph.byName(myComposite.myConstituent) +USE graph.byName('myComposite.myConstituent') MATCH (n) RETURN n ---- From dde9199fb4af526fe3225e8c2570da6b8fd0dadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20Pryce-=C3=85klundh?= <112686610+JPryce-Aklundh@users.noreply.github.com> Date: Tue, 17 Jun 2025 15:34:11 +0200 Subject: [PATCH 3/3] update graph to go with new query --- .../ROOT/images/repeatable-elements-graph.svg | 132 +++++++++--------- 1 file changed, 68 insertions(+), 64 deletions(-) diff --git a/modules/ROOT/images/repeatable-elements-graph.svg b/modules/ROOT/images/repeatable-elements-graph.svg index f85e06d7f..f3f02d4fb 100644 --- a/modules/ROOT/images/repeatable-elements-graph.svg +++ b/modules/ROOT/images/repeatable-elements-graph.svg @@ -1,48 +1,44 @@ - - + + + + - - - - + - - + + - - - - + + - - - - + + + + - - + @@ -50,16 +46,15 @@ - - - - - - - + + + + + + + - - + @@ -67,17 +62,16 @@ - - - + + + - - - - + + + + - - + @@ -85,14 +79,13 @@ - - - - + + + + - - - + + @@ -100,17 +93,15 @@ - - - + + - - - + + - + - + @@ -119,17 +110,15 @@ - - - - - + + + - + - + - + @@ -139,10 +128,10 @@ - + - + @@ -152,7 +141,16 @@ - + + + + + + + + + + @@ -172,10 +170,16 @@ - - + + + + + + + +