Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
EdgeInfo is a class to describe the edge information, including the source vertex type, edge type, destination vertex type, chunk size, adjacent list property groups, and prefix. More...
#include <graph_info.h>
Classes | |
class | Impl |
Public Member Functions | |
EdgeInfo (const std::string &src_type, const std::string &edge_type, const std::string &dst_type, 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 & | GetSrcType () const |
const std::string & | GetEdgeType () const |
const std::string & | GetDstType () 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 type, edge type, destination vertex type, chunk size, adjacent list property groups, and prefix.
Definition at line 398 of file graph_info.h.
|
explicit |
Construct an EdgeInfo object with the given information and property groups.
src_type | The type of the source vertex. |
edge_type | The type of the edge. |
dst_type | The type 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 643 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 832 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 848 of file graph_info.cc.
|
noexcept |
Returns the edge info as a YAML formatted string.
Definition at line 972 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 746 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 764 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 756 of file graph_info.cc.
IdType graphar::EdgeInfo::GetChunkSize | ( | ) | const |
Get the number of edges in each edge chunk.
Definition at line 662 of file graph_info.cc.
IdType graphar::EdgeInfo::GetDstChunkSize | ( | ) | const |
Get the number of destination vertices in each vertex chunk.
Definition at line 666 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetDstType | ( | ) | const |
Get the type of the destination vertex.
Definition at line 660 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 738 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetEdgeType | ( | ) | const |
Get the type of the edge.
Definition at line 658 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 772 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetPrefix | ( | ) | const |
Get the path prefix of the edge.
Definition at line 668 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 780 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 716 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 722 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 795 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 807 of file graph_info.cc.
IdType graphar::EdgeInfo::GetSrcChunkSize | ( | ) | const |
Get the number of source vertices in each vertex chunk.
Definition at line 664 of file graph_info.cc.
const std::string & graphar::EdgeInfo::GetSrcType | ( | ) | const |
Get the type of the source vertex.
Definition at line 656 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 730 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 676 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 681 of file graph_info.cc.
bool graphar::EdgeInfo::IsDirected | ( | ) | const |
Returns whether the edge is directed.
Definition at line 670 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 824 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 816 of file graph_info.cc.
bool graphar::EdgeInfo::IsValidated | ( | ) | const |
Returns whether the edge info is validated.
Definition at line 867 of file graph_info.cc.
|
static |
Loads edge info from a YAML string.
input | The YAML content string. |
Definition at line 967 of file graph_info.cc.
|
static |
Loads the yaml as an EdgeInfo instance.
Definition at line 886 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 1027 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 672 of file graph_info.cc.