Skip to content

Commit e81a677

Browse files
final expressions initial
1 parent b4e5c80 commit e81a677

27 files changed

+161
-151
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@
5656
5757
* xref:values-and-types/index.adoc[]
5858
** xref:values-and-types/property-structural-constructed.adoc[]
59+
** xref:values-and-types/numeric-string-boolean.adoc[]
5960
** xref:values-and-types/temporal.adoc[]
6061
** xref:values-and-types/spatial.adoc[]
6162
** xref:values-and-types/working-with-null.adoc[]
6263
** xref:values-and-types/lists.adoc[]
6364
** xref:values-and-types/maps.adoc[]
6465
** xref:values-and-types/casting-data.adoc[]
6566
** xref:values-and-types/ordering-equality-comparison.adoc[]
67+
** xref:values-and-types/graph-references.adoc[]
68+
6669
6770
* xref:expressions/index.adoc[]
68-
** xref:expressions/expressions-overview.adoc[]
6971
** xref:expressions/predicates/index.adoc[]
7072
*** xref:expressions/predicates/boolean-operators.adoc[]
7173
*** xref:expressions/predicates/comparison-operators.adoc[]
@@ -135,7 +137,6 @@
135137
** xref:syntax/variables.adoc[]
136138
** xref:syntax/keywords.adoc[]
137139
** xref:syntax/parameters.adoc[]
138-
** xref:syntax/operators.adoc[]
139140
** xref:syntax/comments.adoc[]
140141
141142
* xref:deprecations-additions-removals-compatibility.adoc[]

modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ GQL supports `GRAPH TYPES` as a way of constraining a graph schema, but does not
620620
| Cypher feature
621621
| Description
622622

623-
| xref:syntax/operators.adoc#query-operator-comparison-string-specific[`STARTS WITH`, `CONTAINS`, `ENDS WITH`, and regular expressions].
623+
| xref:expressions/predicates/string-operators.adoc[`STARTS WITH`, `CONTAINS`, `ENDS WITH`, and regular expressions].
624624
| `STRING` comparison operators.
625625

626626
| xref:expressions/predicates/list-operators.adoc[`IN`]

modules/ROOT/pages/appendix/gql-conformance/supported-mandatory.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.ado
132132

133133
| 19.3
134134
| <comparison predicate>
135-
| xref:syntax/operators.adoc##query-operators-comparison[Comparison operators]
135+
| xref:expressions/predicates/comparison-operators.adoc[Comparison operators]
136136
|
137137

138138
| 19.4
@@ -152,12 +152,12 @@ The only way to guarantee row order in Neo4j is to use xref:clauses/order-by.ado
152152

153153
| 19.7
154154
| <normalized predicate>
155-
| xref:syntax/operators.adoc#match-string-is-normalized[`IS NORMALIZED`], xref:syntax/operators.adoc#match-string-is-not-normalized[`IS NOT NORMALIZED`]
155+
| xref:expressions/predicates/string-operators.adoc#string-normalization-operators[`IS NORMALIZED`,`IS NOT NORMALIZED`]
156156
|
157157

158158
| 20.2
159159
| <value expression primary>
160-
| xref:expressions/expressions-overview.adoc[]
160+
| xref:expressions/index.adoc[]
161161
|
162162

163163
| 20.3
@@ -194,7 +194,7 @@ For example, `RETURN sum(<expr>)` on an empty table returns `NULL` in GQL, but i
194194

195195
| 20.23
196196
| <string value expression>
197-
| xref:syntax/operators.adoc#syntax-concatenating-two-strings-doublebar[`STRING` concatenation operator (`\|\|`)]
197+
| xref:expressions/string-operators.adoc[`STRING` concatenation operator (`\|\|`)]
198198
|
199199

200200
| 20.24

modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Cypher only supports xref:functions/mathematical-numeric.adoc#functions-ceil[`ce
128128
| Note the following exceptions:
129129

130130
* Cypher uses the xref:functions/mathematical-logarithmic.adoc#functions-log[`log()`] function instead of GQL's `LN()` function.
131-
* Cypher uses the xref:syntax/operators.adoc#syntax-using-the-exponentiation-operator[exponentiation operator (`^`)] instead of GQL's `POWER()` function.
131+
* Cypher uses the xref:expressions/mathematical-operators.adoc[exponentiation operator (`^`)] instead of GQL's `POWER()` function.
132132

133133
| GF05
134134
| Multi-character trim functions

modules/ROOT/pages/clauses/match.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ RETURN p.name AS actor, r.role AS role
370370
----
371371

372372
[NOTE]
373-
The above query uses the xref:syntax/operators.adoc#query-operator-comparison-string-specific[`CONTAINS` operator].
373+
The above query uses the xref:expressions/predicates/string-operators.adoc[`CONTAINS` operator].
374374

375375
.Result
376376
[role="queryresult",options="header,footer",cols="2*<m"]

modules/ROOT/pages/clauses/order-by.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
`ORDER BY` specifies how the output of a clause should be sorted.
77
It be used as a sub-clause following `RETURN` or `WITH`.
88

9-
`ORDER BY` relies on comparisons to sort the output, see xref::syntax/operators.adoc#cypher-ordering[Ordering and comparison of values].
9+
`ORDER BY` relies on comparisons to sort the output, see xref:values-and-types/ordering-equality-comparison.adoc[Ordering and comparison of values].
1010
You can sort on many different values, e.g. node/relationship properties, the node/relationship ids, or on most expressions.
1111

1212
[NOTE]

modules/ROOT/pages/clauses/use.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ When connected to a composite database, a graph reference may additionally be pa
2525

2626
* The graph function xref:functions/graph.adoc#functions-graph-byname[`graph.byName()`], which allows the graph reference to be resolved dynamically: `USE graph.byName(<string-expression>)`.
2727

28-
A more detailed description of how and when a graph references needs to be quoted and/or escaped is defined xref::expressions/expressions-overview.adoc#graphreferences[here].
28+
A more detailed description of how and when a graph references needs to be quoted and/or escaped is defined xref::values-and-types/graph-references.adoc#rules[here].
2929

3030
== USE clause when connected to a standard or system database
3131

modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ USE graph.byName('tom`s-database')
173173
174174
USE graph.propertiesByName('database.with.dot')
175175
----
176-
| xref::expressions/expressions-overview.adoc#graphreferences[Graph references] in arguments of the functions xref:functions/graph.adoc#functions-graph-byname[`graph.byName`] and xref:functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName`] in Cypher 25 are parsed as `<symbolic-name>` or `<symbolic-name>.<symbolic-name>` and now support escaping names.
176+
| xref::values-and-types/graph-references.adoc[Graph references] in arguments of the functions xref:functions/graph.adoc#functions-graph-byname[`graph.byName`] and xref:functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName`] in Cypher 25 are parsed as `<symbolic-name>` or `<symbolic-name>.<symbolic-name>` and now support escaping names.
177177
For more information, see xref:syntax/expressions.adoc#graph-references[Cypher expressions -> Graph references].
178178
Graph name parts that contain unsupported characters for unescaped symbolic names now require backtick quoting.
179179
Graph name parts with special characters may require additional escaping of those characters:
@@ -1152,7 +1152,7 @@ RETURN "Hello" \|\| " " \|\| "World";
11521152
11531153
RETURN [1, 2] \|\| [3, 4, 5];
11541154
----
1155-
| Added a new `STRING` and `LIST` xref:syntax/operators.adoc[concatenation operator].
1155+
| Added a new `STRING` and `LIST` xref:expressions/string-operators.adoc[concatenation operator].
11561156

11571157
a|
11581158
label:functionality[]
@@ -1353,7 +1353,7 @@ IS [NOT] [NFC \| NFD \| NFKC \| NFKD] NORMALIZED
13531353
RETURN "string" IS NORMALIZED
13541354
----
13551355

1356-
| Introduction of an xref::syntax/operators.adoc#match-string-is-normalized[IS NORMALIZED] operator.
1356+
| Introduction of an xref::expressions/predicates/string-operators.adoc#string-normalization-operator[IS NORMALIZED] operator.
13571357
The operator can be used to check if a `STRING` is normalized according to the specified normalization form, which can be of type `NFC`, `NFD`, `NFKC`, or `NFKD`.
13581358

13591359
a|

modules/ROOT/pages/expressions/conditional-expressions.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ implied equals (`=`) comparator.
106106

107107
The supported comparators are:
108108

109-
* xref::syntax/operators.adoc#query-operators-comparison[Regular Comparison Operators]: `+=+`, `+<>+`, `+<+`, `+>+`, `+<=+`, `+>=+`
110-
* xref:values-and-types/working-with-null.adoc#is-null-is-not-null[`IS NULL` Operator]: `IS [NOT] NULL`
111-
* xref:expressions/predicates/type-predicate-expressions.adoc[Type Predicate Expression]: `IS [NOT] TYPED <TYPE>` (Note that the form `IS [NOT] :: <TYPE>` is not accepted)
112-
* xref::syntax/operators.adoc#match-string-is-normalized[Normalization Predicate Expression]: `IS [NOT] NORMALIZED`
113-
* xref::syntax/operators.adoc#query-operator-comparison-string-specific[String Comparison Operators]: `STARTS WITH`, `ENDS WITH`, `=~` (regex matching)
109+
* xref:expressions/predicates/comparison-operators.adoc[Regular Comparison Operators]: `+=+`, `+<>+`, `+<+`, `+>+`, `+<=+`, `+>=+`
110+
* xref:expressions/predicates/comparison-operators.adoc[`IS [NOT] NULL`]
111+
* xref:expressions/predicates/type-predicate-expressions.adoc[Type predicate expressions]: `IS [NOT] TYPED <TYPE>` (Note that the form `IS [NOT] :: <TYPE>` is not accepted)
112+
* xref:expressions/predicates/string-operators.adoc[Normalization Predicate Expression]: `IS [NOT] NORMALIZED`
113+
* xref:expressions/predicates/string-operators.adoc[String Comparison Operators]: `STARTS WITH`, `ENDS WITH`, `=~` (regex matching)
114+
114115

115116
=== Syntax
116117

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1 @@
1-
= Expressions overview
2-
:description: Overview of the expressions allowed in Cypher.
3-
4-
This page contains an overview of the allowed expressions in Cypher.
5-
6-
[[general]]
7-
== General
8-
9-
* A xref:syntax/variables.adoc[variable]: `n`, `x`, `rel`, `myFancyVariable`, `++`A name with special characters in it[]!`++`.
10-
* A xref:queries/concepts.adoc[property]: `n.prop`, `x.prop`, `rel.thisProperty`, `++myFancyVariable.`(special property name)`++`.
11-
For more information, see xref:values-and-types/property-structural-constructed.adoc#property-types[Values and types -> property types].
12-
* A xref:clauses/set.adoc#dynamic-set-property[dynamic property]: `n["prop"]`, `rel[n.city + n.zip]`, `map[coll[0]]`.
13-
For more information, see xref:clauses/where.adoc#filter-on-dynamic-property[`WHERE` -> filter on dynamically computed properties].
14-
* A xref:syntax/parameters.adoc[parameter]: `$param`, `$0`.
15-
* A xref:values-and-types/lists.adoc[list of expressions]: `['a', 'b']`, `[1, 2, 3]`, `['a', 2, n.property, $param]`, `[]`.
16-
* A xref:functions/index.adoc[function] call: `length(p)`, `nodes(p)`.
17-
* An xref:functions/aggregating.adoc[aggregating function] call: `avg(x.prop)`, `+count(*)+`.
18-
* A xref:patterns/fixed-length-patterns.adoc#path-patterns[path-pattern]: `+(a)-[r]->(b)+`, `+(a)-[r]-(b)+`, `+(a)--(b)+`, `+(a)-->()<--(b)+`.
19-
* An xref:syntax/operators.adoc[operator application]: `1 + 2`, `3 < 4`.
20-
* A xref:subqueries/index.adoc[subquery expression]: `COUNT {}`, `COLLECT {}`, `EXISTS {}`, `CALL {}`.
21-
* A xref:expressions/predicates/string-operators#regular-expressions[regular expression]: `a.name =~ 'Tim.*'`.
22-
* A xref:expressions/conditional-expressions.adoc[`CASE` expression].
23-
* xref:values-and-types/working-with-null[`null`].
24-
25-
[NOTE]
26-
====
27-
Expressions containing unsanitized user input may make your application vulnerable to Cypher injection.
28-
Consider using xref:syntax/parameters.adoc[parameters] instead.
29-
Learn more in link:https://neo4j.com/developer/kb/protecting-against-cypher-injection/[Protecting against Cypher Injection].
30-
====
31-
32-
[NOTE]
33-
====
34-
Most expressions in Cypher evaluate to `null` if any of their inner expressions are `null`.
35-
Notable exceptions are the operators `IS NULL`, `IS NOT NULL`, and the xref:expressions/predicates/type-predicate-expressions.adoc[type predicate expressions].
36-
====
37-
38-
[[numerical]]
39-
== Numerical
40-
41-
* A numeric (`INTEGER` or `FLOAT`) literal: `13`, `-40000`, `3.14`.
42-
* A numeric (`INTEGER` or `FLOAT`) literal in scientific notation: `6.022E23`.
43-
* A hexadecimal `INTEGER` literal (starting with `0x`): `0x13af`, `0xFC3A9`, `-0x66eff`.
44-
* An octal `INTEGER` literal (starting with `0o`): `0o1372`, `-0o5671`.
45-
* A `FLOAT` literal: `Inf`, `Infinity`, `NaN`.
46-
* `null`.
47-
48-
[NOTE]
49-
====
50-
Any numeric literal may contain an underscore `_` between digits.
51-
There may be an underscore between the `0x` or `0o` and the digits for hexadecimal and octal literals.
52-
====
53-
54-
[[string]]
55-
== String
56-
57-
* A `STRING` literal: `'Hello'`, `"World"`.
58-
* A case-sensitive `STRING` matching expression: `a.surname STARTS WITH 'Sven'`, `a.surname ENDS WITH 'son'` or `a.surname CONTAINS 'son'`.
59-
* `null`.
60-
61-
[[expressions-string-literals]]
62-
=== String literal escape sequences
63-
64-
String literals can contain the following escape sequences:
65-
66-
[options="header", cols=">1,<2"]
67-
|===================
68-
|Escape sequence|Character
69-
|`\t`|Tab
70-
|`\b`|Backspace
71-
|`\n`|Newline
72-
|`\r`|Carriage return
73-
|`\f`|Form feed
74-
|`\'`|Single quote
75-
|`\"`|Double quote
76-
|`\\`|Backslash
77-
|`\uxxxx`|Unicode UTF-16 code point (4 hex digits must follow the `\u`)
78-
|===================
79-
80-
[[boolean]]
81-
== Boolean
82-
83-
* A `BOOLEAN` literal: `true`, `false`.
84-
* A predicate expression (i.e. an expression returning a `BOOLEAN` value): `a.prop = 'Hello'`, `length(p) > 10`, `a.name IS NOT NULL`.
85-
* Label and relationship type expressions: `(n:A|B)`, `+()-[r:R1|R2]->()+`.
86-
* `null`.
87-
88-
[[graph-references]]
89-
== Graph references
90-
* Database and alias names when managing link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/[databases and aliases]: `CREATE DATABASE <symbolic-name>`.
91-
* Static graph references: `USE <symbolic-name>` or `USE <symbolic-name>.<symbolic-name>` (for constituents of a link:{neo4j-docs-base-uri}/operations-manual/current/database-administration/composite-databases/concepts/[composite databases]).
92-
* Dynamic graph reference with the xref:functions/graph.adoc#functions-graph-byname[`graph.byName`] function, to access a graph of a given name: `USE graph.byName(<string-expression>)`.
93-
* Dynamic graph references with the xref:functions/graph.adoc#functions-graph-by-elementid[`graph.byElementId`] function, to access a graph of a given node or relationship: `USE graph.byName(<element-id-string>)`.
94-
* Retrieving properties of a graph with the xref:functions/graph.adoc#functions-graph-propertiesByName[`graph.propertiesByName`] function: `graph.propertiesByName(<string-expression>)`.
95-
96-
97-
Rules on string expressions for graph references when using identifiers (static graph references, administration commands) or a string (graph.byName function):
98-
99-
* Unquoted dots are separators between a composite database and its constituent.
100-
For example, `composite.db1` represents the constituent `composite.db1` in the composite database `composite`.
101-
To refer to a database with a dot (`.`) in its name, quote the graph reference instead: `++`composite.db1`++`.
102-
* When resolving a graph reference within a graph function, the string argument is parsed like a static graph reference.
103-
Thus, `USE graph.byName(<graph-reference>)` is typically equivalent to `USE <graph-reference>`.
104-
However, escaping rules for xref::syntax/naming.adoc#symbolic-names-escaping-rules[symbolic names] are applied to the argument.
105-
For string literals, both the escaping rules for xref:expressions/expressions-overview.adoc#expressions-string-literals[string literals] (during query parsing) and xref::syntax/naming.adoc#symbolic-names-escaping-rules[symbolic names] (during graph reference evaluation) are applied.
106-
For example, the graph reference in `USE graph.byName('+composite.1\\u0041+')` resolves to the constituent `composite.1a` of the composite database `composite`.
107-
1081

0 commit comments

Comments
 (0)