Export Class
Export the neo4j data to sql or csv
Tables
- Nodes
- Edges
- NodeProperties
- EdgeProperties
1) stream the data into temporary files
2) make the files downloadable for the client
3) delete the temporary files
CREATE TABLE IF NOT EXISTS Node (
Node_ID INTEGER PRIMARY KEY AUTOINCREMENT,
tokenType TEXT,
groupType TEXT
);
CREATE TABLE IF NOT EXISTS Relation (
Relation_ID INTEGER PRIMARY KEY AUTOINCREMENT,
SourceNode_ID INTEGER,
TargetNode_ID INTEGER,
relationType TEXT
);
CREATE TABLE IF NOT EXISTS NodeProperties (
NodeProperties_ID INTEGER PRIMARY KEY AUTOINCREMENT,
key TEXT,
value TEXT,
Node_ID INTEGER
);
CREATE TABLE IF NOT EXISTS RelationProperties (
RelationProperties_ID INTEGER PRIMARY KEY AUTOINCREMENT,
key TEXT,
value TEXT
);
Item Index
Methods
Properties
Methods
_get_time
()
String
Get the current time as POSIX time as a string
Returns:
_node_properties_to_csv
-
write_stream
Writes csv into the given write_stream
Starts with the CSV Table header and then adds all _node_properties_to_csv line by line
Parameters:
-
write_streamWriteStream
Returns:
_node_properties_to_sql
-
write_stream
Writes sql code into the given write_stream
Starts with the SQL Table creation for node properties and then adds all properties
Parameters:
-
write_streamWriteStream
Returns:
_nodes_to_csv
-
write_stream
Writes csv into the given write_stream
Starts with the CSV Table header and then adds all nodes line by line
Parameters:
-
write_streamWriteStream
Returns:
_nodes_to_sql
-
write_stream
Writes sql code into the given write_stream
Starts with the SQL Table creation and then adds all nodes
Parameters:
-
write_streamWriteStream
Returns:
_relation_properties_to_csv
-
write_stream
Writes csv into the given write_stream
Starts with the CSV Table header and then adds all relation_properties line by line
Parameters:
-
write_streamWriteStream
Returns:
_relation_properties_to_sql
-
write_stream
Writes sql code into the given write_stream
Starts with the SQL Table creation for relation properties and then adds all properties
Parameters:
-
write_streamWriteStream
Returns:
_relations_to_csv
-
write_stream
Writes csv into the given write_stream
Starts with the CSV Table header and then adds all relations line by line
Parameters:
-
write_streamWriteStream
Returns:
_relations_to_sql
-
write_stream
Writes sql code into the given write_stream
Starts with the SQL Table creation for relations and then adds all relations
Parameters:
-
write_streamWriteStream
Returns:
to_csv
()
Promise
Creates a zipped dir containing four files necessary to reassemble the GraphDB's storage The file is stored in the to_folder of Export
Returns:
to_sql
()
Promise
Creates a zipped SQL file containing all of the SQL creation and insertion statements for the DB The file is stored in the to_folder of Export
Returns:
Properties
to_folder
String
The target folder where the exports are stored
Default: path.join(__dirname, '..', 'media', 'export')
