Skip to content

Commit

Permalink
expand on quantified rels
Browse files Browse the repository at this point in the history
  • Loading branch information
JPryce-Aklundh committed Nov 22, 2023
1 parent 54fd7b8 commit 555f2e5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/ROOT/pages/patterns/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -697,17 +697,20 @@ For example, the following quantified relationship:

[source, role=noheader]
----
()-[r]->{m,n}()
(:A)-[r:R]->{m,n}(:B)
----

is equivalent to the following quantified path pattern, with empty node patterns on either side:
is equivalent to the following quantified path pattern:

[source, role=noheader]
----
() (()-[r]->()){m,n} ()
(:A) (()-[r:R]->()){m,n} (:B)
----

However, unlike a quantified path pattern, a quantified relationship must always have a node pattern on each side.
With the expanded form of a quantified path pattern, it is possible to add predicates.
Conversely, if the only predicate is a relationship type expression, query syntax can be more concise using a quantified relationship.

Note that, unlike a quantified path pattern, a quantified relationship must always have a node pattern on each side.

[[quantified-relationship-examples]]
=== Examples
Expand Down Expand Up @@ -1130,7 +1133,7 @@ The following table shows variants of the variable-length quantifier syntax and

Note that `*` used here on its own is not the same as the Kleene star (an operator that represents zero or more repetitions), as the Kleene star has a lower bound of zero.
The above table can be used to translate the quantifier used in variable-length relationships.
The rules given for xref:patterns/reference.adoc#quantified-path-pattern[quantified path patterns] would apply to the translation.
The rules given for xref:patterns/reference.adoc#quantified-path-patterns[quantified path patterns] would apply to the translation.

This table shows some examples:

Expand Down

0 comments on commit 555f2e5

Please sign in to comment.