IBM SYSTEMG G RUNTIME & NATIVE STORE  0.5
IBM Native Graph Computing and Storage System based on IBM Parallel Programming Library
 All Classes Functions Variables Typedefs Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | List of all members
ibmppl::ibm_multiproperty_graph_generic< ST > Class Template Reference

IBM Multi property graph class to store multiple properties. More...

#include <ibm_multiproperty_graph.hpp>

Inheritance diagram for ibmppl::ibm_multiproperty_graph_generic< ST >:
ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >

Public Types

typedef base_type::edged_type edged_type
 Edge descriptor or unique edge identifier.
 
typedef base_type::vertex_type vertex_type
 The vertex class; storage for property and edges.
 
typedef base_type::edge_type edge_type
 
typedef base_type::vertexd_type vertexd_type
 Vertex descriptor. Unique vertex identifier.
 
typedef base_type::vertex_property vertex_property
 Property type associated with each vertex.
 
typedef base_type::edge_property edge_property
 Property type associated with each edge.
 
typedef base_type::edge_iterator base_edge_iterator
 Iterator type for traversing vertices.
 
typedef base_type::vertex_iterator base_vertex_iterator
 
typedef base_type::pred_iterator base_pred_iterator
 
typedef imp_vertex_iterator
< vertex_type,
base_vertex_iterator,
this_type, vertexd_type
vertex_iterator
 
typedef imp_edge_iterator
< edge_type,
base_edge_iterator, this_type,
edged_type
edge_iterator
 
typedef imp_pred_iterator
< edge_type,
base_pred_iterator, this_type
pred_iterator
 
typedef
omnidirectional_edge_iterator_t
< edge_iterator,
vertex_iterator, this_type
omni_iterator
 
typedef
base_type::const_vertex_iterator 
const_vertex_iterator
 Const Iterator type for traversing edges. You won't be able to modify properties when using this iterator.
 
typedef std::string property_name_type
 
typedef std::string property_value_type
 
typedef std::string label_string_type
 
typedef std::string vclass_string_type
 
typedef
mp_subproperty_iterator_t
< vertex_iterator,
edge_iterator
property_iterator
 
- Public Types inherited from ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >
typedef base_type::edged_type edged_type
 Edge descriptor or unique edge identifier.
 
typedef base_type::vertexd_type vertexd_type
 Vertex descriptor. Unique vertex identifier.
 
typedef base_type::vertex_property vertex_property
 Property type associated with each vertex.
 
typedef base_type::edge_property edge_property
 Property type associated with each edge.
 
typedef base_type::vertex_iterator vertex_iterator
 Iterator type for traversing vertices.
 
typedef
base_type::const_vertex_iterator 
const_vertex_iterator
 
typedef base_type::edge_iterator edge_iterator
 edge iterator
 

Public Member Functions

 ibm_multiproperty_graph_generic (string filename, string path, UINT64 max_memsize=(UINT64)(4294967295), size_t el_blk_sz=DEFAULT_BUNDLE_SZ, size_t vp_blk_sz=DEFAULT_BUNDLE_SZ, size_t ep_blk_sz=DEFAULT_BUNDLE_SZ)
 IBM Multiporperty graph constructor. More...
 
virtual ~ibm_multiproperty_graph_generic ()
 IBM Multiprpoerty graph destructor. More...
 
bool vert_index_available (size_t propid) const
 This method indicates if the named index exists. Currently the index name is the name of the vertex property that would be indexed. At the moment this class does not support edge properties. More...
 
bool vert_index_available_we (size_t propid) const
 This method is like vert_index_available() but it will throw an out_of_range exception if the propid is beyond the highest index we're supporting. This will help the calling code to enumerate indices. More...
 
int index_find (int propid, const property_value_type &pval, vertexd_type &vid)
 This method allows the caller to find the vid of a vertex that has the given value on the given property. More...
 
int index_find_all (int propid, const property_value_type &pval, std::vector< vertexd_type > &vids)
 This method allows the caller to find all the vertices that have the given value on the given property. Warning: it will crash if there is no index. Check for that using the "available" method. More...
 
int find_all (int propid, const property_value_type &pval, std::vector< vertexd_type > &vids)
 This method allows the caller to find all the vertices that have the given value on the given property. This version will not die if the index doesn't exist. Instead it will slowly generate the response after printing a warning message. More...
 
void _index_insert (int propid, const property_value_type &pval, vertexd_type vid)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erasexx (int propid, const property_value_type &pval)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erase (int propid, const property_value_type &pval, vertexd_type vid)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erase (int propid, char const *pval, int pvallen, vertexd_type vid)
 
void add_index (const property_name_type &pname, bool is_multi=false)
 This method creates an index on the specified property and property value. More...
 
void set_esubproperty (edged_type eid, const property_name_type &pname, const property_value_type &value)
 This method adds a property to an edge. More...
 
void set_esubproperty (edged_type eid, const size_t propid, const property_value_type &value)
 This method adds a property to an edge. More...
 
void set_vsubproperty (vertexd_type vid, const property_name_type &pname, const property_value_type &value)
 Sets the specified property for the specified vertex to the specified string value. More...
 
void set_vsubproperty (vertexd_type vid, const size_t propid, const property_value_type &value)
 Sets the specified property for the specified vertex to the specified string value. More...
 
property_value_type get_vsubproperty (vertexd_type vid, const property_name_type &pname)
 Returns the specified property for the specified vertex. More...
 
property_value_type get_vsubproperty (vertexd_type vid, size_t propid)
 
size_t get_or_allocate_epropertyid (const property_name_type &pname)
 Maps a specified edge property-name to it's property-id. More...
 
size_t get_or_allocate_vpropertyid (const property_name_type &pname)
 Maps a specified vertex property-name to it's property-id. More...
 
size_t get_or_allocate_labelid (const label_string_type &labelstr)
 Maps a specified label name to it's label-id. More...
 
size_t get_or_allocate_vclassid (const vclass_string_type &vclassname)
 
bool get_labelid (const label_string_type &labelstr, size_t &retval)
 Maps a specified label name to it's label-id. More...
 
bool get_vclassid (const vclass_string_type &vclassname, size_t &retval)
 
size_t get_epropertyid (const property_name_type &pname)
 Maps a specified edge property-name to it's property-id. More...
 
string get_edge_property_name (const size_t propid) const
 Maps a specified edge property-id to it's property name. More...
 
int get_edge_property_count () const
 get the number or propertynames found edge in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property. More...
 
size_t get_vpropertyid (const property_name_type &pname)
 Maps a specified vertex property-name to it's property-id. More...
 
string get_vertex_property_name (const size_t propid) const
 Maps a specified vertex property-id to it's property value. More...
 
int get_vertex_property_count () const
 get the number or propertynames found vertices in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property. More...
 
size_t get_labelid (const label_string_type &labelstr)
 Maps a specified label string to it's label-id. More...
 
size_t get_vclassid (const vclass_string_type &vclassname)
 
string get_label_string (const size_t labelid) const
 Maps a specified label-id it's label string. More...
 
string get_vclassname (size_t vclassid)
 
string deprecated_get_vclassname_as_stdstring (size_t vclassid)
 
char const * get_external_id_as_cstr (size_t vid)
 
string deprecated_get_external_id_as_stdstring (size_t vid)
 
vertex_iterator find_vertex (vertexd_type vid)
 Finds the first vertex with a given vertex id. More...
 
edge_iterator find_edge (vertexd_type vid, edged_type eid)
 Finds the first edge for a given vertex with a given edge id. More...
 
vertex_iterator find_vertex (const property_name_type &pname, const property_value_type &pval)
 Finds the first vertex with a given property value. More...
 
vertex_iterator vertices_begin ()
 
vertex_iterator vertices_end ()
 
void delete_vertex (vertexd_type vid)
 Deletes specified vertex and adjacent edges. More...
 
void delete_vertex (char const *exid, int exidlen)
 
vertexd_type add_vertex (vertex_property &vp)
 Add a vertex to the graph. More...
 
vertexd_type add_vertex (size_t vclassid)
 Add a vertex to the graph. More...
 
vertexd_type add_vertex (size_t vclassid, char const *exid, int exidlen)
 add a vertex More...
 
vertexd_type add_vertexxxx (property_value_type &value)
 Add a vertex to the graph. More...
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, edge_property ep)
 Add an edge to the graph. More...
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, size_t lid)
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, std::string label)
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, size_t lid)
 Add an edge to the graph. More...
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, std::string label)
 Add an edge to the graph. More...
 
- Public Member Functions inherited from ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >
 rdfGraph (const graph_config &gc=graph_config())
 
vertex_iterator vertices_begin ()
 
const_vertex_iterator vertices_begin () const
 
vertex_iterator vertices_begin (size_t lid)
 
vertex_iterator vertices_end ()
 
const_vertex_iterator vertices_end () const
 
vertex_iterator vertices_end (size_t lid)
 
edged_type add_edge (vertexd_type s, vertexd_type t, const edge_property &ep)
 
edge_iterator add_edge_ref (vertexd_type s, vertexd_type t, const edge_property &ep)
 

Protected Types

typedef index< size_t > index_type
 
typedef std::vector
< index_type * >::iterator 
index_iterator
 

Protected Member Functions

void _load_keys (std::string fn, std::map< std::string, vertexd_type > *vvec, std::vector< std::string > *revmap=0)
 Utility routine for reloading mappings between property-id's and property-name's. More...
 
void _load_keys ()
 Utility routine for reloading mappings between property-id's and property-name's. More...
 
void _save_keys (std::string fn, std::map< std::string, vertexd_type > *vvec)
 Utility routine for persisting mappings between property-id's and property-name's. More...
 
void _save_keys ()
 Utility routine for persisting mappings between property-id's and property-name's. More...
 
size_t _get_or_alloc_map (std::map< std::string, vertexd_type > *mapin, std::vector< std::string > *vecin, std::string keystring)
 Helper routine for get_or_allocXXXX() methods. More...
 
size_t _get_mapping (std::map< std::string, vertexd_type > *mapin, std::string keystring)
 Helper routine to help implement get_Xpropertyid() methods. More...
 

Protected Attributes

std::map< std::string, size_t > vpropname_to_id
 Maps a property name to a property id.
 
std::vector< std::string > id_to_vpropname
 Maps a property id to a property name(string)
 
std::map< std::string, size_t > epropname_to_id
 Similar as above for edges.
 
std::vector< std::string > id_to_epropname
 
std::vector< std::string > id_to_label
 Maps a label id to a label string.
 
std::map< std::string, size_t > label_to_id
 Maps a label string to a label id.
 
std::vector< std::string > vclassid_to_vclassname
 Maps a label id to a label string.
 
std::map< std::string, size_t > vclassname_to_vclassid
 Maps a label string to a label id.
 
std::string store_name
 
std::vector< index_type * > vert_indices
 
edge_iterator eitCached
 
edged_type eitCachedEid
 

Private Types

typedef rdfGraph
< tabular_multiproperty_type,
tabular_multiproperty_type, ST > 
base_type
 Base class type.
 
typedef
ibm_multiproperty_graph_generic
< ST > 
this_type
 Self type.
 

Detailed Description

template<STORAGE_TYPE ST>
class ibmppl::ibm_multiproperty_graph_generic< ST >

IBM Multi property graph class to store multiple properties.

IBM Multi property graph class; It maintains an associative table (hash table) for individual properties; All properties are stored as strings : <property_name:int, property_value:string> A secondary table maps from property_name as string to property name as integer

Constructor & Destructor Documentation

template<STORAGE_TYPE ST>
ibmppl::ibm_multiproperty_graph_generic< ST >::ibm_multiproperty_graph_generic ( string  filename,
string  path,
UINT64  max_memsize = (UINT64)(4294967295),
size_t  el_blk_sz = DEFAULT_BUNDLE_SZ,
size_t  vp_blk_sz = DEFAULT_BUNDLE_SZ,
size_t  ep_blk_sz = DEFAULT_BUNDLE_SZ 
)
inline

IBM Multiporperty graph constructor.

Parameters
filenamethe base filename in the directory specified in the path parameter. If they don't exist, this method will create a variety of files that start with this filename. Together they'll represent a graph. Initially it will be an empty graph.
paththe path of the file name
max_memsizeThe maxmium number of bytes of RAM to use to service the graph requests. Far more space might be used on disk.
Author
ccjason (3/4/2014)

This method returns a vector of index names. Right now the index names are the name of the property indexed. And at the moment only vertex properties are indexable.

template<STORAGE_TYPE ST>
virtual ibmppl::ibm_multiproperty_graph_generic< ST >::~ibm_multiproperty_graph_generic ( )
inlinevirtual

IBM Multiprpoerty graph destructor.

It is important that this method be called. It will do things like save meta-data on the graph and deallocate some underlying structures.

Author
ccjason (3/4/2014)

Member Function Documentation

template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::_get_mapping ( std::map< std::string, vertexd_type > *  mapin,
std::string  keystring 
)
inlineprotected

Helper routine to help implement get_Xpropertyid() methods.

Author
ccjason (1/6/2014)
Returns
size_t the property id for the specified property name
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::_get_or_alloc_map ( std::map< std::string, vertexd_type > *  mapin,
std::vector< std::string > *  vecin,
std::string  keystring 
)
inlineprotected

Helper routine for get_or_allocXXXX() methods.

Author
ccjason (1/6/2014)
Returns
size_t The newly-allocated or existing property id.
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::_index_insert ( int  propid,
const property_value_type &  pval,
vertexd_type  vid 
)
inline

This is a method that most people should not use. It's used internally to keep the index up to date.

Parameters
propidThe index property-id that needs to be updated.
pvalThe property value to be inserted to the index.
vidThe vertex represented by that property in the index.
Author
ccjason (3/4/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::_load_keys ( std::string  fn,
std::map< std::string, vertexd_type > *  vvec,
std::vector< std::string > *  revmap = 0 
)
inlineprotected

Utility routine for reloading mappings between property-id's and property-name's.

Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::_load_keys ( )
inlineprotected

Utility routine for reloading mappings between property-id's and property-name's.

Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::_save_keys ( std::string  fn,
std::map< std::string, vertexd_type > *  vvec 
)
inlineprotected

Utility routine for persisting mappings between property-id's and property-name's.

Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::_save_keys ( )
inlineprotected

Utility routine for persisting mappings between property-id's and property-name's.

Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
edged_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_edge ( vertexd_type  vsource,
vertexd_type  vtarget,
edge_property  ep 
)
inline

Add an edge to the graph.

Note: please only use this method if you need to understand the underlying property implementation. Otherwise, please use the method of the same name that does not have a property parameter.

Parameters
vsourceThe source vertex of the edge.
vtargetThe target vertex of the edge.
epThe property assoicated with the new edge.
Author
ccjason (1/7/2014)
Returns
edged_type The eid of the new edge
template<STORAGE_TYPE ST>
edged_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_edge ( vertexd_type  vsource,
vertexd_type  vtarget,
size_t  lid 
)
inline

Add an edge to the graph.

Author
ccjason (1/7/2014)
Parameters
vsourceThe source vertex of the edge.
vtargetThe target vertex of the edge.
lidThe label associated with the new edge.
Returns
edged_type The eid of the new edge
template<STORAGE_TYPE ST>
edged_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_edge ( vertexd_type  vsource,
vertexd_type  vtarget,
std::string  label 
)
inline

Add an edge to the graph.

Author
ccjason (1/7/2014)
Parameters
vsourceThe source vertex of the edge.
vtargetThe target vertex of the edge.
lableThe label string associated with the new edge.
Returns
edged_type The eid of the new edge
template<STORAGE_TYPE ST>
edge_iterator ibmppl::ibm_multiproperty_graph_generic< ST >::add_edge_ref ( vertexd_type  vsource,
vertexd_type  vtarget,
size_t  lid 
)
inline

Add an edge to the graph.

Parameters
vsourceThe source vertex of the edge.
vtargetThe target vertex of the edge.
lidThe label identifier associated with the new edge.
Author
ccjason (1/7/2014)
Returns
edged_type The eid of the new edge
template<STORAGE_TYPE ST>
edge_iterator ibmppl::ibm_multiproperty_graph_generic< ST >::add_edge_ref ( vertexd_type  vsource,
vertexd_type  vtarget,
std::string  label 
)
inline

Add an edge to the graph.

Parameters
vsourceThe source vertex of the edge.
vtargetThe target vertex of the edge.
labelThe label string associated with the new edge.
Author
ccjason (1/7/2014)
Returns
edged_type The eid of the new edge
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::add_index ( const property_name_type &  pname,
bool  is_multi = false 
)
inline

This method creates an index on the specified property and property value.

The caller should specify if it's possible that several vertices will have the same property value. It is safe to always specify that this is the case, but the code might be slightly slower than it needs to be. If the caller specifies that it's not the case, but then the graph does end up having more than one vertex with a given property value, the implementation will not notice this, but the index will not behave quite the way expected.

If the index already exists, this method does nothing. If it exists, but the is_multi is different than the existing index's is_multi value, still nothing is done.

Parameters
pnamethe vertex property that should be indexed
is_multitrue if a given value might appear on the property of several vertices.
Author
ccjason (3/4/2014)
template<STORAGE_TYPE ST>
vertexd_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_vertex ( vertex_property vp)
inline

Add a vertex to the graph.

Note: please only use this method if you need to understand the underlying property implementation. Otherwise, please use the parameter-less method of the same name.

Note: this class probably doesn't index the values provided. If that is needed, please test to confirm that another method should be used or the caller should arrange indexing.

Parameters
vpThe vertex property of the new vertex begin added.
Author
ccjason (1/7/2014)
Returns
vertexd_type The vertex id of the new vertex.
template<STORAGE_TYPE ST>
vertexd_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_vertex ( size_t  vclassid)
inline

Add a vertex to the graph.

Author
ccjason (1/7/2014)
#param vclassid The vclass associated with the new vertex
added. 
Returns
vertexd_type the vid of the new vertex
template<STORAGE_TYPE ST>
vertexd_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_vertex ( size_t  vclassid,
char const *  exid,
int  exidlen 
)
inline

add a vertex

This method does assume a vertex with that exid is not yet in the graph. If the caller is uncertain, it should check.

Author
ccjason (8/28/2014)
Returns
vertexd_type
template<STORAGE_TYPE ST>
vertexd_type ibmppl::ibm_multiproperty_graph_generic< ST >::add_vertexxxx ( property_value_type &  value)
inline

Add a vertex to the graph.

Adds a vertex to the graph with a specified property value The property value is associated with the external id.

Design: if you're using this method, check out if one of the 
other methods is faster.   External id's are stored as 
lstrings, so converting to std::strings to call this method 
might be a waste of cycles. 

If you do need this method, please correct the name to be 
more reasonable. 
Author
ccjason (1/7/2014)
Returns
vertexd_type the vid of the new vertex
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::delete_vertex ( vertexd_type  vid)
inline

Deletes specified vertex and adjacent edges.

Parameters
vidThe vertex to be deleted.
Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
int ibmppl::ibm_multiproperty_graph_generic< ST >::find_all ( int  propid,
const property_value_type &  pval,
std::vector< vertexd_type > &  vids 
)
inline

This method allows the caller to find all the vertices that have the given value on the given property. This version will not die if the index doesn't exist. Instead it will slowly generate the response after printing a warning message.

Parameters
propidthe property of interest
pvalthe property value that must match
vidsa reference to a vector of vids that will be updated with the vids of matching vertices.
Returns
true if it is found, false otherwise.
Author
ccjason (3/4/2014)
Returns
bool
template<STORAGE_TYPE ST>
edge_iterator ibmppl::ibm_multiproperty_graph_generic< ST >::find_edge ( vertexd_type  vid,
edged_type  eid 
)
inline

Finds the first edge for a given vertex with a given edge id.

This routine returns an iterator for a edge with the given property id. This method should be fairly fast, but not as fast as already having an iterator.

Parameters
vidThe vertex for which the edges are considered.
eidThe edge id being searched.
Author
ccjason (1/6/2014)
Returns
vertex_iterator
template<STORAGE_TYPE ST>
vertex_iterator ibmppl::ibm_multiproperty_graph_generic< ST >::find_vertex ( vertexd_type  vid)
inline

Finds the first vertex with a given vertex id.

This routine returns an iterator for a vertex with the given property id. This method should be fairly fast, but not as fast as already having an iterator.

Parameters
vidThe vertex id being searched.
Author
ccjason (1/6/2014)
Returns
vertex_iterator
template<STORAGE_TYPE ST>
vertex_iterator ibmppl::ibm_multiproperty_graph_generic< ST >::find_vertex ( const property_name_type &  pname,
const property_value_type &  pval 
)
inline

Finds the first vertex with a given property value.

This routine returns an iterator for a vertex with the given property value. If you really want multiple vertices with the same value, then you probably should refactor the graph to have a single vertex representing that value and have other vertices reference it.

At this date (2014/01/06) this method is not implemented. We'll implement it when we add indexing support. Until then the caller should perhaps implement this themselves and include appropriate caching support to that implementation.

Parameters
pnamethe property name being searched
pvalthe property value for specified property.
Author
ccjason (1/6/2014)
Returns
vertex_iterator
template<STORAGE_TYPE ST>
int ibmppl::ibm_multiproperty_graph_generic< ST >::get_edge_property_count ( ) const
inline

get the number or propertynames found edge in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property.

Author
ccjason (9/15/2014)
Returns
int
template<STORAGE_TYPE ST>
string ibmppl::ibm_multiproperty_graph_generic< ST >::get_edge_property_name ( const size_t  propid) const
inline

Maps a specified edge property-id to it's property name.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
propidThe edge property id for which the name is requested.
Author
ccjason (1/6/2014)
Returns
string The property name
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_epropertyid ( const property_name_type &  pname)
inline

Maps a specified edge property-name to it's property-id.

This method can be valuable because operations on property id's are faster than operations on property names.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
pnameEdge property name for which id is requested.
Author
ccjason (1/6/2014)
Returns
string The property name
template<STORAGE_TYPE ST>
string ibmppl::ibm_multiproperty_graph_generic< ST >::get_label_string ( const size_t  labelid) const
inline

Maps a specified label-id it's label string.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
labelidThe label-id for which the string is requested.
Author
ccjason (1/10/2014)
Returns
string The label string
template<STORAGE_TYPE ST>
bool ibmppl::ibm_multiproperty_graph_generic< ST >::get_labelid ( const label_string_type &  labelstr,
size_t &  retval 
)
inline

Maps a specified label name to it's label-id.

This method maps the specified label-string to a label-id. If the label does not exist, it returs false, otherwise sets the parameter to the label-id. Label-id's can be valuable because operations on label id's are faster than operations on label strings.

Parameters
labelstrThe label string requested.
retvalThe label id, if the label string exists in the mapping.
Author
ccjason (1/10/2014)
Returns
bool true if the mapping existed, false otherwise.
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_labelid ( const label_string_type &  labelstr)
inline

Maps a specified label string to it's label-id.

This method can be valuable because operations on labelid's are faster than operations on label strings.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
labelstrThe label for which an id is requested.
Author
ccjason (1/10/2014)
Returns
size_t The labelid
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_or_allocate_epropertyid ( const property_name_type &  pname)
inline

Maps a specified edge property-name to it's property-id.

This method maps the specified edge property-name to a vertex property-id. If that mapping doesn't exist, it creates one.

Property-id's can be valuable because operations on property id's are faster than operations on property names.

Parameters
pnameThe name of the edge property requested.
Author
ccjason (1/6/2014)
Returns
string The property name
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_or_allocate_labelid ( const label_string_type &  labelstr)
inline

Maps a specified label name to it's label-id.

This method maps the specified label-string to a label-id. If that mapping doesn't exist, it creates one.

Label-id's can be valuable because operations on label id's are faster than operations on label strings.

Parameters
labelstrThe label string requested.
Author
ccjason (1/10/2014)
Returns
string The label string
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_or_allocate_vpropertyid ( const property_name_type &  pname)
inline

Maps a specified vertex property-name to it's property-id.

This method maps the specified vertex property-name to a vertex property-id. If that mapping doesn't exist, it creates one.

Property-id's can be valuable because operations on property id's are faster than operations on property names.

Parameters
pnameThe name of the property requested.
Author
ccjason (1/6/2014)
Returns
string The property name
template<STORAGE_TYPE ST>
int ibmppl::ibm_multiproperty_graph_generic< ST >::get_vertex_property_count ( ) const
inline

get the number or propertynames found vertices in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property.

Author
ccjason (9/15/2014)
Returns
int
template<STORAGE_TYPE ST>
string ibmppl::ibm_multiproperty_graph_generic< ST >::get_vertex_property_name ( const size_t  propid) const
inline

Maps a specified vertex property-id to it's property value.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
propidThe vertex property id for which the name is being requested.
Author
ccjason (1/6/2014)
Returns
string The property name
template<STORAGE_TYPE ST>
size_t ibmppl::ibm_multiproperty_graph_generic< ST >::get_vpropertyid ( const property_name_type &  pname)
inline

Maps a specified vertex property-name to it's property-id.

This method can be valuable because operations on property id's are faster than operations on property names.

If the mapping doesn't exist, it will (currently) throw an out of range exception. That might change in a future version.

Parameters
pnameThe vertex property name for which the id is requested.
Author
ccjason (1/6/2014)
Returns
size_t The labelid
template<STORAGE_TYPE ST>
property_value_type ibmppl::ibm_multiproperty_graph_generic< ST >::get_vsubproperty ( vertexd_type  vid,
const property_name_type &  pname 
)
inline

Returns the specified property for the specified vertex.

This method returns the specified property for the specified vertex. The returned value is in string form. If the value itself is not a string value, the returned value is converted to string form before being returned.

Note: update docs to indicate what happens if the property doesn't exist on the element.

Parameters
vidThe vertex for which the property is being queried.
pnameThe name of the property being queried.
Author
ccjason (1/6/2014)
Returns
property_value_type
template<STORAGE_TYPE ST>
property_value_type ibmppl::ibm_multiproperty_graph_generic< ST >::get_vsubproperty ( vertexd_type  vid,
size_t  propid 
)
inline

Returns the specified property for the specified vertex.

This method returns the specified property for the specified vertex. The returned value is in string form. If the value itself is not a string value, the returned value is converted to string form before being returned.

Note: update docs to indicate what happens if the property doesn't exist on the element.

Parameters
vidThe vertex for which the property is being queried.
propidThe property id being queried.
Author
ccjason (1/6/2014)
Returns
property_value_type
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::index_erase ( int  propid,
const property_value_type &  pval,
vertexd_type  vid 
)
inline

This is a method that most people should not use. It's used internally to keep the index up to date.

Parameters
propidThe index property-id that needs to be updated.
pvalThe property value to be erased to the index.
vidThe vertex represented by that property in the index.
Author
ccjason (3/4/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::index_erasexx ( int  propid,
const property_value_type &  pval 
)
inline

This is a method that most people should not use. It's used internally to keep the index up to date.

Parameters
propidThe index property-id that needs to be updated.
pvalThe property value to be erased to the index.
Author
ccjason (3/4/2014)
template<STORAGE_TYPE ST>
int ibmppl::ibm_multiproperty_graph_generic< ST >::index_find ( int  propid,
const property_value_type &  pval,
vertexd_type vid 
)
inline

This method allows the caller to find the vid of a vertex that has the given value on the given property.

Parameters
propidthe property of interest
pvalthe property value that must match
vida reference to a vid that will be updated with the vid of a matching vertex.
Returns
true if it is found, false otherwise.
Author
ccjason (3/4/2014)
Returns
bool
template<STORAGE_TYPE ST>
int ibmppl::ibm_multiproperty_graph_generic< ST >::index_find_all ( int  propid,
const property_value_type &  pval,
std::vector< vertexd_type > &  vids 
)
inline

This method allows the caller to find all the vertices that have the given value on the given property. Warning: it will crash if there is no index. Check for that using the "available" method.

Parameters
propidthe property of interest
pvalthe property value that must match
vidsa reference to a vector of vids that will be updated with the vids of matching vertices.
Returns
true if it is found, false otherwise.
Author
ccjason (3/4/2014)
Returns
bool
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::set_esubproperty ( edged_type  eid,
const property_name_type &  pname,
const property_value_type &  value 
)
inline

This method adds a property to an edge.

Parameters
eidThe edge to add the property to
pnameThe property name to be inserted.
valueThe property value to be set for the named property
Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::set_esubproperty ( edged_type  eid,
const size_t  propid,
const property_value_type &  value 
)
inline

This method adds a property to an edge.

Parameters
eidThe edge to add the property to
pidThe property id to be inserted.
valueThe property value to be set for the named property
Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::set_vsubproperty ( vertexd_type  vid,
const property_name_type &  pname,
const property_value_type &  value 
)
inline

Sets the specified property for the specified vertex to the specified string value.

This method set the specified property for the specified vertex to the specified string value. If you'd like to set it to a non-string value, see the other similarly named methods of the vertex and edge classes.

Parameters
vidThe vertex to add the property to
pnameThe property name to add to the specified vertex.
valueThe value to be set for the specified property
Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
void ibmppl::ibm_multiproperty_graph_generic< ST >::set_vsubproperty ( vertexd_type  vid,
const size_t  propid,
const property_value_type &  value 
)
inline

Sets the specified property for the specified vertex to the specified string value.

This method set the specified property for the specified vertex to the specified string value. If you'd like to set it to a non-string value, see the other similarly named methods of the vertex and edge classes.

Parameters
vidThe vertex to add the property to
propidThe property idetifier to add to the specified vertex.
valueThe value to be set for the specified property
Author
ccjason (1/6/2014)
template<STORAGE_TYPE ST>
bool ibmppl::ibm_multiproperty_graph_generic< ST >::vert_index_available ( size_t  propid) const
inline

This method indicates if the named index exists. Currently the index name is the name of the vertex property that would be indexed. At the moment this class does not support edge properties.

Parameters
propidThe property id queried for indexing.
Author
ccjason (3/4/2014)
Returns
bool
template<STORAGE_TYPE ST>
bool ibmppl::ibm_multiproperty_graph_generic< ST >::vert_index_available_we ( size_t  propid) const
inline

This method is like vert_index_available() but it will throw an out_of_range exception if the propid is beyond the highest index we're supporting. This will help the calling code to enumerate indices.

Parameters
propidThe property id queried for indexing.

todo: if the number of propid's allocated is often high, this polling approach will be inefficient and we'll need to replace this method.

Author
ccjason (7/19/2014)
Returns
bool

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