diff --git a/cpp/.gitignore b/cpp/.gitignore index 29b5a5943..cda5fffd9 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 a575b4860..b5d4adc31 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 94ed3eddf..530d5581e 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 cf01c0dd4..d6dbbc9c1 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 470a7c5d3..73abd2198 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 7995dac9a..d8231c6f4 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 d8f726179..32ae676b3 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 2108e7a83..fbc1339d2 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 bce9787f8..85faf3642 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& 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 c3a7b65b4..1ba306cdb 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& 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 ac9739c27..5cc341deb 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& 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 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 db8c272ee..9cd15f0f0 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 221888219..f4add8a40 100644 --- a/cpp/src/graphar/arrow/chunk_reader.cc +++ b/cpp/src/graphar/arrow/chunk_reader.cc @@ -217,12 +217,12 @@ VertexPropertyArrowChunkReader::Make( Result> VertexPropertyArrowChunkReader::Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& graph_info, const std::string& type, const std::shared_ptr& 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> VertexPropertyArrowChunkReader::Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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 375388ba9..b204753bd 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& graph_info, const std::string& type, const std::shared_ptr& 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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> 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> 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 ed114f1ba..2e3e73539 100644 --- a/cpp/src/graphar/arrow/chunk_writer.cc +++ b/cpp/src/graphar/arrow/chunk_writer.cc @@ -298,11 +298,11 @@ Result> VertexPropertyWriter::Make( } Result> VertexPropertyWriter::Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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 83845c4a5..65a8813ef 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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 da7aaedde..aa4598b38 100644 --- a/cpp/src/graphar/chunk_info_reader.cc +++ b/cpp/src/graphar/chunk_info_reader.cc @@ -85,27 +85,27 @@ VertexPropertyChunkInfoReader::Make( Result> VertexPropertyChunkInfoReader::Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& graph_info, const std::string& type, const std::shared_ptr& 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> VertexPropertyChunkInfoReader::Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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 9a30e20eb..de6a43f9c 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& graph_info, const std::string& type, const std::shared_ptr& 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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> 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> 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 684aa8ca6..0c0190399 100644 --- a/cpp/src/graphar/fwd.h +++ b/cpp/src/graphar/fwd.h @@ -123,25 +123,25 @@ std::shared_ptr 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 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 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 a302509f2..925c3cac8 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 8b97b28c1..20e7d8f8d 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> Make( - const std::shared_ptr& graph_info, const std::string& label) { - auto vertex_info = graph_info->GetVertexInfo(label); + const std::shared_ptr& 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(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 9f8f1a846..7ccf8e356 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> Make( - const std::shared_ptr& graph_info, const std::string& label, + const std::shared_ptr& 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 d174428c5..a2afe89f1 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 d424105f2..c0349ee03 100644 --- a/cpp/test/test_info.cc +++ b/cpp/test/test_info.cc @@ -775,12 +775,16 @@ version: gar/v1 } } +/* +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