You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a| Introduced a `VECTOR` value type that can be stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships and utilized for efficient semantic retrieval using Neo4j's xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and xref:genai-integrations.adoc[GenAI plugin].
45
+
For more information, see xref:values-and-types/vector.adoc[Values and types -> Vectors].
46
+
47
+
a|
48
+
label:functionality[]
49
+
label:new[]
50
+
[source, cypher]
51
+
----
52
+
WITH vector([1, 2, 3], 3, INTEGER) AS vector
53
+
RETURN vector, valueType(vector) AS vectorType
54
+
----
55
+
56
+
a| New xref:functions/vector.adoc#functions-vector[`vector()`] function for the construction of xref:values-and-types/vector.adoc[`VECTOR`] values.
57
+
58
+
a|
59
+
label:functionality[]
60
+
label:new[]
61
+
[source, cypher]
62
+
----
63
+
RETURN vector_dimension_count(vector([1, 2, 3], 3, INTEGER)) AS size
64
+
----
65
+
66
+
a| New xref:functions/vector.adoc#functions-vector_dimension_count[`vector_dimension_count()`] function, which returns the dimension of a xref:values-and-types/vector.adoc[`VECTOR`] value.
a| New xref:functions/vector.adoc#functions-vector_distance[`vector_distance()`] function, which returns the distance between two xref:values-and-types/vector.adoc[`VECTOR`] values based on the selected `vectorDistanceMetric` algorithm.
77
+
78
+
a|
79
+
label:functionality[]
80
+
label:new[]
81
+
[source, cypher]
82
+
----
83
+
RETURN vector_norm(vector([1.0, 5.0, 3.0, 6.7], 4, FLOAT), EUCLIDEAN) AS norm
84
+
----
85
+
86
+
a| New xref:functions/vector.adoc#functions-vector_norm[`vector_norm()`] function, which returns the distance between the given vector and an origin vector, which is a vector with the same dimension with all coordinates set to zero, calculated using the specified `vectorDistanceMetric`.
87
+
88
+
|===
89
+
29
90
=== Updated in Cypher 25
30
91
31
92
[cols="2", options="header"]
@@ -36,7 +97,20 @@ For more information, see xref:queries/select-version.adoc[].
a| The xref:functions/list.adoc#functions-tofloatlist[`toFloatList()`], xref:functions/list.adoc#functions-tointegerlist[`toIntegerList()`], xref:functions/vector.adoc#functions-similarity-cosine[`vector.similarity.cosine()`], and xref:functions/vector.adoc#functions-similarity-euclidean[`vector.similarity.euclidean()`] functions now accept `VECTOR` values as input arguments.
109
+
110
+
a|
111
+
label:functionality[]
112
+
label:updated[]
113
+
[source, cypher]
40
114
----
41
115
RETURN datetime('11/18/1986', "MM/dd/yyyy") AS dt
42
116
----
@@ -68,7 +142,7 @@ RETURN format(dt, "MM/dd/yyyy") AS US, format(dt, "dd/MM/yyyy") AS EU
68
142
69
143
| Cypher's new xref:functions/temporal/format.adoc[`format()`] function can create dynamically formatted string representations of temporal instance and duration types.
70
144
71
-
a|
145
+
a|
72
146
label:functionality[]
73
147
label:new[]
74
148
@@ -119,7 +193,7 @@ label:functionality[]
119
193
label:updated[]
120
194
[source, cypher]
121
195
----
122
-
PROFILE
196
+
PROFILE
123
197
WITH "Person" AS label
124
198
MATCH (people:$(label))
125
199
RETURN people.name
@@ -143,7 +217,7 @@ label:new[]
143
217
----
144
218
MATCH (()-->(n))+
145
219
WHERE allReduce(acc = 0, node IN n \| acc + node.x, 6 < acc < 30)
146
-
RETURN [i IN n \| i.x] AS sequence
220
+
RETURN [i IN n \| i.x] AS sequence
147
221
ORDER BY head(n).x, size(n)
148
222
----
149
223
@@ -517,10 +591,10 @@ label:new[]
517
591
----
518
592
CREATE ALIAS `remote-with-default-language`
519
593
FOR DATABASE `northwind-graph-2020`
520
-
AT "neo4j+s://location:7687"
521
-
USER alice
522
-
PASSWORD 'example_secret'
523
-
DEFAULT LANGUAGE CYPHER 25
594
+
AT "neo4j+s://location:7687"
595
+
USER alice
596
+
PASSWORD 'example_secret'
597
+
DEFAULT LANGUAGE CYPHER 25
524
598
----
525
599
526
600
a| Set the default Cypher version for a remote database alias when creating it.
@@ -942,7 +1016,7 @@ CASE x ... WHEN contains - 1 THEN ... END
942
1016
a| Using a variable named `contains` (or any casing variant, like `CONTAINS`) in addition or subtraction operations within a `WHEN` operand of a xref:expressions/conditional-expressions.adoc#case-simple[simple `CASE`] expression is deprecated.
943
1017
To continue using variables with this name, use backticks to quote the variable name:
944
1018
945
-
* Additions: `CASE x ... WHEN ++`contains`++ + 1 THEN ... END`
1019
+
* Additions: `CASE x ... WHEN ++`contains`++ + 1 THEN ... END`
946
1020
* Subtractions: `CASE x ... WHEN ++`contains`++ - 1 THEN ... END`
947
1021
948
1022
a|
@@ -957,8 +1031,8 @@ CASE x ... WHEN in["abc"] THEN ... END
957
1031
----
958
1032
a| Using the `[]` operator on a variable named `in` (or any casing variant, like `IN`) within a `WHEN` operand of a xref:expressions/conditional-expressions.adoc#case-simple[simple `CASE`] expression is deprecated.
959
1033
To continue using variables with this name, use backticks to quote the variable name:
960
-
961
-
* `CASE x ... WHEN ++`in`++[1] THEN ... END`
1034
+
1035
+
* `CASE x ... WHEN ++`in`++[1] THEN ... END`
962
1036
* `CASE x ... WHEN ++`in`++["abc"] THEN ... END`
963
1037
964
1038
@@ -1157,7 +1231,7 @@ label:functionality[]
1157
1231
label:updated[]
1158
1232
[source, cypher, role="noheader"]
1159
1233
----
1160
-
CREATE (n:Label {property: 'name'}),
1234
+
CREATE (n:Label {property: 'name'}),
1161
1235
()-[r:REL_TYPE]->()
1162
1236
----
1163
1237
| Neo4j's link:{neo4j-docs-base-uri}/operations-manual/current/database-internals/store-formats/#store-format-overview[block format] now implements xref:appendix/gql-conformance/index.adoc[GQL's] limit on the maximum length of identifiers.
@@ -1208,7 +1282,7 @@ RETURN t AS team, players
1208
1282
1209
1283
[source, cypher, role="noheader"]
1210
1284
----
1211
-
OPTIONAL CALL db.labels() YIELD label
1285
+
OPTIONAL CALL db.labels() YIELD label
1212
1286
RETURN label
1213
1287
----
1214
1288
@@ -1559,7 +1633,7 @@ MATCH SHORTEST 2 GROUPS (:A)-[:R]->{0,10}(:B)
1559
1633
1560
1634
a| Introduced new graph pattern matching keywords to find variations of the xref:patterns/shortest-paths.adoc[shortest paths] between nodes.
1561
1635
1562
-
a|
1636
+
a|
1563
1637
label:functionality[]
1564
1638
label:new[]
1565
1639
@@ -4757,4 +4831,4 @@ MATCH (n:N {prop1: 42} WHERE n.prop2 > 42)
4757
4831
a|
4758
4832
New syntax that enables inlining of `WHERE` clauses inside node patterns.
The following examples use `VECTOR` values (constructed using the xref:functions/vector.adoc#functions-vector[`vector()` function]) with `3` dimensions and `INTEGER8` coordinate type.
46
+
47
+
.Verify a `VECTOR<TYPE>(DIMENSION)` value against a `VECTOR` the same coordinate type and dimension
48
+
[source, cypher]
49
+
----
50
+
WITH vector([1, 2, 3], 3, INTEGER8) AS vector
51
+
RETURN vector IS :: VECTOR<INTEGER8>(3) AS isVector
Although it is not possible to store xref:values-and-types/vector.adoc[`VECTOR`] values without a coordinate type and dimension, it is possible to use the `VECTOR` supertype (encompassing all combinations of `VECTOR<TYPE>(DIMENSION)`) in type predicate expressions.
65
+
66
+
.Verify a `VECTOR<TYPE>(DIMENSION)` value against the `VECTOR` supertype
The same is true for the supertypes `VECTOR<TYPE>` (which encompasses all `VECTOR` values with the same coordinate type regardless of the dimension) and `VECTOR(DIMENSION)` (which encompasses all `VECTOR` values with the same dimension regardless of the coordinate type).
84
+
85
+
.Verify a `VECTOR<TYPE>(DIMENSION)` value against the `VECTOR<TYPE>` supertype
86
+
[source, cypher]
87
+
----
88
+
WITH vector([1, 2, 3], 3, INTEGER8) AS vector
89
+
RETURN vector IS :: VECTOR<INTEGER8> AS isInteger8Vector
@@ -189,7 +305,16 @@ Cypher will therefore regard any exact numerical parameter as an `INTEGER` regar
189
305
For example, an `INT16` or an `INT32` passed through from a link:https://neo4j.com/docs/create-applications/[language library] will both be treated by Cypher as an `INTEGER`.
190
306
Note that any exact numerical parameter used must fit within the range of an `INT64`.
191
307
192
-
[source, cypher, role=test-skip]
308
+
////
309
+
[source, parameters]
310
+
----
311
+
{
312
+
"int16param": 65537
313
+
}
314
+
----
315
+
////
316
+
317
+
[source, cypher]
193
318
----
194
319
RETURN $int16param IS :: INTEGER AS isInteger
195
320
----
@@ -205,6 +330,9 @@ RETURN $int16param IS :: INTEGER AS isInteger
205
330
206
331
More information about parameters can be found xref::syntax/parameters.adoc[here].
207
332
333
+
[NOTE]
334
+
The xref:values-and-types/vector.adoc#vector-type[vector-only coordinate types] cannot be used as the numeric type to verify against in type predicate expressions.
335
+
208
336
[[type-predicate-syntax-variation]]
209
337
== Syntactical variations of type predicate expressions
0 commit comments