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
@@ -66,18 +68,6 @@ The details regarding the format and choice of graph URLs is outside the scope o
66
68
67
69
A graph is considered to have been deleted if it is no longer registered under a graph URL and no other reference to it is retained (e.g. from a running query).
68
70
69
-
=== Entity Identity
70
-
71
-
In the single property graph model, nodes and relationships are commonly identified by a single integer id.
72
-
This model was originally not designed for sharing entities between many different graphs while ensuring that entity ids are unique.
73
-
74
-
In the multiple property graphs model, entities are additionally implicitly associated with a _graph space_ that allows to distinguish between entities with the same original id from different sources (e.g. different databases or even snapshots of the same database).
75
-
76
-
In the multiple property graphs model, no graph may contain two entities from the same graph space that have the same original id.
77
-
78
-
Graph spaces may be made identifiable by a conforming implementation by assigning a _graph URI_ to them.
79
-
The details regarding the format and choice of graph URIs is outside the scope of this proposal.
80
-
81
71
== Background: Single Graph Execution Model
82
72
83
73
To describe the foundational shift proposed by this CIP, we'll define some terminology for describing the state that is manipulated by Cypher's current single graph execution model.
@@ -155,11 +145,20 @@ This CIP proposes that `UNION` (and `UNION ALL` respectively) compute the union
155
145
156
146
=== Updating queries
157
147
158
-
This CIP proposes that all updating clauses update the provided target graph of their current query context.
159
-
160
-
This CIP proposes that all entities of bound pattern variables in `CREATE` and `MERGE` are always added to the provided target graph of the current query context.
148
+
This CIP proposes the following update semantics for Cypher with support for multiple graphs:
161
149
162
-
This CIP proposes that deleting an entity only affects the provided target graph of the current query context.
150
+
* All updating clauses update the provided target graph of their current query context.
151
+
More concretely:
152
+
** Entities are always created in and deleted from the currently provided target graph.
153
+
** All entities of bound pattern variables in `CREATE` and `MERGE` are always added to the provided target graph of the current query context.
154
+
** Deleting an entity only affects the provided target graph of the current query context.
155
+
* Updating queries always return all variables and graphs in scope, i.e. the behave as if they would end in `RETURN * GRAPHS *` (This syntax is introduced below).
156
+
* Semantically, all effects of an updating clause must be made visible before proceeding with the execution of the next clause.
157
+
In other words, a conforming implementation must ensure that a later clause alway sees the complete set of updates of a preceding updating clause.
158
+
* A single update clause may perform multiple conflicting updates on the same node or relationship.
159
+
In this situation, the outcome is undefined.
160
+
Conflicting updates are considered to be out of scope of this CIP and will be addressed in a future proposal.
161
+
For now it is proposed that a conforming implementation must choose at least either the original value or one of the values written or `NULL` as the final outcome of a conflicting update.
163
162
164
163
=== Simulating the single graph execution model
165
164
@@ -260,7 +259,7 @@ However if `<graph-return-items>` already passes on a reference for the `SOURCE
260
259
261
260
If the current named source graph (or the current named target graph) are not passed on, they are discarded and due to the rules regarding partial query contexts the provided source graph (or target respectively) again are chosen to be the default graph of the outer execution context.
262
261
263
-
Note: `WITH <return-items> GRAPHS *` may be used to pass through the initial query context without having to alias source and target graphs explicitly.
262
+
Note: `WITH <return-items> GRAPHS *` may be used to pass through the initial query context without having to alias incoming source and target graphs explicitly.
A `<graph-construction-subquery>` is an updating subquery (i.e. a sequence of clauses, including update clauses) that may or may not end in `RETURN`.
288
287
All variables bound before the nested `FROM` and `INTO` subqueries are made visible to the `<graph-construction-subquery>`.
289
-
All variables bound at the end of the `<graph-construction-subquery>` are made visible to the remaining outer query.
288
+
All variables and graphs visible at the end of the `<graph-construction-subquery>` are made visible to the remaining outer query.
290
289
291
290
These forms have the exact same effect as creating fresh aliases for the current source and target graph, then changing the current source and target graph as specified before executing the given `<graph-construction-subquery>`, and finally restoring the original source and target graphs using the aliases followed by discarding those aliases from the current scope.
292
291
293
-
=== Updating graphs
294
-
295
-
This CIP proposes the following update semantics for Cypher with support for multiple graphs.
296
-
297
-
Entities are always created in and deleted from the currently provided target graph.
298
-
299
-
Semantically, all effects of an updating clause must be made visible before proceeding with the execution of the next clause.
300
-
In other words, a conforming implementation must ensure that a later clause alway sees the complete set of updates of a preceding updating clause.
301
-
302
-
A single update clause may perform multiple conflicting updates on the same node or relationship.
303
-
In this situation, the outcome is undefined.
304
-
305
-
Conflicting updates are considered to be out of scope of this CIP.
306
-
307
-
For now it is proposed that a conforming implementation must choose at least either the original value or one of the values written or `NULL` as the final outcome of a conflicting update.
308
-
309
292
=== Query signature declarations
310
293
311
294
Finally this CIP proposed using the `WITH` clause as the initial clause in a query for declaring all query inputs:
0 commit comments