tlp::CSVToGraphEdgeSrcTgtMapping Class Reference
Try to map CSV file rows to edges according to edge source and destination.
More...
#include <CSVGraphImport.h>
List of all members.
Public Member Functions
- CSVToGraphEdgeSrcTgtMapping (tlp::Graph *graph, unsigned int srcColumnIndex, unsigned int tgtColumnIndex, const std::string &propertyName, bool createMissinElements=false)
- std::pair< tlp::ElementType,
unsigned int > getElementForRow (unsigned int row)
- void init (unsigned int lineNumbers)
- std::pair< tlp::ElementType,
unsigned int > getElementForRow (const std::vector< std::string > &tokens)
Detailed Description
Try to map CSV file rows to edges according to edge source and destination.
For each row in the CSV file create an edge in the graph between source and destination nodes. Find source node by comparing id in the source CSV column and destination node by comparing id in the destination CSV column.
Constructor & Destructor Documentation
tlp::CSVToGraphEdgeSrcTgtMapping::CSVToGraphEdgeSrcTgtMapping |
( |
tlp::Graph * |
graph, |
|
|
unsigned int |
srcColumnIndex, |
|
|
unsigned int |
tgtColumnIndex, |
|
|
const std::string & |
propertyName, |
|
|
bool |
createMissinElements = false | |
|
) |
| | |
- Parameters:
-
| graph | The graph where the edges will be searched. |
| srcColumnIndex | The index of the column with the source node id in the CSV file. |
| tgtColumnIndex | The index of the column with the taret node id in the CSV file. |
| srcPropertyName | The name of the property to search source node id. |
| tgtPropertyName | The name of the property to search target node id. |
| firstRow | The first row to search ids. |
| lastRow | The last row to search ids. |
| createMissinElements | If true create source node, destination node if one of them is not found in the graph. |
Member Function Documentation
std::pair<tlp::ElementType,unsigned int> tlp::CSVToGraphEdgeSrcTgtMapping::getElementForRow |
( |
const std::vector< std::string > & |
tokens |
) |
[virtual] |
std::pair<tlp::ElementType,unsigned int> tlp::CSVToGraphEdgeSrcTgtMapping::getElementForRow |
( |
unsigned int |
row |
) |
|
void tlp::CSVToGraphEdgeSrcTgtMapping::init |
( |
unsigned int |
lineNumbers |
) |
[virtual] |