I have two csv files: (clean_data_2.csv : Sample Content as under)
(stationdata.csv : Sample Content as under)
From my cypher query, I want that each station is represented as node and relationship is represented as count.
I did something like this:
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///stationdata.csv" AS line
CREATE (s:station{id:line.station_id,station_name:line.name});
Loading all station data: it creates all the nodes - source and destination columns
LOAD CSV WITH HEADERS FROM "file:///clean_data_2.csv" AS line
MATCH (src:station),(dst:station)
CREATE (src)-[:TO{ count: [line.count]}]->(dst);
The above part runs, but does not give me count in the relationship between nodes.
I am new to Neo4j - graph databases, thanks!
MATCH
clause does not specify thename
s of thestation
nodes forsrc
anddst
, so all possible pairs ofstation
nodes will be matched. That should cause the creation of a lot of extraTO
relationships withcount
properties, and yet you seem to be saying that you don't get anycount
properties? – cybersam