SparkseePython
6.0.2
|
Embedded Graph Database. More...
Functions | |
def | load_nodes_csv (self, graph, file_name, node_type, separator, header, columns, attr_names, data_types, attr_kinds) |
Loads nodes from a CSV file. More... | |
def | load_edges_csv (self, graph, file_name, edge_type, tail_node_type, head_node_type, tail, head, separator, directed, header, on_missing_tail, on_missing_head, columns, attr_names, data_types, attr_kinds) |
Loads edges from a CSV file. More... | |
Interface to be implemented to receive TypeLoaderEvent events from a TypeLoader.
Check out the 'Data import' section in the SPARKSEE User Manual for more details on this.
def sparksee.load_edges_csv | ( | self, | |
graph, | |||
file_name, | |||
edge_type, | |||
tail_node_type, | |||
head_node_type, | |||
tail, | |||
head, | |||
separator, | |||
directed, | |||
header, | |||
on_missing_tail, | |||
on_missing_head, | |||
columns, | |||
attr_names, | |||
data_types, | |||
attr_kinds | |||
) |
Loads edges from a CSV file.
nodeType[in] The type of the edge to load. If it does not exist, it creates it
graph | [in] The graph to load the edges into |
file_name | [in] The name of the file |
edge_type | null |
tail_node_type | [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 |
head_node_type | [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 |
on_missing_tail | [in] The policy to follow when a tail is missing. Default: "IsError" |
on_missing_head | [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 |
attr_names | [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 |
data_types | [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 |
attr_kinds | [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 |
def sparksee.load_nodes_csv | ( | self, | |
graph, | |||
file_name, | |||
node_type, | |||
separator, | |||
header, | |||
columns, | |||
attr_names, | |||
data_types, | |||
attr_kinds | |||
) |
Loads nodes from a CSV file.
graph | [in] The graph to load the nodes into |
file_name | [in] The name of the file |
node_type | [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 |
attr_names | [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 |
data_types | [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 |
attr_kinds | [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 |