Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
EdgeInfo is a class to describe the edge information, including the source vertex label, edge label, destination vertex label, chunk size, adjacent list property groups, and prefix. More...
#include <graph_info.h>
Classes | |
class | Impl |
Public Member Functions | |
EdgeInfo (const std::string &src_label, const std::string &edge_label, const std::string &dst_label, IdType chunk_size, IdType src_chunk_size, IdType dst_chunk_size, bool directed, const AdjacentListVector &adjacent_lists, const PropertyGroupVector &property_groups, const std::string &prefix="", std::shared_ptr< const InfoVersion > version=nullptr) | |
Construct an EdgeInfo object with the given information and property groups. More... | |
Result< std::shared_ptr< EdgeInfo > > | AddAdjacentList (std::shared_ptr< AdjacentList > adj_list) const |
Result< std::shared_ptr< EdgeInfo > > | AddPropertyGroup (std::shared_ptr< PropertyGroup > property_group) const |
const std::string & | GetSrcLabel () const |
const std::string & | GetEdgeLabel () const |
const std::string & | GetDstLabel () const |
IdType | GetChunkSize () const |
IdType | GetSrcChunkSize () const |
IdType | GetDstChunkSize () const |
const std::string & | GetPrefix () const |
bool | IsDirected () const |
const std::shared_ptr< const InfoVersion > & | version () const |
bool | HasAdjacentListType (AdjListType adj_list_type) const |
bool | HasProperty (const std::string &property_name) const |
Returns whether the edge info contains the given property. More... | |
bool | HasPropertyGroup (const std::shared_ptr< PropertyGroup > &property_group) const |
Returns whether the edge info contains the given property group. | |
std::shared_ptr< AdjacentList > | GetAdjacentList (AdjListType adj_list_type) const |
int | PropertyGroupNum () const |
Get the number of property groups. | |
const PropertyGroupVector & | GetPropertyGroups () const |
Get the property groups. | |
std::shared_ptr< PropertyGroup > | GetPropertyGroup (const std::string &property) const |
Get the property group containing the given property. More... | |
std::shared_ptr< PropertyGroup > | GetPropertyGroupByIndex (int index) const |
Get the property group at the specified index. More... | |
Result< std::string > | GetVerticesNumFilePath (AdjListType adj_list_type) const |
Get the file path for the number of vertices. More... | |
Result< std::string > | GetEdgesNumFilePath (IdType vertex_chunk_index, AdjListType adj_list_type) const |
Result< std::string > | GetAdjListFilePath (IdType vertex_chunk_index, IdType edge_chunk_index, AdjListType adj_list_type) const |
Get the file path of adj list topology chunk. More... | |
Result< std::string > | GetAdjListPathPrefix (AdjListType adj_list_type) const |
Get the path prefix of the adjacency list topology chunk for the given adjacency list type. More... | |
Result< std::string > | GetAdjListOffsetFilePath (IdType vertex_chunk_index, AdjListType adj_list_type) const |
Get the adjacency list offset chunk file path of vertex chunk the offset chunks is aligned with the vertex chunks. More... | |
Result< std::string > | GetOffsetPathPrefix (AdjListType adj_list_type) const |
Result< std::string > | GetPropertyFilePath (const std::shared_ptr< PropertyGroup > &property_group, AdjListType adj_list_type, IdType vertex_chunk_index, IdType edge_chunk_index) const |
Get the chunk file path of adj list property group the property group chunks is aligned with the adj list topology chunks. More... | |
Result< std::string > | GetPropertyGroupPathPrefix (const std::shared_ptr< PropertyGroup > &property_group, AdjListType adj_list_type) const |
Result< std::shared_ptr< DataType > > | GetPropertyType (const std::string &property_name) const |
bool | IsPrimaryKey (const std::string &property_name) const |
bool | IsNullableKey (const std::string &property_name) const |
Status | Save (const std::string &file_name) const |
Result< std::string > | Dump () const noexcept |
bool | IsValidated () const |
Static Public Member Functions | |
static Result< std::shared_ptr< EdgeInfo > > | Load (std::shared_ptr< Yaml > yaml) |
static Result< std::shared_ptr< EdgeInfo > > | Load (const std::string &input) |
EdgeInfo is a class to describe the edge information, including the source vertex label, edge label, destination vertex label, chunk size, adjacent list property groups, and prefix.
Definition at line 382 of file graph_info.h.
|
explicit |
Construct an EdgeInfo object with the given information and property groups.
src_label | The label of the source vertex. |
edge_label | The label of the edge. |
dst_label | The label of the destination vertex. |
chunk_size | The number of edges in each edge chunk. |
src_chunk_size | The number of source vertices in each vertex chunk. |
dst_chunk_size | The number of destination vertices in each vertex chunk. |
directed | Whether the edge is directed. |
adjacent_lists | The adjacency list vector of the edge. |
property_groups | The property group vector of the edge. |
prefix | The path prefix of the edge info. |
version | The version of the edge info. |
Definition at line 586 of file graph_info.cc.
Result< std::shared_ptr< EdgeInfo > > graphar::EdgeInfo::AddAdjacentList | ( | std::shared_ptr< AdjacentList > | adj_list | ) | const |
Add an adjacency list information to the edge info and returns a new EdgeInfo. The adjacency list information indicating the adjacency list stored with CSR, CSC, or COO format.
adj_list | The adjacency list to add. |
Definition at line 775 of file graph_info.cc.
Result< std::shared_ptr< EdgeInfo > > graphar::EdgeInfo::AddPropertyGroup | ( | std::shared_ptr< PropertyGroup > | property_group | ) | const |
Add a property group to edge info and returns a new EdgeInfo.
property_group | Property group to add. |
Definition at line 791 of file graph_info.cc.
|
noexcept |
Returns the edge info as a YAML formatted string.
Definition at line 911 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetAdjListFilePath | ( | IdType | vertex_chunk_index, |
IdType | edge_chunk_index, | ||
AdjListType | adj_list_type | ||
) | const |
Get the file path of adj list topology chunk.
vertex_chunk_index | the vertex chunk index |
edge_chunk_index | index of edge adj list chunk of the vertex chunk |
adj_list_type | The adjacency list type. |
Definition at line 689 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetAdjListOffsetFilePath | ( | IdType | vertex_chunk_index, |
AdjListType | adj_list_type | ||
) | const |
Get the adjacency list offset chunk file path of vertex chunk the offset chunks is aligned with the vertex chunks.
vertex_chunk_index | index of vertex chunk |
adj_list_type | The adjacency list type. |
Definition at line 707 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetAdjListPathPrefix | ( | AdjListType | adj_list_type | ) | const |
Get the path prefix of the adjacency list topology chunk for the given adjacency list type.
adj_list_type | The adjacency list type. |
Definition at line 699 of file graph_info.cc.
IdType graphar::EdgeInfo::GetChunkSize | ( | ) | const |
Get the number of edges in each edge chunk.
Definition at line 605 of file graph_info.cc.
IdType graphar::EdgeInfo::GetDstChunkSize | ( | ) | const |
Get the number of destination vertices in each vertex chunk.
Definition at line 609 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetDstLabel | ( | ) | const |
Get the label of the destination vertex.
Definition at line 603 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetEdgeLabel | ( | ) | const |
Get the label of the edge.
Definition at line 601 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetEdgesNumFilePath | ( | IdType | vertex_chunk_index, |
AdjListType | adj_list_type | ||
) | const |
Get the file path for the number of edges.
vertex_chunk_index | the vertex chunk index |
adj_list_type | The adjacency list type. |
Definition at line 681 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetOffsetPathPrefix | ( | AdjListType | adj_list_type | ) | const |
Get the path prefix of the adjacency list offset chunk for the given adjacency list type.
adj_list_type | The adjacency list type. |
Definition at line 715 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetPrefix | ( | ) | const |
Get the path prefix of the edge.
Definition at line 611 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetPropertyFilePath | ( | const std::shared_ptr< PropertyGroup > & | property_group, |
AdjListType | adj_list_type, | ||
IdType | vertex_chunk_index, | ||
IdType | edge_chunk_index | ||
) | const |
Get the chunk file path of adj list property group the property group chunks is aligned with the adj list topology chunks.
property_group | property group |
adj_list_type | adj list type that the property group belongs to |
vertex_chunk_index | the vertex chunk index |
edge_chunk_index | index of edge property group chunk of the vertex chunk |
Definition at line 723 of file graph_info.cc.
std::shared_ptr< PropertyGroup > graphar::EdgeInfo::GetPropertyGroup | ( | const std::string & | property | ) | const |
Get the property group containing the given property.
property | Property name. |
Definition at line 659 of file graph_info.cc.
std::shared_ptr< PropertyGroup > graphar::EdgeInfo::GetPropertyGroupByIndex | ( | int | index | ) | const |
Get the property group at the specified index.
index | The index of the property group. |
Definition at line 665 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetPropertyGroupPathPrefix | ( | const std::shared_ptr< PropertyGroup > & | property_group, |
AdjListType | adj_list_type | ||
) | const |
Get the path prefix of the property group chunk for the given adjacency list type.
property_group | property group. |
adj_list_type | The adjacency list type. |
Definition at line 738 of file graph_info.cc.
Result< std::shared_ptr< DataType > > graphar::EdgeInfo::GetPropertyType | ( | const std::string & | property_name | ) | const |
Get the data type of the specified property.
property_name | The name of the property. |
Definition at line 750 of file graph_info.cc.
IdType graphar::EdgeInfo::GetSrcChunkSize | ( | ) | const |
Get the number of source vertices in each vertex chunk.
Definition at line 607 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetSrcLabel | ( | ) | const |
Get the label of the source vertex.
Definition at line 599 of file graph_info.cc.
Result< std::string > graphar::EdgeInfo::GetVerticesNumFilePath | ( | AdjListType | adj_list_type | ) | const |
Get the file path for the number of vertices.
adj_list_type | The adjacency list type. |
Definition at line 673 of file graph_info.cc.
bool graphar::EdgeInfo::HasAdjacentListType | ( | AdjListType | adj_list_type | ) | const |
Return whether the edge info contains the adjacency list information.
adj_list_type | The adjacency list type. |
Definition at line 619 of file graph_info.cc.
bool graphar::EdgeInfo::HasProperty | ( | const std::string & | property_name | ) | const |
Returns whether the edge info contains the given property.
property | Property name to check. |
Definition at line 624 of file graph_info.cc.
bool graphar::EdgeInfo::IsDirected | ( | ) | const |
Returns whether the edge is directed.
Definition at line 613 of file graph_info.cc.
bool graphar::EdgeInfo::IsNullableKey | ( | const std::string & | property_name | ) | const |
Returns whether the specified property is a nullable key.
property_name | The name of the property. |
Definition at line 767 of file graph_info.cc.
bool graphar::EdgeInfo::IsPrimaryKey | ( | const std::string & | property_name | ) | const |
Returns whether the specified property is a primary key.
property_name | The name of the property. |
Definition at line 759 of file graph_info.cc.
bool graphar::EdgeInfo::IsValidated | ( | ) | const |
Returns whether the edge info is validated.
Definition at line 810 of file graph_info.cc.
|
static |
Loads edge info from a YAML string.
input | The YAML content string. |
Definition at line 906 of file graph_info.cc.
|
static |
Loads the yaml as an EdgeInfo instance.
Definition at line 830 of file graph_info.cc.
Status graphar::EdgeInfo::Save | ( | const std::string & | file_name | ) | const |
Saves the edge info to a YAML file.
file_name | The name of the file to save to. |
Definition at line 966 of file graph_info.cc.
const std::shared_ptr< const InfoVersion > & graphar::EdgeInfo::version | ( | ) | const |
Get the version info of the edge.
Definition at line 615 of file graph_info.cc.