Class used to define the graph metadata informations over a SGBD source. More...
#include <DataSourceGraphMetadata.h>
Public Member Functions | |
virtual void | addEdgeProperty (te::dt::Property *p) |
Add a new property associated to the edge element. More... | |
virtual void | addVertexProperty (te::dt::Property *p) |
Add a new property associated to the vertex element. More... | |
DataSourceGraphMetadata (te::da::DataSource *ds) | |
Default constructor. More... | |
GraphClass | getClass () |
It returns the the graph class (defined in Enums file) More... | |
te::da::DataSource * | getDataSource () |
It returns the data source associated with this graph. More... | |
std::string | getDescription () |
It returns the the graph description. More... | |
virtual te::dt::Property * | getEdgeProperty (int idx) |
Get a edge property given a index. More... | |
virtual int | getEdgePropertySize () |
Used to verify the number of properties associated to edge elements. More... | |
std::string | getEdgeTableName () |
It returns the edge table name that contains the vertex elements in data source. More... | |
virtual te::gm::Envelope * | getEnvelope () |
Used to get the bounding box of the geometry elements associated with this graph. More... | |
int | getId () |
It returns the graph id. More... | |
std::string | getName () |
It returns the graph name. More... | |
virtual int | getSRID () |
Used to get the SRID of the geometry elements associated with this graph. More... | |
GraphStorageMode | getStorageMode () |
It returns the the graph storage mode (defined in Enums file) More... | |
std::string | getType () |
It returns the graph type (defined in Enums file) More... | |
virtual te::dt::Property * | getVertexProperty (int idx) |
Get a vertex property given a index. More... | |
virtual int | getVertexPropertySize () |
Used to verify the number of properties associated to vertex elements. More... | |
std::string | getVertexTableName () |
It returns the vertex table name that contains the vertex elements in data source. More... | |
void | load (int id) |
Function used to load the graph information given a graph id. More... | |
virtual void | removeEdgeProperty (int idx) |
Remove a property associated to the edge element. More... | |
virtual void | removeVertexProperty (int idx) |
Remove a property associated to the vertex element. More... | |
void | save () |
Function used to save the graph information. More... | |
void | setClass (GraphClass value) |
Set the graph class (defined in Enums file) More... | |
void | setDescription (std::string desc) |
Set the graph description. More... | |
virtual void | setEnvelope (te::gm::Envelope &extent) |
Used to set the bounding box of the geometry elements associated with this graph. More... | |
void | setName (std::string name) |
Set the graph name. More... | |
virtual void | setSRID (int srid) |
Used to set the SRID of the geometry elements associated with this graph. More... | |
void | setStorageMode (GraphStorageMode value) |
Set the graph storage mode (defined in Enums file) More... | |
void | setType (std::string graphType) |
Set the graph type (defined in Enums file) More... | |
void | update () |
Function used to update the graph information on a data source. More... | |
~DataSourceGraphMetadata () | |
Default destructor. More... | |
Public Attributes | |
double | m_boxPercentSize |
Attribute used to box percent size used in loader strategy. More... | |
size_t | m_maxCacheSize |
Attribute used to set the max cache size. More... | |
size_t | m_maxVecCacheSize |
Attribute used to set the max vector cache size. More... | |
bool | m_memoryGraph |
Flag used to indicate if the graph is a memory graph. More... | |
Protected Member Functions | |
void | addGraphAttrTableNewEntry () |
Add a new graph attributes metadata information into the SGBD. More... | |
void | addGraphTableNewEntry () |
Add a new graph metadata information into the SGBD. More... | |
void | createEdgeAttrTable () |
Used when vertex_model is selected and edge objects has attributes associated. More... | |
void | createGraphAttributesTable () |
Function used to create the graph metadata attributes tables in a SGBD. More... | |
void | createGraphMetadataTable () |
Function used to create the graph metadata tables in a SGBD. More... | |
void | createGraphTableEdgeModel () |
Function used to create the edge model scheme of tables. More... | |
void | createGraphTableVertexModel () |
Function used to create the vertex model scheme of tables. More... | |
void | createTable (std::string tableName, te::da::DataSetType *dt) |
Function used to create a table inside the SGBD. More... | |
void | createVertexAttrTable () |
Used when edge_model is selected and vertex objects has attributes associated. More... | |
bool | isValidGraphName (std::string graphName) |
Verify if a graph name is valid. More... | |
void | loadEdgeAttr (std::string tableName, std::string columnName) |
Load the edge attributes. More... | |
void | loadGraphAttrInfo (int id) |
Function used to load the graph attributes information given a graph id. More... | |
void | loadGraphInfo (int id) |
Function used to load the graph information given a graph id. More... | |
void | loadVertexAttr (std::string tableName, std::string columnName) |
Load the vertex attributes. More... | |
void | removeProperty (std::string tableName, std::string propertyName) |
Remove a property of a table in SGBD. More... | |
void | saveGraphAttrTableNewEntry (int graphId, std::string tableName, std::string attrName, std::string linkColumn, te::graph::GraphAttrType type) |
Save each metadata attributes of vertex and eges into SGBD. More... | |
void | saveProperty (std::string tableName, te::dt::Property *p) |
Save a property into a table in SGBD. More... | |
void | updateGraphId () |
Protected Attributes | |
te::graph::GraphClass | m_class |
Enum attribute used to defines the graph class. More... | |
std::string | m_description |
Attribute used to describe a graph. More... | |
te::da::DataSource * | m_ds |
Data source attribute, has to be database information. More... | |
EdgeProperty * | m_edgeProp |
Attribute that defines the edge properties. More... | |
te::gm::Envelope * | m_extent |
Attribute used to define the graph extent. More... | |
int | m_id |
Attribute graph unique identifier. More... | |
te::graph::GraphStorageMode | m_mode |
Enum attribute used to defines the storage mode. More... | |
std::string | m_name |
Attribute name. More... | |
int | m_srid |
Attribute used to define the graph projection. More... | |
std::string | m_type |
Enum attribute used to defines the graph type. More... | |
VertexProperty * | m_vertexProp |
Attribute that defines the vertex properties. More... | |
Class used to define the graph metadata informations over a SGBD source.
Definition at line 62 of file DataSourceGraphMetadata.h.
te::graph::DataSourceGraphMetadata::DataSourceGraphMetadata | ( | te::da::DataSource * | ds | ) |
Default constructor.
Definition at line 50 of file DataSourceGraphMetadata.cpp.
References te::graph::Edge_List, and te::graph::GraphMetadata::m_mode.
te::graph::DataSourceGraphMetadata::~DataSourceGraphMetadata | ( | ) |
Default destructor.
Definition at line 55 of file DataSourceGraphMetadata.cpp.
|
virtual |
Add a new property associated to the edge element.
param p New property to be associated with edge elements.
Reimplemented from te::graph::GraphMetadata.
Definition at line 159 of file DataSourceGraphMetadata.cpp.
References te::graph::GraphMetadata::addEdgeProperty(), te::graph::Edge_Attr, te::dt::Property::getName(), te::graph::Globals::sm_tableEdgeModelAttrId, TE_TR, and te::graph::Vertex_List.
|
protected |
Add a new graph attributes metadata information into the SGBD.
Exception | It throws an exception if execution fails |
Definition at line 482 of file DataSourceGraphMetadata.cpp.
References te::graph::Edge_Attr, te::graph::Globals::sm_tableEdgeModelAttrId, te::graph::Globals::sm_tableVertexModelAttrId, and te::graph::Vertex_Attr.
|
protected |
Add a new graph metadata information into the SGBD.
Exception | It throws an exception if execution fails |
Definition at line 439 of file DataSourceGraphMetadata.cpp.
References te::graph::Edge_List, te::mem::DataSetItem::setInt32(), te::mem::DataSetItem::setString(), te::graph::Globals::sm_tableGraphName, and te::graph::Vertex_List.
|
virtual |
Add a new property associated to the vertex element.
param p New property to be associated with vertex elements.
Reimplemented from te::graph::GraphMetadata.
Definition at line 125 of file DataSourceGraphMetadata.cpp.
References te::graph::GraphMetadata::addVertexProperty(), te::dt::Property::getName(), te::graph::Globals::sm_tableVertexModelAttrId, and te::graph::Vertex_Attr.
|
protected |
Used when vertex_model is selected and edge objects has attributes associated.
Exception | It throws an exception if execution fails |
Definition at line 416 of file DataSourceGraphMetadata.cpp.
References TE_TR.
|
protected |
Function used to create the graph metadata attributes tables in a SGBD.
Exception | It throws an exception if execution fails |
Definition at line 237 of file DataSourceGraphMetadata.cpp.
References te::da::PrimaryKey::add(), te::da::Index::add(), te::da::DataSetType::add(), te::da::B_TREE_TYPE, te::dt::INT32_TYPE, te::dt::SimpleProperty::setAutoNumber(), te::dt::StringProperty::setSize(), te::graph::Globals::sm_tableAttributeAttrColumn, te::graph::Globals::sm_tableAttributeAttrGraphId, te::graph::Globals::sm_tableAttributeAttrId, te::graph::Globals::sm_tableAttributeAttrLink, te::graph::Globals::sm_tableAttributeAttrTable, te::graph::Globals::sm_tableAttributeAttrType, te::graph::Globals::sm_tableAttributeName, and te::dt::VAR_STRING.
|
protected |
Function used to create the graph metadata tables in a SGBD.
Exception | It throws an exception if execution fails |
Definition at line 193 of file DataSourceGraphMetadata.cpp.
References te::da::PrimaryKey::add(), te::da::Index::add(), te::da::DataSetType::add(), te::da::B_TREE_TYPE, te::dt::INT32_TYPE, te::dt::SimpleProperty::setAutoNumber(), te::dt::StringProperty::setSize(), te::graph::Globals::sm_tableGraphAttrDesc, te::graph::Globals::sm_tableGraphAttrId, te::graph::Globals::sm_tableGraphAttrName, te::graph::Globals::sm_tableGraphAttrTableName, te::graph::Globals::sm_tableGraphAttrType, te::graph::Globals::sm_tableGraphName, and te::dt::VAR_STRING.
|
protected |
Function used to create the edge model scheme of tables.
Exception | It throws an exception if execution fails |
Definition at line 290 of file DataSourceGraphMetadata.cpp.
References te::da::PrimaryKey::add(), te::da::Index::add(), te::da::DataSetType::add(), te::da::B_TREE_TYPE, te::dt::Property::clone(), te::dt::GEOMETRY_TYPE, te::dt::Property::getType(), te::dt::INT32_TYPE, te::da::R_TREE_TYPE, te::dt::SimpleProperty::setAutoNumber(), te::dt::Property::setParent(), te::graph::Globals::sm_tableEdgeModelAttrId, te::graph::Globals::sm_tableEdgeModelAttrVFrom, te::graph::Globals::sm_tableEdgeModelAttrVTo, and te::graph::Globals::sm_tableEdgeModelSufixName.
|
protected |
Function used to create the vertex model scheme of tables.
Exception | It throws an exception if execution fails |
Definition at line 285 of file DataSourceGraphMetadata.cpp.
References TE_TR.
|
protected |
Function used to create a table inside the SGBD.
tableName | String with the table name |
dt | Struct that defines each column of the table |
Exception | It throws an exception if execution fails |
Definition at line 421 of file DataSourceGraphMetadata.cpp.
|
protected |
Used when edge_model is selected and vertex objects has attributes associated.
Exception | It throws an exception if execution fails |
Definition at line 363 of file DataSourceGraphMetadata.cpp.
References te::da::PrimaryKey::add(), te::da::Index::add(), te::da::DataSetType::add(), te::da::B_TREE_TYPE, te::dt::Property::clone(), te::dt::GEOMETRY_TYPE, te::dt::Property::getType(), te::dt::INT32_TYPE, te::da::R_TREE_TYPE, te::dt::SimpleProperty::setAutoNumber(), te::dt::Property::setParent(), te::graph::Globals::sm_tableVertexAttributeModelSufixName, and te::graph::Globals::sm_tableVertexModelAttrId.
|
inherited |
It returns the the graph class (defined in Enums file)
Definition at line 102 of file GraphMetadata.cpp.
|
inherited |
It returns the data source associated with this graph.
Definition at line 117 of file GraphMetadata.cpp.
Referenced by te::graph::LayerRenderer::draw(), te::sa::SpatialWeightsExchanger::exportToGAL(), and te::sa::SpatialWeightsExchanger::exportToGWT().
|
inherited |
It returns the the graph description.
Definition at line 82 of file GraphMetadata.cpp.
|
virtualinherited |
Get a edge property given a index.
idx | Index of the property |
Definition at line 214 of file GraphMetadata.cpp.
Referenced by te::graph::QueryGraphBuilder::build(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeIndex(), and removeEdgeProperty().
|
virtualinherited |
Used to verify the number of properties associated to edge elements.
Definition at line 224 of file GraphMetadata.cpp.
Referenced by te::sa::GPMWeightsNoWeightsStrategy::calculate(), te::sa::GPMWeightsSquaredInverseDistanceStrategy::calculate(), te::sa::GPMWeightsInverseDistanceStrategy::calculate(), te::sa::SkaterOperation::createWeightAttribute(), te::sa::GPMWeightsAbstractStrategy::getDistanceAttributeIndex(), and te::sa::MinimumSpanningTree::kruskal().
|
inherited |
It returns the edge table name that contains the vertex elements in data source.
Definition at line 138 of file GraphMetadata.cpp.
References te::graph::Edge_List, te::graph::Globals::sm_tableEdgeAttributeModelSufixName, te::graph::Globals::sm_tableEdgeModelSufixName, and te::graph::Vertex_List.
|
virtualinherited |
Used to get the bounding box of the geometry elements associated with this graph.
Definition at line 244 of file GraphMetadata.cpp.
|
inherited |
It returns the graph id.
Definition at line 62 of file GraphMetadata.cpp.
|
inherited |
It returns the graph name.
Definition at line 72 of file GraphMetadata.cpp.
|
virtualinherited |
Used to get the SRID of the geometry elements associated with this graph.
Definition at line 234 of file GraphMetadata.cpp.
|
inherited |
It returns the the graph storage mode (defined in Enums file)
Definition at line 112 of file GraphMetadata.cpp.
|
inherited |
It returns the graph type (defined in Enums file)
Definition at line 92 of file GraphMetadata.cpp.
Referenced by te::graph::BoxLoaderStrategy::loadDataByEdgeId(), te::graph::SequenceLoaderStrategy::loadDataByVertexId(), and te::graph::BoxLoaderStrategy::loadDataByVertexId().
|
virtualinherited |
Get a vertex property given a index.
idx | Index of the property |
Definition at line 174 of file GraphMetadata.cpp.
Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::graph::QueryGraphBuilder::build(), and removeVertexProperty().
|
virtualinherited |
Used to verify the number of properties associated to vertex elements.
Definition at line 184 of file GraphMetadata.cpp.
Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::sa::AssociateGPMVertexAttribute(), te::sa::BoxMap(), te::sa::GStatistics(), te::sa::LISAMap(), te::sa::LisaStatisticalSignificance(), te::sa::LocalMean(), te::sa::MoranIndex(), te::sa::MoranMap(), and te::sa::ZAndWZ().
|
inherited |
It returns the vertex table name that contains the vertex elements in data source.
Definition at line 122 of file GraphMetadata.cpp.
References te::graph::Edge_List, te::graph::Globals::sm_tableVertexAttributeModelSufixName, te::graph::Globals::sm_tableVertexModelSufixName, and te::graph::Vertex_List.
|
protected |
Verify if a graph name is valid.
Definition at line 434 of file DataSourceGraphMetadata.cpp.
|
virtual |
Function used to load the graph information given a graph id.
id | The Graph identifier |
Exception | It throws an exception if graph id equal -1 |
Reimplemented from te::graph::GraphMetadata.
Definition at line 59 of file DataSourceGraphMetadata.cpp.
References TE_TR.
|
protected |
Load the edge attributes.
tableName | The table name that contains the edge attributes |
columnName | The column name that contins the attribute information |
Definition at line 653 of file DataSourceGraphMetadata.cpp.
References te::graph::GraphMetadata::addEdgeProperty().
|
protected |
Function used to load the graph attributes information given a graph id.
id | The graph id |
Definition at line 603 of file DataSourceGraphMetadata.cpp.
References te::graph::Globals::sm_tableAttributeAttrColumn, te::graph::Globals::sm_tableAttributeAttrGraphId, te::graph::Globals::sm_tableAttributeAttrTable, te::graph::Globals::sm_tableAttributeAttrType, and te::graph::Globals::sm_tableAttributeName.
|
protected |
Function used to load the graph information given a graph id.
id | The graph id |
Definition at line 563 of file DataSourceGraphMetadata.cpp.
References te::graph::Edge_List, te::graph::Globals::sm_tableGraphAttrDesc, te::graph::Globals::sm_tableGraphAttrId, te::graph::Globals::sm_tableGraphAttrName, te::graph::Globals::sm_tableGraphAttrType, te::graph::Globals::sm_tableGraphName, and te::graph::Vertex_List.
|
protected |
Load the vertex attributes.
tableName | The table name that contains the vertex attributes |
columnName | The column name that contins the attribute information |
Definition at line 643 of file DataSourceGraphMetadata.cpp.
References te::graph::GraphMetadata::addVertexProperty().
|
virtual |
Remove a property associated to the edge element.
idx | Index of the property |
Reimplemented from te::graph::GraphMetadata.
Definition at line 178 of file DataSourceGraphMetadata.cpp.
References te::graph::GraphMetadata::getEdgeProperty(), te::dt::Property::getName(), and te::graph::GraphMetadata::removeEdgeProperty().
|
protected |
Remove a property of a table in SGBD.
tableName | The table name that contains this property |
propertyName | The property name to be removed |
Exception | It throws an exception if execution fails |
Definition at line 558 of file DataSourceGraphMetadata.cpp.
|
virtual |
Remove a property associated to the vertex element.
idx | Index of the property |
Reimplemented from te::graph::GraphMetadata.
Definition at line 144 of file DataSourceGraphMetadata.cpp.
References te::dt::Property::getName(), te::graph::GraphMetadata::getVertexProperty(), and te::graph::GraphMetadata::removeVertexProperty().
|
virtual |
Function used to save the graph information.
Reimplemented from te::graph::GraphMetadata.
Definition at line 73 of file DataSourceGraphMetadata.cpp.
References te::graph::Edge_List, TE_TR, and te::graph::Vertex_List.
|
protected |
Save each metadata attributes of vertex and eges into SGBD.
graphId | The graph id associated with this attribute |
tableName | The table name that contains this attribute |
attrName | The attribute name |
linkColumn | The link column name used to associate this attribute to the element (vertex or edge) |
type | The attribute type ( is vertex or edge attribute) |
Exception | It throws an exception if execution fails |
Definition at line 509 of file DataSourceGraphMetadata.cpp.
References te::common::Convert2LCase(), te::mem::DataSetItem::setInt32(), te::mem::DataSetItem::setString(), and te::graph::Globals::sm_tableAttributeName.
|
protected |
Save a property into a table in SGBD.
tableName | The table name that will contains this property |
p | The property to be saved |
Exception | It throws an exception if execution fails |
Definition at line 534 of file DataSourceGraphMetadata.cpp.
References te::da::Index::add(), te::dt::GEOMETRY_TYPE, te::dt::Property::getType(), and te::da::R_TREE_TYPE.
|
inherited |
Set the graph class (defined in Enums file)
value | Enumerator value that defines the graph class |
Definition at line 97 of file GraphMetadata.cpp.
|
inherited |
Set the graph description.
desc | String with the graph description |
Definition at line 77 of file GraphMetadata.cpp.
Referenced by te::graph::AbstractGraphFactory::setMetadataInformation().
|
virtualinherited |
Used to set the bounding box of the geometry elements associated with this graph.
The | bounding box information |
Definition at line 249 of file GraphMetadata.cpp.
|
inherited |
Set the graph name.
name | String with the graph name |
Definition at line 67 of file GraphMetadata.cpp.
Referenced by te::graph::AbstractGraphFactory::setMetadataInformation().
|
virtualinherited |
Used to set the SRID of the geometry elements associated with this graph.
Integer | value that defines the SRID |
Definition at line 239 of file GraphMetadata.cpp.
|
inherited |
Set the graph storage mode (defined in Enums file)
value | Enumerator value that defines the graph storage mode |
Definition at line 107 of file GraphMetadata.cpp.
Referenced by te::graph::AbstractGraphFactory::setMetadataInformation().
|
inherited |
Set the graph type (defined in Enums file)
value | Enumerator value that defines the graph type |
Definition at line 87 of file GraphMetadata.cpp.
Referenced by te::graph::AbstractGraphFactory::make(), and te::graph::AbstractGraphFactory::open().
|
virtual |
Function used to update the graph information on a data source.
Exception | It throws an exception if graph id equal -1 |
Reimplemented from te::graph::GraphMetadata.
Definition at line 117 of file DataSourceGraphMetadata.cpp.
References TE_TR.
|
protected |
Definition at line 663 of file DataSourceGraphMetadata.cpp.
References te::graph::Globals::sm_tableGraphAttrId, te::graph::Globals::sm_tableGraphAttrName, and te::graph::Globals::sm_tableGraphName.
|
inherited |
Attribute used to box percent size used in loader strategy.
Definition at line 321 of file GraphMetadata.h.
Referenced by te::graph::GraphMetadata::GraphMetadata().
|
protectedinherited |
Enum attribute used to defines the graph class.
Definition at line 306 of file GraphMetadata.h.
|
protectedinherited |
Attribute used to describe a graph.
Definition at line 298 of file GraphMetadata.h.
|
protectedinherited |
Data source attribute, has to be database information.
Definition at line 310 of file GraphMetadata.h.
|
protectedinherited |
Attribute that defines the edge properties.
Definition at line 314 of file GraphMetadata.h.
|
protectedinherited |
Attribute used to define the graph extent.
Definition at line 302 of file GraphMetadata.h.
|
protectedinherited |
Attribute graph unique identifier.
Definition at line 294 of file GraphMetadata.h.
|
inherited |
Attribute used to set the max cache size.
Definition at line 319 of file GraphMetadata.h.
Referenced by te::graph::GraphMetadata::GraphMetadata().
|
inherited |
Attribute used to set the max vector cache size.
Definition at line 320 of file GraphMetadata.h.
Referenced by te::graph::GraphMetadata::GraphMetadata().
|
inherited |
Flag used to indicate if the graph is a memory graph.
Definition at line 323 of file GraphMetadata.h.
Referenced by te::graph::BidirectionalGraphFactory::create(), te::graph::GraphFactory::create(), te::graph::UndirectedGraphFactory::create(), te::graph::DirectedGraphFactory::create(), te::graph::AbstractGraphFactory::getMetadata(), te::graph::Graph::Graph(), te::graph::GraphMetadata::GraphMetadata(), te::graph::DirectedGraphFactory::iOpen(), te::graph::GraphFactory::iOpen(), te::graph::UndirectedGraphFactory::iOpen(), and te::graph::BidirectionalGraphFactory::iOpen().
|
protectedinherited |
Enum attribute used to defines the storage mode.
Definition at line 308 of file GraphMetadata.h.
Referenced by DataSourceGraphMetadata().
|
protectedinherited |
Attribute name.
Definition at line 296 of file GraphMetadata.h.
|
protectedinherited |
Attribute used to define the graph projection.
Definition at line 300 of file GraphMetadata.h.
|
protectedinherited |
Enum attribute used to defines the graph type.
Definition at line 304 of file GraphMetadata.h.
|
protectedinherited |
Attribute that defines the vertex properties.
Definition at line 312 of file GraphMetadata.h.