Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Member Functions | Static Public Member Functions | List of all members
graphar::VerticesCollection Class Reference

VerticesCollection is designed for reading a collection of vertices. More...

#include <graph_reader.h>

Public Member Functions

 VerticesCollection (const std::shared_ptr< VertexInfo > &vertex_info, const std::string &prefix, const bool is_filtered=false, std::vector< IdType > filtered_ids={})
 Initialize the VerticesCollection. More...
 
VertexIter begin () noexcept
 
VertexIter end () noexcept
 
VertexIter find (IdType id)
 
size_t size () const noexcept
 
Result< std::vector< IdType > > filter (const std::vector< std::string > &filter_labels, std::vector< IdType > *new_valid_chunk=nullptr)
 
Result< std::vector< IdType > > filter_by_acero (const std::vector< std::string > &filter_labels) const
 
Result< std::vector< IdType > > filter (const std::string &property_name, std::shared_ptr< Expression > filter_expression, std::vector< IdType > *new_valid_chunk=nullptr)
 

Static Public Member Functions

static Result< std::shared_ptr< VerticesCollection > > verticesWithLabel (const std::string &filter_label, const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 Query vertices with a specific label. More...
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithLabelbyAcero (const std::string &filter_label, const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithLabel (const std::string &filter_label, const std::shared_ptr< VerticesCollection > &vertices_collection)
 Query vertices with a specific label within a given collection. More...
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithMultipleLabels (const std::vector< std::string > &filter_labels, const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 Query vertices with multiple labels. More...
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithMultipleLabelsbyAcero (const std::vector< std::string > &filter_labels, const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithProperty (const std::string property_name, const graphar::util::Filter filter, const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithProperty (const std::string property_name, const graphar::util::Filter filter, const std::shared_ptr< VerticesCollection > &vertices_collection)
 
static Result< std::shared_ptr< VerticesCollection > > verticesWithMultipleLabels (const std::vector< std::string > &filter_labels, const std::shared_ptr< VerticesCollection > &vertices_collection)
 Query vertices with multiple labels within a given collection. More...
 
static Result< std::shared_ptr< VerticesCollection > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &type)
 Construct a VerticesCollection from graph info and vertex label. More...
 

Detailed Description

VerticesCollection is designed for reading a collection of vertices.

Definition at line 321 of file graph_reader.h.

Constructor & Destructor Documentation

◆ VerticesCollection()

graphar::VerticesCollection::VerticesCollection ( const std::shared_ptr< VertexInfo > &  vertex_info,
const std::string &  prefix,
const bool  is_filtered = false,
std::vector< IdType >  filtered_ids = {} 
)
inlineexplicit

Initialize the VerticesCollection.

Parameters
vertex_infoThe vertex info that describes the vertex type.
labelsThe labels of the vertex.
prefixThe absolute prefix.

Definition at line 330 of file graph_reader.h.

Member Function Documentation

◆ begin()

VertexIter graphar::VerticesCollection::begin ( )
inlinenoexcept

The iterator pointing to the first vertex.

Definition at line 351 of file graph_reader.h.

◆ end()

VertexIter graphar::VerticesCollection::end ( )
inlinenoexcept

The iterator pointing to the past-the-end element.

Definition at line 357 of file graph_reader.h.

◆ filter()

Result< std::vector< IdType > > graphar::VerticesCollection::filter ( const std::vector< std::string > &  filter_labels,
std::vector< IdType > *  new_valid_chunk = nullptr 
)

The vertex id list that satisfies the label filter condition.

Definition at line 152 of file graph_reader.cc.

◆ find()

VertexIter graphar::VerticesCollection::find ( IdType  id)
inline

The iterator pointing to the vertex with specific id.

Definition at line 366 of file graph_reader.h.

◆ Make()

static Result<std::shared_ptr<VerticesCollection> > graphar::VerticesCollection::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type 
)
inlinestatic

Construct a VerticesCollection from graph info and vertex label.

Parameters
graph_infoThe graph info.
typeThe vertex type.

Definition at line 466 of file graph_reader.h.

◆ size()

size_t graphar::VerticesCollection::size ( ) const
inlinenoexcept

Get the number of vertices in the collection.

Definition at line 371 of file graph_reader.h.

◆ verticesWithLabel() [1/2]

Result< std::shared_ptr< VerticesCollection > > graphar::VerticesCollection::verticesWithLabel ( const std::string &  filter_label,
const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type 
)
static

Query vertices with a specific label.

Parameters
filter_labelThe label to query vertices by
graph_infoA smart pointer to GraphInfo that contains details about the graph
typeThe type of vertices to query
Returns
A VerticesCollection containing all vertices that have the specified label

Definition at line 334 of file graph_reader.cc.

◆ verticesWithLabel() [2/2]

Result< std::shared_ptr< VerticesCollection > > graphar::VerticesCollection::verticesWithLabel ( const std::string &  filter_label,
const std::shared_ptr< VerticesCollection > &  vertices_collection 
)
static

Query vertices with a specific label within a given collection.

Parameters
filter_labelThe label to query vertices by
vertices_collectionThe collection of vertices to search within
Returns
A VerticesCollection containing all vertices from the specified collection that have the specified label

Definition at line 364 of file graph_reader.cc.

◆ verticesWithMultipleLabels() [1/2]

Result< std::shared_ptr< VerticesCollection > > graphar::VerticesCollection::verticesWithMultipleLabels ( const std::vector< std::string > &  filter_labels,
const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type 
)
static

Query vertices with multiple labels.

Parameters
filter_labelsA vector of labels to query vertices by
graph_infoA smart pointer to GraphInfo that contains details about the graph
typeThe type of vertices to query
Returns
A VerticesCollection containing all vertices that have all of the specified labels

Definition at line 394 of file graph_reader.cc.

◆ verticesWithMultipleLabels() [2/2]

Result< std::shared_ptr< VerticesCollection > > graphar::VerticesCollection::verticesWithMultipleLabels ( const std::vector< std::string > &  filter_labels,
const std::shared_ptr< VerticesCollection > &  vertices_collection 
)
static

Query vertices with multiple labels within a given collection.

Parameters
filter_labelsA vector of labels to query vertices by
vertices_collectionThe collection of vertices to search within
Returns
A VerticesCollection containing all vertices from the specified collection that have all of the specified labels

Definition at line 424 of file graph_reader.cc.


The documentation for this class was generated from the following files: