Skip to content

Commit 5fb0c7e

Browse files
committed
update documentation of graph references in Cypher 25
1 parent 42388d1 commit 5fb0c7e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

modules/ROOT/pages/values-and-types/graph-references.adoc

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ These include:
2626
[[rules]]
2727
== Rules
2828

29-
The following rules apply for graph references when using identifiers (static graph references, administration commands) or the `graph.byName` functions:
30-
31-
* Unquoted dots are separators between a composite database and its constituent.
32-
For example, `composite.db1` represents the constituent `composite.db1` in the composite database `composite`.
33-
To refer to a database with a dot (`.`) in its name, quote the graph reference instead: `++`composite.db1`++`.
34-
* When resolving a graph reference within a graph function, the string argument is parsed like a static graph reference.
35-
Thus, `USE graph.byName(<graph-reference>)` is typically equivalent to `USE <graph-reference>`.
36-
However, escaping rules for xref::syntax/naming.adoc#symbolic-names-escaping-rules[symbolic names] are applied to the argument.
37-
For `STRING` literals, both the xref:values-and-types/boolean-numeric-string.adoc#string-literal-escape-sequences[escaping rules] (during query parsing) and xref::syntax/naming.adoc#symbolic-names-escaping-rules[symbolic names] (during graph reference evaluation) are applied.
38-
For example, the graph reference in `USE graph.byName('+composite.1\\u0041+')` resolves to the constituent `composite.1a` of the composite database `composite`.
29+
The following rules apply for graph references when using identifiers (static graph references, administration commands) or the `graph.byName` functions.
30+
31+
`USE graph.byName(<graph-reference>)` is typically equivalent to `USE <graph-reference>`. There may be differences if the name contains special characters:
32+
33+
* Graph references passed as identifiers such as `USE <graph-reference>` apply the escaping rules of xref::syntax/naming.adoc#symbolic-names-escaping-rules[symbolic names]. Graph names can either be unquoted or need to be quoted in its entirety, e.g. `USE neo4j` or `USE `db-with-dash``.
34+
35+
* Graph references passed as graph functions such as `USE graph.byName(<graph-reference>)` apply the escaping rules of xref:values-and-types/boolean-numeric-string.adoc#string-literal-escape-sequences[string literals]. Note that quotes are considered as part of the name, e.g. `USE graph.byName('`db-with-dash`') would try to resolve the graph reference ``db-with-dash``.
36+
37+
38+
For example, the graph reference `db-with-dash` can be passed as:
39+
40+
* `USE `db-with-dash``
41+
* `USE graph.byName('db-with-dash')`
42+
* `USE graph.byName($param)` with parameter `db-with-dash`

0 commit comments

Comments
 (0)