1 | initial version |
To bring cipher files into Memgraph, you can use the LOAD CSV
clause in a Cypher query.
First, make sure that your cipher file is in CSV format with headers.
Next, use the LOAD CSV
clause in a CREATE
or MERGE
query to import the data from the CSV file into Memgraph.
For example, if your cipher file contains nodes with headers "id" and "name", you can use the following query:
LOAD CSV WITH HEADERS FROM "path/to/cipher_file.csv" AS row
CREATE (:Node {id: toInteger(row.id), name: row.name})
This query reads the CSV file, maps the headers to the properties of a node, and creates a node for each row in the CSV file.
Similarly, you can import relationships by specifying the source and target nodes in the MATCH
clause:
LOAD CSV WITH HEADERS FROM "path/to/cipher_file.csv" AS row
MATCH (source:Node {id: toInteger(row.source)})
MATCH (target:Node {id: toInteger(row.target)})
CREATE (source)-[:RELATIONSHIP]->(target)
This query reads the CSV file, matches the source and target nodes by their IDs, and creates a relationship between them for each row in the CSV file.