Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
VertexInfo is a class to describe the vertex information, including the vertex label, chunk size, property groups, and prefix. More...
#include <graph_info.h>
Classes | |
class | Impl |
Public Member Functions | |
VertexInfo (const std::string &label, IdType chunk_size, const PropertyGroupVector &property_groups, const std::string &prefix="", std::shared_ptr< const InfoVersion > version=nullptr) | |
Result< std::shared_ptr< VertexInfo > > | AddPropertyGroup (std::shared_ptr< PropertyGroup > property_group) const |
const std::string & | GetLabel () const |
IdType | GetChunkSize () const |
const std::string & | GetPrefix () const |
const std::shared_ptr< const InfoVersion > & | version () const |
int | PropertyGroupNum () const |
const PropertyGroupVector & | GetPropertyGroups () const |
std::shared_ptr< PropertyGroup > | GetPropertyGroup (const std::string &property_name) const |
std::shared_ptr< PropertyGroup > | GetPropertyGroupByIndex (int index) const |
Result< std::shared_ptr< DataType > > | GetPropertyType (const std::string &property_name) const |
bool | HasProperty (const std::string &property_name) const |
Status | Save (const std::string &file_name) const |
Result< std::string > | Dump () const noexcept |
bool | IsPrimaryKey (const std::string &property_name) const |
bool | IsNullableKey (const std::string &property_name) const |
bool | HasPropertyGroup (const std::shared_ptr< PropertyGroup > &property_group) const |
Result< std::string > | GetFilePath (std::shared_ptr< PropertyGroup > property_group, IdType chunk_index) const |
Result< std::string > | GetPathPrefix (std::shared_ptr< PropertyGroup > property_group) const |
Result< std::string > | GetVerticesNumFilePath () const |
bool | IsValidated () const |
Static Public Member Functions | |
static Result< std::shared_ptr< VertexInfo > > | Load (std::shared_ptr< Yaml > yaml) |
static Result< std::shared_ptr< VertexInfo > > | Load (const std::string &input) |
VertexInfo is a class to describe the vertex information, including the vertex label, chunk size, property groups, and prefix.
Definition at line 174 of file graph_info.h.
|
explicit |
Construct a VertexInfo object with the given information and property group.
label | The label of the vertex. |
chunk_size | The number of vertices in each vertex chunk. |
property_groups | The property group vector of the vertex. |
prefix | The prefix of the vertex info. If left empty, the default prefix will be set to the label of the vertex. |
version | The format version of the vertex info. |
Definition at line 253 of file graph_info.cc.
Result< std::shared_ptr< VertexInfo > > graphar::VertexInfo::AddPropertyGroup | ( | std::shared_ptr< PropertyGroup > | property_group | ) | const |
Adds a property group to the vertex info and returns a new VertexInfo
property_group | The PropertyGroup object to add. |
Definition at line 357 of file graph_info.cc.
|
noexcept |
Returns the vertex info as a YAML formatted string.
Definition at line 442 of file graph_info.cc.
IdType graphar::VertexInfo::GetChunkSize | ( | ) | const |
Get the chunk size of the vertex.
Definition at line 263 of file graph_info.cc.
Result< std::string > graphar::VertexInfo::GetFilePath | ( | std::shared_ptr< PropertyGroup > | property_group, |
IdType | chunk_index | ||
) | const |
Get the file path for the specified property group and chunk index.
property_group | The PropertyGroup object to get the file path for. |
chunk_index | The chunk index. |
Definition at line 271 of file graph_info.cc.
const std::string & graphar::VertexInfo::GetLabel | ( | ) | const |
Get the label of the vertex.
Definition at line 261 of file graph_info.cc.
Result< std::string > graphar::VertexInfo::GetPathPrefix | ( | std::shared_ptr< PropertyGroup > | property_group | ) | const |
Get the path prefix for the specified property group.
property_group | The PropertyGroup object to get the path prefix for. |
Definition at line 280 of file graph_info.cc.
const std::string & graphar::VertexInfo::GetPrefix | ( | ) | const |
Get the path prefix of the vertex.
Definition at line 265 of file graph_info.cc.
std::shared_ptr< PropertyGroup > graphar::VertexInfo::GetPropertyGroup | ( | const std::string & | property_name | ) | const |
Get the property group that contains the specified property.
property_name | The name of the property. |
Definition at line 296 of file graph_info.cc.
std::shared_ptr< PropertyGroup > graphar::VertexInfo::GetPropertyGroupByIndex | ( | int | index | ) | const |
Get the property group at the specified index.
index | The index of the property group. |
Definition at line 302 of file graph_info.cc.
const PropertyGroupVector & graphar::VertexInfo::GetPropertyGroups | ( | ) | const |
Get the property groups of the vertex.
Definition at line 310 of file graph_info.cc.
Result< std::shared_ptr< DataType > > graphar::VertexInfo::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 348 of file graph_info.cc.
Result< std::string > graphar::VertexInfo::GetVerticesNumFilePath | ( | ) | const |
Get the file path for the number of vertices.
Definition at line 288 of file graph_info.cc.
bool graphar::VertexInfo::HasProperty | ( | const std::string & | property_name | ) | const |
Get whether the vertex info contains the specified property.
property_name | The name of the property. |
Definition at line 330 of file graph_info.cc.
bool graphar::VertexInfo::HasPropertyGroup | ( | const std::shared_ptr< PropertyGroup > & | property_group | ) | const |
Returns whether the vertex info contains the specified property group.
property_group | The PropertyGroup object to check for. |
Definition at line 335 of file graph_info.cc.
bool graphar::VertexInfo::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 322 of file graph_info.cc.
bool graphar::VertexInfo::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 314 of file graph_info.cc.
bool graphar::VertexInfo::IsValidated | ( | ) | const |
Returns whether the vertex info is validated.
Definition at line 374 of file graph_info.cc.
|
static |
Loads vertex info from a YAML string.
input | The YAML content string. |
Definition at line 437 of file graph_info.cc.
|
static |
Loads vertex info from a YAML object.
yaml | A shared pointer to a Yaml object containing the YAML string. |
Definition at line 387 of file graph_info.cc.
int graphar::VertexInfo::PropertyGroupNum | ( | ) | const |
Get the number of property groups of the vertex.
Definition at line 292 of file graph_info.cc.
Status graphar::VertexInfo::Save | ( | const std::string & | file_name | ) | const |
Saves the vertex info to a YAML file.
file_name | The name of the file to save to. |
Definition at line 480 of file graph_info.cc.
const std::shared_ptr< const InfoVersion > & graphar::VertexInfo::version | ( | ) | const |
Get the version info of the vertex.
Definition at line 267 of file graph_info.cc.