|
Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
VertexInfo is a class to describe the vertex information, including the vertex type, chunk size, property groups, and prefix. More...
#include <graph_info.h>
Classes | |
| class | Impl |
Public Member Functions | |
| VertexInfo (const std::string &type, IdType chunk_size, const PropertyGroupVector &property_groups, const std::vector< std::string > &labels={}, const std::string &prefix="", std::shared_ptr< const InfoVersion > version=nullptr) | |
| Result< std::shared_ptr< VertexInfo > > | AddPropertyGroup (std::shared_ptr< PropertyGroup > property_group) const |
| Result< std::shared_ptr< VertexInfo > > | RemovePropertyGroup (std::shared_ptr< PropertyGroup > property_group) const |
| Removes a property group from the VertexInfo instance and returns a new VertexInfo. More... | |
| const std::string & | GetType () const |
| IdType | GetChunkSize () const |
| const std::string & | GetPrefix () const |
| const std::shared_ptr< const InfoVersion > & | version () const |
| const std::vector< std::string > & | GetLabels () 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 |
| Result< Cardinality > | GetPropertyCardinality (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 type, chunk size, property groups, and prefix.
Definition at line 180 of file graph_info.h.
|
explicit |
Construct a VertexInfo object with the given information and property group.
| type | The type of the vertex. |
| chunk_size | The number of vertices in each vertex chunk. |
| property_groups | The property group vector of the vertex. |
| labels | The labels of the vertex. |
| prefix | The prefix of the vertex info. If left empty, the default prefix will be set to the type of the vertex. |
| version | The format version of the vertex info. |
Definition at line 280 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 399 of file graph_info.cc.
|
noexcept |
Returns the vertex info as a YAML formatted string.
Definition at line 518 of file graph_info.cc.
| IdType graphar::VertexInfo::GetChunkSize | ( | ) | const |
Get the chunk size of the vertex.
Definition at line 292 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 304 of file graph_info.cc.
| const std::vector< std::string > & graphar::VertexInfo::GetLabels | ( | ) | const |
Get the labels of the vertex.
Definition at line 296 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 313 of file graph_info.cc.
| const std::string & graphar::VertexInfo::GetPrefix | ( | ) | const |
Get the path prefix of the vertex.
Definition at line 294 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 329 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 335 of file graph_info.cc.
| const PropertyGroupVector & graphar::VertexInfo::GetPropertyGroups | ( | ) | const |
Get the property groups of the vertex.
Definition at line 343 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 381 of file graph_info.cc.
| const std::string & graphar::VertexInfo::GetType | ( | ) | const |
Get the type of the vertex.
Definition at line 290 of file graph_info.cc.
| Result< std::string > graphar::VertexInfo::GetVerticesNumFilePath | ( | ) | const |
Get the file path for the number of vertices.
Definition at line 321 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 363 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 368 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 355 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 347 of file graph_info.cc.
| bool graphar::VertexInfo::IsValidated | ( | ) | const |
Returns whether the vertex info is validated.
Definition at line 437 of file graph_info.cc.
|
static |
Loads vertex info from a YAML string.
| input | The YAML content string. |
Definition at line 513 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 451 of file graph_info.cc.
| int graphar::VertexInfo::PropertyGroupNum | ( | ) | const |
Get the number of property groups of the vertex.
Definition at line 325 of file graph_info.cc.
| Result< std::shared_ptr< VertexInfo > > graphar::VertexInfo::RemovePropertyGroup | ( | std::shared_ptr< PropertyGroup > | property_group | ) | const |
Removes a property group from the VertexInfo instance and returns a new VertexInfo.
| property_group | The property group to remove. |
Definition at line 416 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 566 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 300 of file graph_info.cc.