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
Copy file name to clipboardExpand all lines: doc/modules/ROOT/pages/management-ops/projections/graph-project-cypher-aggregation.adoc
+43-15Lines changed: 43 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,35 +3,43 @@
3
3
:description: This section details projecting GDS graphs using `Cypher` aggregations.
4
4
5
5
6
+
Using Cypher aggregations is a more flexible and expressive approach with diminished focus on performance compared to the xref:management-ops/projections/graph-project.adoc[native projections].
7
+
Cypher aggregations are primarily recommended for the development phase (see xref:common-usage/index.adoc[Common usage]).
6
8
7
-
A projected graph can be stored in the catalog under a user-defined name.
8
-
Using that name, the graph can be referred to by any algorithm in the library.
9
-
This allows multiple algorithms to use the same graph without having to project it on each algorithm run.
10
9
11
-
Using Cypher aggregations is a more flexible and expressive approach with diminished focus on performance compared to the xref:management-ops/projections/graph-project.adoc[native projections].
12
-
Cypher projections are primarily recommended for the development phase (see xref:common-usage/index.adoc[Common usage]).
10
+
== Considerations
13
11
14
-
[NOTE]
15
-
--
16
-
There is also a way to generate a random graph, see xref:management-ops/projections/graph-generation.adoc[Graph Generation] documentation for more details.
17
-
--
12
+
=== Lifecycle
18
13
19
14
[NOTE]
20
15
--
21
-
The projected graph will reside in the catalog until:
16
+
The projected graphs will reside in the catalog until either:
22
17
23
18
- the graph is dropped using xref:graph-drop.adoc[gds.graph.drop]
24
19
- the Neo4j database from which the graph was projected is stopped or dropped
25
20
- the Neo4j database management system is stopped.
26
21
--
27
22
28
23
24
+
=== Node property support
25
+
26
+
Cypher aggregations can only project a limited set of node property types from a Cypher query.
27
+
The xref:management-ops/node-properties.adoc#node-properties-supported[Node Properties page] details which node property types are supported.
28
+
Other types of node properties have to be transformed or encoded into one of the supported types in order to be projected using a Cypher aggregation.
29
+
30
+
=== Selection of node properties and labels
31
+
32
+
If a node occurs multiple times, the node properties and labels of the first occurrence will be used for the projection.
33
+
This is important when a node can be a source node as well as a target node.
34
+
35
+
29
36
[[graph-project-cypher-aggregation-syntax]]
30
37
== Syntax
31
38
32
39
A Cypher aggregation is used in a query as an aggregation over the relationships that are being projected.
33
40
It takes three mandatory arguments: `graphName`, `sourceNode` and `targetNode`.
34
-
In addition, the optional `sourceNodeProperties`, `targetNodeProperties`, and `relationshipProperties` parameters allows us to project properties.
41
+
In addition, the optional `nodesConfig`, `relationshipConfig` parameters can be used to project properties and label or types.
42
+
The optional `configuration` parameter can be used for general configuration of the projection such as `readConcurrency`.
| graphName | no | The name under which the graph is stored in the catalog.
60
68
| sourceNode | no | The source node of the relationship. Must not be null.
61
69
| targetNode | yes | The target node of the relationship. The targetNode can be null (for example due to an `OPTIONAL MATCH`), in which case the source node is projected as an unconnected node.
62
-
| nodesConfig | yes | Properties and Labels configuration for the source and target nodes.
63
-
| relationshipConfig | yes | Properties and Type configuration for the relationship.
64
-
| configuration | yes | Additional parameters to configure the cypher aggregation projection.
70
+
| <<graph-project-cypher-aggregation-syntax-nodesConfig, nodesConfig>> | yes | Properties and Labels configuration for the source and target nodes.
71
+
| <<graph-project-cypher-aggregation-syntax-relationshipConfig, relationshipConfig>> | yes | Properties and Type configuration for the relationship.
72
+
| <<graph-project-cypher-aggregation-syntax-configuration, configuration>> | yes | Additional parameters to configure the cypher aggregation projection.
0 commit comments