This is an automated email from the ASF dual-hosted git repository.
weibin pushed a commit to branch format-definition-dev
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git
The following commit(s) were added to refs/heads/format-definition-dev by this
push:
new 54ee917d feat(format): Update the definition of format (#520)
54ee917d is described below
commit 54ee917deae254dafd46233a2f206744ecf11b04
Author: Weibin Zeng <[email protected]>
AuthorDate: Thu Jun 13 19:53:59 2024 +0800
feat(format): Update the definition of format (#520)
* Update the format definition
Signed-off-by: acezen <[email protected]>
* Update format
Signed-off-by: acezen <[email protected]>
* Update
* Update the cpp target
* Add README
* Update
---------
Signed-off-by: acezen <[email protected]>
---
buf.gen.yaml | 2 +-
format/README.md | 18 ++++++++++++++++++
format/adjacent_list.proto | 6 +++++-
format/edge_info.proto | 4 ++++
format/{types.proto => enums.proto} | 0
format/graph_info.proto | 3 ++-
format/property_group.proto | 4 ++--
format/vertex_info.proto | 8 +++++---
8 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/buf.gen.yaml b/buf.gen.yaml
index 6efdffa7..3854a180 100644
--- a/buf.gen.yaml
+++ b/buf.gen.yaml
@@ -12,7 +12,7 @@ plugins:
out: pyspark/graphar_pyspark/proto/
# Cpp
- remote: buf.build/protocolbuffers/cpp:v27.1
- out: cpp/src/proto
+ out: cpp/proto
# Java
- remote: buf.build/protocolbuffers/java:v27.1
out: maven-projects/info/src/main/java/
diff --git a/format/README.md b/format/README.md
new file mode 100644
index 00000000..8d33a41d
--- /dev/null
+++ b/format/README.md
@@ -0,0 +1,18 @@
+# GraphAr Format Specification
+
+This folder contains protocol definitions for the GraphAr format.
+
+## How to generate code
+
+### Prerequisites
+
+- [protoc](https://developers.google.com/protocol-buffers/docs/downloads)
+- [buf](https://buf.build/docs/installation)
+
+### Build
+
+```sh
+buf generate
+```
+
+For documentation about the format, see the [GraphAr
documentation](https://graphar.apache.org/docs/specification/format).
diff --git a/format/adjacent_list.proto b/format/adjacent_list.proto
index 21312530..da88ef2a 100644
--- a/format/adjacent_list.proto
+++ b/format/adjacent_list.proto
@@ -23,13 +23,17 @@ package graphar;
option java_multiple_files = true;
option java_package = "org.apache.graphar.info.proto";
-import "types.proto";
+import "enums.proto";
message AdjacentList {
AdjListType type = 1;
FileType file_type = 2;
string prefix = 3;
+ // Statistics message, including
+ // 1. the number of vertices base on the AdjListType
+ // 2. the number of vertex chunks base on the AdjListType
+ // 3. the number of edges of each vertex chunk
message Statistics {
int64 num_vertices = 1;
int64 num_vertex_chunks = 2;
diff --git a/format/edge_info.proto b/format/edge_info.proto
index 72f5757c..12474545 100644
--- a/format/edge_info.proto
+++ b/format/edge_info.proto
@@ -38,6 +38,10 @@ message EdgeInfo {
bool is_directed = 9;
string prefix = 10;
+ // Statistics message of the edge, including
+ // 1. num_edges: the number of edges
+ // 2. num_source_vertices: the number of source vertices
+ // 3. num_destination_vertices: the number of destination vertices
message Statistics {
int64 num_edges = 1;
int64 num_source_vertices = 2;
diff --git a/format/types.proto b/format/enums.proto
similarity index 100%
rename from format/types.proto
rename to format/enums.proto
diff --git a/format/graph_info.proto b/format/graph_info.proto
index e5c6e2ec..7d11c956 100644
--- a/format/graph_info.proto
+++ b/format/graph_info.proto
@@ -32,6 +32,7 @@ message GraphInfo {
repeated EdgeInfo edges = 3;
string prefix = 4;
+ // Statistics of the graph, including the number of vertices and edges
message Statistics {
int64 num_vertices = 1;
int64 num_edges = 2;
@@ -42,5 +43,5 @@ message GraphInfo {
string key = 1;
string value = 2;
}
- map<string, string> metadata = 6;
+ repeated KeyValue key_value_metadata = 6;
};
diff --git a/format/property_group.proto b/format/property_group.proto
index 5cdbb42b..23c28bcc 100644
--- a/format/property_group.proto
+++ b/format/property_group.proto
@@ -23,13 +23,13 @@ package graphar;
option java_multiple_files = true;
option java_package = "org.apache.graphar.info.proto";
-import "types.proto";
+import "enums.proto";
message Property {
string name = 1;
DataType type = 2;
bool is_primary_key = 3;
- bool nullable = 4;
+ bool is_nullable = 4;
string prefix = 5;
};
diff --git a/format/vertex_info.proto b/format/vertex_info.proto
index 136b89c9..99ec482f 100644
--- a/format/vertex_info.proto
+++ b/format/vertex_info.proto
@@ -31,9 +31,11 @@ message VertexInfo {
repeated PropertyGroup properties = 3;
string prefix = 4;
+ // Statistics message, including the number of vertices and chunks
+ // of this type of vertex
message Statistics {
- int64 num_vertices = 5;
- int64 num_chunks = 6;
+ int64 num_vertices = 1;
+ int64 num_chunks = 2;
}
- optional Statistics statistics = 7;
+ optional Statistics statistics = 5;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]