I got a sample-data.cypherl
file that looks like this:
CREATE (:Factory {id: "200", name: "Factory Alpha", location: "New York"});
CREATE (:Warehouse {id: "201", name: "Warehouse Bravo", location: "Berlin"});
CREATE (:Retailer {id: "202", name: "Retailer Charlie", location: "Tokyo"});
CREATE (:Warehouse {id: "203", name: "Warehouse Delta", location: "Sydney"});
CREATE (:Retailer {id: "204", name: "Retailer Echo", location: "Toronto"});
MATCH (u:Factory), (v:Warehouse) WHERE u.id = "200" AND v.id = "201" CREATE (u)-[:SUPPLIES]->(v);
MATCH (u:Factory), (v:Warehouse) WHERE u.id = "200" AND v.id = "203" CREATE (u)-[:SUPPLIES]->(v);
MATCH (u:Warehouse), (v:Retailer) WHERE u.id = "201" AND v.id = "202" CREATE (u)-[:DISTRIBUTES_TO]->(v);
MATCH (u:Warehouse), (v:Retailer) WHERE u.id = "201" AND v.id = "204" CREATE (u)-[:DISTRIBUTES_TO]->(v);
MATCH (u:Warehouse), (v:Retailer) WHERE u.id = "203" AND v.id = "202" CREATE (u)-[:DISTRIBUTES_TO]->(v);
MATCH (u:Warehouse), (v:Retailer) WHERE u.id = "203" AND v.id = "204" CREATE (u)-[:DISTRIBUTES_TO]->(v);
The fist batch of queries create nodes for factories, warehouses, and retailers. The second batch queries create relationships between these nodes, representing the supply chain connections. So it hoes something like this:
- Factory Alpha supplies Warehouse Bravo and Warehouse Delta.
- Warehouse Bravo distributes to Retailer Charlie and Retailer Echo.
- Warehouse Delta distributes to Retailer Charlie and Retailer Echo.
I know that I can simply run this as a query in Memgraph Lab, but what when I will have larger files with thousands of rows? I think that browsers have some limit when it comes to copy/pasting data info fields.
I have two instances of Memgraph for learning, native Ubuntu and one running in Docker (this is Memgraph Platform image).
How can I import cypherl files directly into them, without copy/paste method?