This is an automated email from the ASF dual-hosted git repository.
weibin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git
The following commit(s) were added to refs/heads/main by this push:
new aff205cd feat(format):rename 'label' as 'type' in some .cc and .h
files (#606)
aff205cd is described below
commit aff205cd3df564d980041a6f7c2f7fc2f950ba3b
Author: Elssky <[email protected]>
AuthorDate: Mon Sep 2 10:17:07 2024 +0800
feat(format):rename 'label' as 'type' in some .cc and .h files (#606)
Signed-off-by: Elssky <[email protected]>
Co-authored-by: acezen <[email protected]>
---
cpp/.gitignore | 2 ++
cpp/examples/bfs_father_example.cc | 8 +++----
cpp/examples/bfs_pull_example.cc | 8 +++----
cpp/examples/bfs_push_example.cc | 8 +++----
cpp/examples/bfs_stream_example.cc | 8 +++----
cpp/examples/bgl_example.cc | 12 +++++-----
cpp/examples/cc_push_example.cc | 8 +++----
cpp/examples/cc_stream_example.cc | 8 +++----
cpp/examples/high_level_reader_example.cc | 4 ++--
cpp/examples/low_level_reader_example.cc | 4 ++--
cpp/examples/mid_level_reader_example.cc | 6 ++---
cpp/examples/pagerank_example.cc | 8 +++----
cpp/src/graphar/arrow/chunk_reader.cc | 18 +++++++--------
cpp/src/graphar/arrow/chunk_reader.h | 32 +++++++++++++--------------
cpp/src/graphar/arrow/chunk_writer.cc | 6 ++---
cpp/src/graphar/arrow/chunk_writer.h | 14 ++++++------
cpp/src/graphar/chunk_info_reader.cc | 16 +++++++-------
cpp/src/graphar/chunk_info_reader.h | 32 +++++++++++++--------------
cpp/src/graphar/fwd.h | 12 +++++-----
cpp/src/graphar/high-level/edges_builder.h | 6 ++---
cpp/src/graphar/high-level/graph_reader.h | 18 +++++++--------
cpp/src/graphar/high-level/vertices_builder.h | 10 ++++-----
cpp/test/test_graph.cc | 17 ++++++--------
cpp/test/test_info.cc | 7 +++++-
24 files changed, 138 insertions(+), 134 deletions(-)
diff --git a/cpp/.gitignore b/cpp/.gitignore
index 29b5a594..cda5fffd 100644
--- a/cpp/.gitignore
+++ b/cpp/.gitignore
@@ -1,4 +1,6 @@
/build/
+/build-test/
+/build-test-rename/
/examples/*/build/
/cmake-build-debug
diff --git a/cpp/examples/bfs_father_example.cc
b/cpp/examples/bfs_father_example.cc
index a575b486..b5d4adc3 100644
--- a/cpp/examples/bfs_father_example.cc
+++ b/cpp/examples/bfs_father_example.cc
@@ -32,9 +32,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// get the person vertices of graph
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -86,7 +86,7 @@ int main(int argc, char* argv[]) {
graphar::CreatePropertyGroup(property_vector, graphar::FileType::CSV);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/bfs_pull_example.cc b/cpp/examples/bfs_pull_example.cc
index 94ed3edd..530d5581 100644
--- a/cpp/examples/bfs_pull_example.cc
+++ b/cpp/examples/bfs_pull_example.cc
@@ -32,9 +32,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/bfs_push_example.cc b/cpp/examples/bfs_push_example.cc
index cf01c0dd..d6dbbc9c 100644
--- a/cpp/examples/bfs_push_example.cc
+++ b/cpp/examples/bfs_push_example.cc
@@ -32,9 +32,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -87,7 +87,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/bfs_stream_example.cc
b/cpp/examples/bfs_stream_example.cc
index 470a7c5d..73abd219 100644
--- a/cpp/examples/bfs_stream_example.cc
+++ b/cpp/examples/bfs_stream_example.cc
@@ -32,9 +32,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -78,7 +78,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/bgl_example.cc b/cpp/examples/bgl_example.cc
index 7995dac9..d8231c6f 100644
--- a/cpp/examples/bgl_example.cc
+++ b/cpp/examples/bgl_example.cc
@@ -39,9 +39,9 @@ int main(int argc, char* argv[]) {
ASSERT(graph_info->GetEdgeInfos().size() == 1);
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -108,10 +108,10 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// construct new vertex info
- std::string type = "cc_result", vertex_prefix = "result/";
+ std::string vertex_type = "cc_result", vertex_prefix = "result/";
int chunk_size = 100;
auto version = graphar::InfoVersion::Parse("gar/v1").value();
- auto new_info = graphar::CreateVertexInfo(type, chunk_size, {group},
+ auto new_info = graphar::CreateVertexInfo(vertex_type, chunk_size, {group},
vertex_prefix, version);
// dump new vertex info
ASSERT(new_info->IsValidated());
@@ -132,7 +132,7 @@ int main(int argc, char* argv[]) {
// method 2 for writing results: extend the original vertex info and write
// results using writer extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(vertex_type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/cc_push_example.cc b/cpp/examples/cc_push_example.cc
index d8f72617..32ae676b 100644
--- a/cpp/examples/cc_push_example.cc
+++ b/cpp/examples/cc_push_example.cc
@@ -33,9 +33,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -121,7 +121,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/cc_stream_example.cc
b/cpp/examples/cc_stream_example.cc
index 2108e7a8..fbc1339d 100644
--- a/cpp/examples/cc_stream_example.cc
+++ b/cpp/examples/cc_stream_example.cc
@@ -33,9 +33,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -89,7 +89,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/examples/high_level_reader_example.cc
b/cpp/examples/high_level_reader_example.cc
index bce9787f..85faf364 100644
--- a/cpp/examples/high_level_reader_example.cc
+++ b/cpp/examples/high_level_reader_example.cc
@@ -28,9 +28,9 @@
void vertices_collection(
const std::shared_ptr<graphar::GraphInfo>& graph_info) {
// construct vertices collection
- std::string label = "person", property = "firstName";
+ std::string type = "person", property = "firstName";
auto maybe_vertices_collection =
- graphar::VerticesCollection::Make(graph_info, label);
+ graphar::VerticesCollection::Make(graph_info, type);
ASSERT(!maybe_vertices_collection.has_error());
auto vertices = maybe_vertices_collection.value();
diff --git a/cpp/examples/low_level_reader_example.cc
b/cpp/examples/low_level_reader_example.cc
index c3a7b65b..1ba306cd 100644
--- a/cpp/examples/low_level_reader_example.cc
+++ b/cpp/examples/low_level_reader_example.cc
@@ -28,9 +28,9 @@
void vertex_property_chunk_info_reader(
const std::shared_ptr<graphar::GraphInfo>& graph_info) {
// constuct reader
- std::string label = "person", property_name = "id";
+ std::string type = "person", property_name = "id";
auto maybe_reader = graphar::VertexPropertyChunkInfoReader::Make(
- graph_info, label, property_name);
+ graph_info, type, property_name);
ASSERT(!maybe_reader.has_error());
auto reader = maybe_reader.value();
diff --git a/cpp/examples/mid_level_reader_example.cc
b/cpp/examples/mid_level_reader_example.cc
index ac9739c2..5cc341de 100644
--- a/cpp/examples/mid_level_reader_example.cc
+++ b/cpp/examples/mid_level_reader_example.cc
@@ -28,9 +28,9 @@
void vertex_property_chunk_reader(
const std::shared_ptr<graphar::GraphInfo>& graph_info) {
// create reader
- std::string label = "person", property_name = "gender";
+ std::string type = "person", property_name = "gender";
auto maybe_reader = graphar::VertexPropertyArrowChunkReader::Make(
- graph_info, label, property_name);
+ graph_info, type, property_name);
ASSERT(maybe_reader.status().ok());
auto reader = maybe_reader.value();
@@ -72,7 +72,7 @@ void vertex_property_chunk_reader(
graphar::_Literal("female"));
std::vector<std::string> expected_cols{"firstName", "lastName"};
auto maybe_filter_reader = graphar::VertexPropertyArrowChunkReader::Make(
- graph_info, label, property_name);
+ graph_info, type, property_name);
ASSERT(maybe_filter_reader.status().ok());
auto filter_reader = maybe_filter_reader.value();
filter_reader->Filter(filter);
diff --git a/cpp/examples/pagerank_example.cc b/cpp/examples/pagerank_example.cc
index db8c272e..9cd15f0f 100644
--- a/cpp/examples/pagerank_example.cc
+++ b/cpp/examples/pagerank_example.cc
@@ -33,9 +33,9 @@ int main(int argc, char* argv[]) {
auto graph_info = graphar::GraphInfo::Load(path).value();
// construct vertices collection
- std::string label = "person";
- ASSERT(graph_info->GetVertexInfo(label) != nullptr);
- auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, label);
+ std::string type = "person";
+ ASSERT(graph_info->GetVertexInfo(type) != nullptr);
+ auto maybe_vertices = graphar::VerticesCollection::Make(graph_info, type);
ASSERT(maybe_vertices.status().ok());
auto& vertices = maybe_vertices.value();
int num_vertices = vertices->size();
@@ -88,7 +88,7 @@ int main(int argc, char* argv[]) {
auto group =
graphar::CreatePropertyGroup(property_vector,
graphar::FileType::PARQUET);
// extend the vertex_info
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto maybe_extend_info = vertex_info->AddPropertyGroup(group);
ASSERT(maybe_extend_info.status().ok());
auto extend_info = maybe_extend_info.value();
diff --git a/cpp/src/graphar/arrow/chunk_reader.cc
b/cpp/src/graphar/arrow/chunk_reader.cc
index 22188821..f4add8a4 100644
--- a/cpp/src/graphar/arrow/chunk_reader.cc
+++ b/cpp/src/graphar/arrow/chunk_reader.cc
@@ -217,12 +217,12 @@ VertexPropertyArrowChunkReader::Make(
Result<std::shared_ptr<VertexPropertyArrowChunkReader>>
VertexPropertyArrowChunkReader::Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::shared_ptr<PropertyGroup>& property_group,
const util::FilterOptions& options) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex type ", label,
+ return Status::KeyError("The vertex type ", type,
" doesn't exist in graph ", graph_info->GetName(),
".");
}
@@ -231,18 +231,18 @@ VertexPropertyArrowChunkReader::Make(
Result<std::shared_ptr<VertexPropertyArrowChunkReader>>
VertexPropertyArrowChunkReader::Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::string& property_name, const util::FilterOptions& options) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex type ", label,
+ return Status::KeyError("The vertex type ", type,
" doesn't exist in graph ", graph_info->GetName(),
".");
}
auto property_group = vertex_info->GetPropertyGroup(property_name);
if (!property_group) {
return Status::KeyError("The property ", property_name,
- " doesn't exist in vertex type ", label, ".");
+ " doesn't exist in vertex type ", type, ".");
}
return Make(vertex_info, property_group, graph_info->GetPrefix(), options);
}
@@ -361,7 +361,7 @@ Status AdjListArrowChunkReader::seek(IdType offset) {
return Status::IndexError("The edge offset ", offset,
" is out of range [0,",
edge_info_->GetChunkSize() * chunk_num_,
- "), edge label: ", edge_info_->GetEdgeType());
+ "), edge type: ", edge_info_->GetEdgeType());
}
return Status::OK();
}
@@ -689,7 +689,7 @@ Status AdjListPropertyArrowChunkReader::seek(IdType offset)
{
return Status::IndexError("The edge offset ", offset,
" is out of range [0,",
edge_info_->GetChunkSize() * chunk_num_,
- "), edge label: ", edge_info_->GetEdgeType());
+ "), edge type: ", edge_info_->GetEdgeType());
}
return Status::OK();
}
diff --git a/cpp/src/graphar/arrow/chunk_reader.h
b/cpp/src/graphar/arrow/chunk_reader.h
index 375388ba..b204753b 100644
--- a/cpp/src/graphar/arrow/chunk_reader.h
+++ b/cpp/src/graphar/arrow/chunk_reader.h
@@ -114,12 +114,12 @@ class VertexPropertyArrowChunkReader {
* property group.
*
* @param graph_info The graph info.
- * @param label The vertex label.
+ * @param type The vertex type.
* @param property_group The property group of the vertex property.
* @param options The filter options, default is empty.
*/
static Result<std::shared_ptr<VertexPropertyArrowChunkReader>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::shared_ptr<PropertyGroup>& property_group,
const util::FilterOptions& options = {});
@@ -128,13 +128,13 @@ class VertexPropertyArrowChunkReader {
* property name.
*
* @param graph_info The graph info.
- * @param label The vertex label.
+ * @param type The vertex type.
* @param property_name The name of one property in the property group you
* want to read.
* @param options The filter options, default is empty.
*/
static Result<std::shared_ptr<VertexPropertyArrowChunkReader>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::string& property_name,
const util::FilterOptions& options = {});
@@ -240,9 +240,9 @@ class AdjListArrowChunkReader {
* @brief Create an AdjListArrowChunkReader instance from graph info.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The adj list type for the edges.
*/
static Result<std::shared_ptr<AdjListArrowChunkReader>> Make(
@@ -326,9 +326,9 @@ class AdjListOffsetArrowChunkReader {
* @brief Create an AdjListOffsetArrowChunkReader instance from graph info.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The adj list type for the edges.
*/
static Result<std::shared_ptr<AdjListOffsetArrowChunkReader>> Make(
@@ -458,9 +458,9 @@ class AdjListPropertyArrowChunkReader {
* and property group.
*
* @param graph_info The graph info that describes the graph.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param property_group The property group that describes the property
* group.
* @param adj_list_type The adj list type for the edges.
@@ -477,9 +477,9 @@ class AdjListPropertyArrowChunkReader {
* and property name.
*
* @param graph_info The graph info that describes the graph.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param property_name The name of one property in the property group you
* want to read.
* @param adj_list_type The adj list type for the edges.
diff --git a/cpp/src/graphar/arrow/chunk_writer.cc
b/cpp/src/graphar/arrow/chunk_writer.cc
index ed114f1b..2e3e7353 100644
--- a/cpp/src/graphar/arrow/chunk_writer.cc
+++ b/cpp/src/graphar/arrow/chunk_writer.cc
@@ -298,11 +298,11 @@ Result<std::shared_ptr<VertexPropertyWriter>>
VertexPropertyWriter::Make(
}
Result<std::shared_ptr<VertexPropertyWriter>> VertexPropertyWriter::Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const ValidateLevel& validate_level) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex ", label, " doesn't exist.");
+ return Status::KeyError("The vertex ", type, " doesn't exist.");
}
return Make(vertex_info, graph_info->GetPrefix(), validate_level);
}
diff --git a/cpp/src/graphar/arrow/chunk_writer.h
b/cpp/src/graphar/arrow/chunk_writer.h
index 83845c4a..65a8813e 100644
--- a/cpp/src/graphar/arrow/chunk_writer.h
+++ b/cpp/src/graphar/arrow/chunk_writer.h
@@ -176,15 +176,15 @@ class VertexPropertyWriter {
const ValidateLevel& validate_level = ValidateLevel::no_validate);
/**
- * @brief Construct a VertexPropertyWriter from graph info and vertex label.
+ * @brief Construct a VertexPropertyWriter from graph info and vertex type.
*
* @param graph_info The graph info that describes the graph.
- * @param label The vertex label.
+ * @param type The vertex type.
* @param validate_level The global validate level for the writer, default is
* no_validate.
*/
static Result<std::shared_ptr<VertexPropertyWriter>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const ValidateLevel& validate_level = ValidateLevel::no_validate);
private:
@@ -546,12 +546,12 @@ class EdgeChunkWriter {
const ValidateLevel& validate_level = ValidateLevel::no_validate);
/**
- * @brief Construct an EdgeChunkWriter from graph info and edge label.
+ * @brief Construct an EdgeChunkWriter from graph info and edge type.
*
* @param graph_info The graph info that describes the graph.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The adj list type for the edges.
* @param validate_level The global validate level for the writer, default is
* no_validate.
diff --git a/cpp/src/graphar/chunk_info_reader.cc
b/cpp/src/graphar/chunk_info_reader.cc
index da7aaedd..aa4598b3 100644
--- a/cpp/src/graphar/chunk_info_reader.cc
+++ b/cpp/src/graphar/chunk_info_reader.cc
@@ -85,27 +85,27 @@ VertexPropertyChunkInfoReader::Make(
Result<std::shared_ptr<VertexPropertyChunkInfoReader>>
VertexPropertyChunkInfoReader::Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::shared_ptr<PropertyGroup>& property_group) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex ", label, " doesn't exist.");
+ return Status::KeyError("The vertex ", type, " doesn't exist.");
}
return Make(vertex_info, property_group, graph_info->GetPrefix());
}
Result<std::shared_ptr<VertexPropertyChunkInfoReader>>
VertexPropertyChunkInfoReader::Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::string& property_name) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex ", label, " doesn't exist.");
+ return Status::KeyError("The vertex ", type, " doesn't exist.");
}
auto property_group = vertex_info->GetPropertyGroup(property_name);
if (!property_group) {
return Status::KeyError("The property ", property_name,
- " doesn't exist in vertex ", label, ".");
+ " doesn't exist in vertex ", type, ".");
}
return Make(vertex_info, property_group, graph_info->GetPrefix());
}
@@ -428,7 +428,7 @@ Status AdjListPropertyChunkInfoReader::seek(IdType offset) {
return Status::IndexError("The edge offset ", offset,
" is out of range [0,",
edge_info_->GetChunkSize() * chunk_num_,
- "), edge label: ", edge_info_->GetEdgeType());
+ "), edge type: ", edge_info_->GetEdgeType());
}
return Status::OK();
}
diff --git a/cpp/src/graphar/chunk_info_reader.h
b/cpp/src/graphar/chunk_info_reader.h
index 9a30e20e..de6a43f9 100644
--- a/cpp/src/graphar/chunk_info_reader.h
+++ b/cpp/src/graphar/chunk_info_reader.h
@@ -87,11 +87,11 @@ class VertexPropertyChunkInfoReader {
* property group
*
* @param graph_info The graph info.
- * @param label The vertex label.
+ * @param type The vertex type.
* @param property_group The property group of the vertex property.
*/
static Result<std::shared_ptr<VertexPropertyChunkInfoReader>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::shared_ptr<PropertyGroup>& property_group);
/**
@@ -99,12 +99,12 @@ class VertexPropertyChunkInfoReader {
* property name
*
* @param graph_info The graph info.
- * @param label The vertex label.
+ * @param type The vertex type.
* @param property_name The name of one property in the property group you
* want to read.
*/
static Result<std::shared_ptr<VertexPropertyChunkInfoReader>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
const std::string& property_name);
private:
@@ -182,9 +182,9 @@ class AdjListChunkInfoReader {
* @brief Create an AdjListChunkInfoReader instance from graph info.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The adj list type for the edges.
*/
static Result<std::shared_ptr<AdjListChunkInfoReader>> Make(
@@ -255,9 +255,9 @@ class AdjListOffsetChunkInfoReader {
* @brief Create an AdjListOffsetChunkInfoReader instance from graph info.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The adj list type for the edges.
*/
static Result<std::shared_ptr<AdjListOffsetChunkInfoReader>> Make(
@@ -344,9 +344,9 @@ class AdjListPropertyChunkInfoReader {
* and property group.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param property_group The property group of the edge property.
* @param adj_list_type The adj list type for the edge.
*/
@@ -361,9 +361,9 @@ class AdjListPropertyChunkInfoReader {
* and property name.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param property_name The name of one property in the property group you
* want to read.
* @param adj_list_type The adj list type for the edge.
diff --git a/cpp/src/graphar/fwd.h b/cpp/src/graphar/fwd.h
index 684aa8ca..0c019039 100644
--- a/cpp/src/graphar/fwd.h
+++ b/cpp/src/graphar/fwd.h
@@ -123,25 +123,25 @@ std::shared_ptr<AdjacentList> CreateAdjacentList(
/**
* @brief Create a VertexInfo instance
*
- * @param label The label of the vertex
+ * @param type The type of the vertex
* @param chunk_size The number of vertices in each vertex chunk
* @param property_groups The property group vector of the vertex
* @param prefix The prefix of the vertex info. If left empty, the default
- * prefix will be set to the label of the vertex
+ * prefix will be set to the type of the vertex
* @param version The format version of the vertex info
* @return vertex_info shared_ptr to VertexInfo
*/
std::shared_ptr<VertexInfo> CreateVertexInfo(
- const std::string& label, IdType chunk_size,
+ const std::string& type, IdType chunk_size,
const PropertyGroupVector& property_groups, const std::string& prefix = "",
std::shared_ptr<const InfoVersion> version = nullptr);
/**
* @brief Create an EdgeInfo instance
*
- * @param src_type The label of the source vertex.
- * @param edge_type The label of the edge
- * @param dst_type The label of the destination vertex
+ * @param src_type The type of the source vertex.
+ * @param edge_type The type of the edge
+ * @param dst_type The type of the destination vertex
* @param chunk_size The number of edges in each edge chunk
* @param src_chunk_size The number of source vertices in each vertex chunk
* @param dst_chunk_size The number of destination vertices in each vertex
diff --git a/cpp/src/graphar/high-level/edges_builder.h
b/cpp/src/graphar/high-level/edges_builder.h
index a302509f..925c3cac 100644
--- a/cpp/src/graphar/high-level/edges_builder.h
+++ b/cpp/src/graphar/high-level/edges_builder.h
@@ -299,9 +299,9 @@ class EdgesBuilder {
* @brief Construct an EdgesBuilder from graph info.
*
* @param graph_info The graph info that describes the graph.
- * @param src_type The label of the source vertex type.
- * @param edge_type The label of the edge type.
- * @param dst_type The label of the destination vertex type.
+ * @param src_type The type of the source vertex type.
+ * @param edge_type The type of the edge type.
+ * @param dst_type The type of the destination vertex type.
* @param adj_list_type The adj list type of the edges.
* @param num_vertices The total number of vertices for source or
destination.
* @param validate_level The global validate level for the builder, default
is
diff --git a/cpp/src/graphar/high-level/graph_reader.h
b/cpp/src/graphar/high-level/graph_reader.h
index 8b97b28c..20e7d8f8 100644
--- a/cpp/src/graphar/high-level/graph_reader.h
+++ b/cpp/src/graphar/high-level/graph_reader.h
@@ -297,16 +297,16 @@ class VerticesCollection {
size_t size() const noexcept { return vertex_num_; }
/**
- * @brief Construct a VerticesCollection from graph info and vertex label.
+ * @brief Construct a VerticesCollection from graph info and vertex type.
*
* @param graph_info The graph info.
- * @param label The vertex label.
+ * @param type The vertex type.
*/
static Result<std::shared_ptr<VerticesCollection>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label) {
- auto vertex_info = graph_info->GetVertexInfo(label);
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type) {
+ auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex ", label, " doesn't exist.");
+ return Status::KeyError("The vertex ", type, " doesn't exist.");
}
return std::make_shared<VerticesCollection>(vertex_info,
graph_info->GetPrefix());
@@ -704,12 +704,12 @@ class EdgesCollection {
virtual EdgeIter find_dst(IdType id, const EdgeIter& from) = 0;
/**
- * @brief Construct an EdgesCollection from graph info and edge label.
+ * @brief Construct an EdgesCollection from graph info and edge type.
*
* @param graph_info The graph info.
- * @param src_type The source vertex label.
- * @param edge_type The edge label.
- * @param dst_type The destination vertex label.
+ * @param src_type The source vertex type.
+ * @param edge_type The edge type.
+ * @param dst_type The destination vertex type.
* @param adj_list_type The type of adjList.
* @param vertex_chunk_begin The index of the begin vertex chunk, default 0.
* @param vertex_chunk_end The index of the end vertex chunk (not included),
diff --git a/cpp/src/graphar/high-level/vertices_builder.h
b/cpp/src/graphar/high-level/vertices_builder.h
index 9f8f1a84..7ccf8e35 100644
--- a/cpp/src/graphar/high-level/vertices_builder.h
+++ b/cpp/src/graphar/high-level/vertices_builder.h
@@ -273,21 +273,21 @@ class VerticesBuilder {
}
/**
- * @brief Construct a VertexBuilder from graph info and vertex label.
+ * @brief Construct a VertexBuilder from graph info and vertex type.
*
* @param graph_info The graph info that describes the graph.
- * @param label The label of the vertex.
+ * @param type The type of the vertex.
* @param start_vertex_index The start index of the vertices collection.
* @param validate_level The global validate level for the builder, default
is
* no_validate.
*/
static Result<std::shared_ptr<VerticesBuilder>> Make(
- const std::shared_ptr<GraphInfo>& graph_info, const std::string& label,
+ const std::shared_ptr<GraphInfo>& graph_info, const std::string& type,
IdType start_vertex_index = 0,
const ValidateLevel& validate_level = ValidateLevel::no_validate) {
- const auto vertex_info = graph_info->GetVertexInfo(label);
+ const auto vertex_info = graph_info->GetVertexInfo(type);
if (!vertex_info) {
- return Status::KeyError("The vertex type ", label,
+ return Status::KeyError("The vertex type ", type,
" doesn't exist in graph ",
graph_info->GetName(),
".");
}
diff --git a/cpp/test/test_graph.cc b/cpp/test/test_graph.cc
index d174428c..a2afe89f 100644
--- a/cpp/test/test_graph.cc
+++ b/cpp/test/test_graph.cc
@@ -35,9 +35,8 @@ TEST_CASE_METHOD(GlobalFixture, "Graph") {
SECTION("VerticesCollection") {
// construct vertices collection
- std::string label = "person", property = "firstName";
- auto maybe_vertices_collection =
- VerticesCollection::Make(graph_info, label);
+ std::string type = "person", property = "firstName";
+ auto maybe_vertices_collection = VerticesCollection::Make(graph_info,
type);
REQUIRE(!maybe_vertices_collection.has_error());
auto vertices = maybe_vertices_collection.value();
auto count = 0;
@@ -88,13 +87,12 @@ TEST_CASE_METHOD(GlobalFixture, "Graph") {
auto maybe_graph_info = GraphInfo::Load(path);
REQUIRE(maybe_graph_info.status().ok());
auto graph_info = maybe_graph_info.value();
- std::string label = "person", list_property = "feature";
- auto maybe_vertices_collection =
- VerticesCollection::Make(graph_info, label);
+ std::string type = "person", list_property = "feature";
+ auto maybe_vertices_collection = VerticesCollection::Make(graph_info,
type);
REQUIRE(!maybe_vertices_collection.has_error());
auto vertices = maybe_vertices_collection.value();
auto count = 0;
- auto vertex_info = graph_info->GetVertexInfo(label);
+ auto vertex_info = graph_info->GetVertexInfo(type);
auto data_type = vertex_info->GetPropertyType(list_property).value();
REQUIRE(data_type->id() == Type::LIST);
REQUIRE(data_type->value_type()->id() == Type::FLOAT);
@@ -201,9 +199,8 @@ TEST_CASE_METHOD(GlobalFixture, "Graph") {
REQUIRE(maybe_graph_info.status().ok());
auto graph_info = maybe_graph_info.value();
// get vertices collection
- std::string label = "Person", property = "born";
- auto maybe_vertices_collection =
- VerticesCollection::Make(graph_info, label);
+ std::string type = "Person", property = "born";
+ auto maybe_vertices_collection = VerticesCollection::Make(graph_info,
type);
REQUIRE(!maybe_vertices_collection.has_error());
auto vertices = maybe_vertices_collection.value();
// the count of valid property value
diff --git a/cpp/test/test_info.cc b/cpp/test/test_info.cc
index d424105f..c0349ee0 100644
--- a/cpp/test/test_info.cc
+++ b/cpp/test/test_info.cc
@@ -775,12 +775,16 @@ extra_info:
}
}
+/*
+TODO(acezen): need to mock S3 server to test this case, this private
+service is not available for public access.
+
TEST_CASE_METHOD(GlobalFixture, "LoadFromS3") {
// explicitly call InitS3 to initialize S3 APIs before using
// S3 file system.
InitializeS3();
std::string path =
- "s3://graphar/ldbc/ldbc.graph.yml"
+ "s3://graphscope/graphar/ldbc/ldbc.graph.yml"
"?endpoint_override=graphscope.oss-cn-beijing.aliyuncs.com";
auto graph_info_result = GraphInfo::Load(path);
std::cout << graph_info_result.status().message() << std::endl;
@@ -794,4 +798,5 @@ TEST_CASE_METHOD(GlobalFixture, "LoadFromS3") {
// explicitly call FinalizeS3 to avoid memory leak
FinalizeS3();
}
+*/
} // namespace graphar
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]