Skip to content

Commit c7b235a

Browse files
Tobias Hafnervogti
authored andcommitted
Add graph results
1 parent 5399d3d commit c7b235a

File tree

2 files changed

+64
-5
lines changed

2 files changed

+64
-5
lines changed

org/polypheny/prism/graph_frame.proto

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Messages related to graph frames as used to represent results form the labeled p
33
*/
44

55
syntax = "proto3";
6+
import "org/polypheny/prism/value.proto";
67

78
option java_multiple_files = true;
89
option java_package = "org.polypheny.prism";
@@ -14,10 +15,20 @@ option csharp_namespace = "Polypheny.Prism";
1415
package org.polypheny.prism;
1516

1617
/*
17-
The GraphFrame message is a placeholder intended to represent graph frames as part of the labeled property graph model.
18-
As of now, the graph model is not fully implemented, making this message void of fields.
19-
It acts as a provision for future developments where fields related to the graph model will be added.
20-
Currently, this message does not contain any fields. It is reserved for future use when the graph model is more completely realized.
21-
*/
18+
* The GraphFrame represents the non-relational result of a query in the labeled property graph model.
19+
* If the query returns a relational result, such as when aggregations are used or specific properties are returned,
20+
* a relational frame is used. The GraphFrame is used for results where a set of nodes, edges, or paths is returned.
21+
* This selection is exclusive, meaning only one of the lists can be populated at a time. If a result produces multiple
22+
* frames (used to transmit large results), all results will be of the same type (relational vs. graph) and contain the
23+
* same element type (nodes, edges or paths).
24+
*/
2225
message GraphFrame {
26+
// Field used to represent a set of nodes as part of a result. If this field is populated all others must not be set.
27+
repeated ProtoNode nodes = 1;
28+
// Field used to represent a set of edges as part of a result. If this field is populated all others must not be set.
29+
repeated ProtoEdge edges = 2;
30+
// Field used to represent a set of paths as part of a result. If this field is populated all others must not be set.
31+
repeated ProtoPath paths = 3;
2332
}
33+
34+

org/polypheny/prism/value.proto

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,51 @@ message ProtoFile {
288288
// The content of the file in binary.
289289
bytes binary = 1;
290290
}
291+
292+
/*
293+
* This message represents a node in the labeled property graph model.
294+
* Apart form a unique identifier and a name, a set of entries and list are used to represent properties and labels.
295+
*/
296+
message ProtoNode {
297+
// The system internal unique identifier for that node.
298+
string id = 1;
299+
// The name of the node as specified on creation.
300+
string name = 2;
301+
// A map of key-value pairs of proto values. These are used as a map to store properties with their corresponding names.
302+
repeated ProtoEntry properties = 3;
303+
// This list contains all labels associated with this node. Normal strings are used instead of ProtoStrings.
304+
repeated string labels = 4;
305+
}
306+
307+
/*
308+
* This message represents an edge in the labeled property graph model.
309+
* Apart form a unique identifier and a name, a set of entries and list are used to represent properties and labels.
310+
* Source, target and direction fields provide information about the nodes connected by this edge.
311+
*/
312+
message ProtoEdge {
313+
// The system internal unique identifier for that node.
314+
string id = 1;
315+
// The name of the node as specified on creation.
316+
string name = 2;
317+
// A map of key-value pairs of proto values. These are used as a map to store properties with their corresponding names.
318+
repeated ProtoEntry properties = 3;
319+
// This list contains all labels associated with this node. Normal strings are used instead of ProtoStrings.
320+
repeated string labels = 4;
321+
// The system internal unique identifier of the node from which this edge originates.
322+
string source = 5;
323+
// The system internal unique identifier of the node to which this edge is incident.
324+
string target = 6;
325+
// The direction of this edge. Possible options are LEFT_TO_RIGHT, RIGHT_TO_LEFT or NONE.
326+
Direction direction = 7;
327+
328+
enum Direction {
329+
UNSPECIFIED = 0;
330+
LEFT_TO_RIGHT = 1;
331+
RIGHT_TO_LEFT = 2;
332+
NONE = 3;
333+
}
334+
}
335+
336+
message ProtoPath {
337+
338+
}

0 commit comments

Comments
 (0)