Sparksee  6.0.2
CSVLoader Class Reference

Static Public Member Functions

static void LoadNodes (sparksee::gdb::Graph &graph, const std::wstring &fileName, const std::wstring &nodeType, const std::wstring &separator=std::wstring(L","), sparksee::gdb::bool_t header=true, const std::vector< sparksee::gdb::int32_t > &columns=std::vector< sparksee::gdb::int32_t >(), const std::vector< std::wstring > &attrNames=std::vector< std::wstring >(), const std::vector< sparksee::gdb::DataType > &dataTypes=std::vector< sparksee::gdb::DataType >(), const std::vector< sparksee::gdb::AttributeKind > &attrKinds=std::vector< sparksee::gdb::AttributeKind >())
 Loads nodes from a CSV file. More...
 
static void LoadEdges (sparksee::gdb::Graph &graph, const std::wstring &fileName, const std::wstring &edgeType, const std::wstring &tailNodeType, const std::wstring &headNodeType, sparksee::gdb::int32_t tail=0, sparksee::gdb::int32_t head=1, const std::wstring &separator=std::wstring(L","), sparksee::gdb::bool_t directed=true, sparksee::gdb::bool_t header=true, sparksee::gdb::MissingEndpoint onMissingTail=gdb::IsError, sparksee::gdb::MissingEndpoint onMissingHead=gdb::IsError, const std::vector< sparksee::gdb::int32_t > &columns=std::vector< sparksee::gdb::int32_t >(), const std::vector< std::wstring > &attrNames=std::vector< std::wstring >(), const std::vector< sparksee::gdb::DataType > &dataTypes=std::vector< sparksee::gdb::DataType >(), const std::vector< sparksee::gdb::AttributeKind > &attrKinds=std::vector< sparksee::gdb::AttributeKind >())
 Loads edges from a CSV file. More...
 

Member Function Documentation

static void CSVLoader::LoadEdges ( sparksee::gdb::Graph &  graph,
const std::wstring &  fileName,
const std::wstring &  edgeType,
const std::wstring &  tailNodeType,
const std::wstring &  headNodeType,
sparksee::gdb::int32_t  tail = 0,
sparksee::gdb::int32_t  head = 1,
const std::wstring &  separator = std::wstring(L","),
sparksee::gdb::bool_t  directed = true,
sparksee::gdb::bool_t  header = true,
sparksee::gdb::MissingEndpoint  onMissingTail = gdb::IsError,
sparksee::gdb::MissingEndpoint  onMissingHead = gdb::IsError,
const std::vector< sparksee::gdb::int32_t > &  columns = std::vector< sparksee::gdb::int32_t >(),
const std::vector< std::wstring > &  attrNames = std::vector< std::wstring >(),
const std::vector< sparksee::gdb::DataType > &  dataTypes = std::vector< sparksee::gdb::DataType >(),
const std::vector< sparksee::gdb::AttributeKind > &  attrKinds = std::vector< sparksee::gdb::AttributeKind >() 
)
static

Loads edges from a CSV file.

Parameters
graph[in] The graph to load the edges into
fileName[in] The name of the file
nodeType[in] The type of the edge to load. If it does not exist, it creates it
tailNodeType[in] The type of the tail nodes. If it does not exist and onMissingTail is set to "Create", it creates it. Otherwise, an exception is thrown
headNodeType[in] The type of the head nodes. It it does not exist and onMissingHead is set to "Create", it creates it. Otherwise, an exception is thrown
tail[in] The tail column index. Default: 0
head[in] The head column index. Default: 1
separator[in] The column separator. Default: ","
directed[in] True if this edge is directed or not. False otherwise. Default: True
header[in] True if the CSV contains a header. False otherwise. Default: True
onMissingTail[in] The policy to follow when a tail is missing. Default: "IsError"
onMissingHead[in] The policy to follow when a head is missing. Default: "IsError"
columns[in] The list of columns to load. tail and head columns must be in this list if this list is specified. If the list is empty, all columns are loaded. Default: empty
attrNames[in] The attribute names. If this list is empty and hasHeader is set to true, the header values are used as attribute names. Default: empty
dataTypes[in] The dataTypes of the attributes if this do not already exist. If this list is empty, the method tries to infer the data type from the first non-header row. Default: empty
attrKinds[in] The attributeKinds of the attributes if these do not already exist. If this list is empty, the attributeKind of the created attributes are set to Basic. Default: empty
static void CSVLoader::LoadNodes ( sparksee::gdb::Graph &  graph,
const std::wstring &  fileName,
const std::wstring &  nodeType,
const std::wstring &  separator = std::wstring(L","),
sparksee::gdb::bool_t  header = true,
const std::vector< sparksee::gdb::int32_t > &  columns = std::vector< sparksee::gdb::int32_t >(),
const std::vector< std::wstring > &  attrNames = std::vector< std::wstring >(),
const std::vector< sparksee::gdb::DataType > &  dataTypes = std::vector< sparksee::gdb::DataType >(),
const std::vector< sparksee::gdb::AttributeKind > &  attrKinds = std::vector< sparksee::gdb::AttributeKind >() 
)
static

Loads nodes from a CSV file.

Parameters
graph[in] The graph to load the nodes into
fileName[in] The name of the file
nodeType[in] The type of the node to load. If it does not exist, it creates it
separator[in] The separator of the CSV file. Default: ","
header[in] True if the CSV contains a header. False otherwise. Default: True
columns[in] The list of columns to load. tail and head columns mus be in this list if this list is specified. Default: all columns
attrNames[in] The attribute names. If this list is empty and hasHeader is set to true, the header values are used as attribute names. Default: empty
dataTypes[in] The dataTypes of the attributes if this do not already exist. Default: empty If this list is empty, the method tries to infer the data type from the first non-header row
attrKinds[in] The attributeKinds of the attributes if these do not already exist. Default: empty If this list is empty, the attributeKind of the created attributes are set to Basic. Default: empty

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