Skip to content

Commit c9aebc7

Browse files
Tobias Hafnervogti
authored andcommitted
Refactor graph result to support edges
1 parent 2761e28 commit c9aebc7

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

org/polypheny/prism/graph_frame.proto

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,24 @@ package org.polypheny.prism;
1818
* The GraphFrame represents the non-relational result of a query in the labeled property graph model.
1919
* If the query returns a relational result, such as when aggregations are used or specific properties are returned,
2020
* a relational frame is used. The GraphFrame is used for results where a set of nodes and/or edges is returned.
21+
* The nodes or edges are wrapped in graph elements to allow them to be mixed as paths are returned as a mixed collection of both.
2122
* If a result produces multiple frames (used to transmit large results), all results will be of the same type (relational vs. graph).
22-
* If the result contains paths, these are represented as a list of nodes and a list of edges. Thus both lists can be populated at once.
2323
*/
2424
message GraphFrame {
25-
// Field used to represent a set of nodes as part of a result. If this field is populated all others must not be set.
26-
repeated ProtoNode nodes = 1;
27-
// Field used to represent a set of edges as part of a result. If this field is populated all others must not be set.
28-
repeated ProtoEdge edges = 2;
25+
repeated GraphElement element = 1;
26+
}
27+
28+
/*
29+
* Represents an element in a graph. Each element is either a node or an edge.
30+
*/
31+
message GraphElement {
32+
// This field stores the graph element itself which is either a node or an edge.
33+
oneof element {
34+
// This field stores the node if the graph element is a node.
35+
ProtoNode node = 1;
36+
// This field stores the edge if the graph element is an edge.
37+
ProtoEdge edge = 2;
38+
}
2939
}
3040

3141

0 commit comments

Comments
 (0)