I have a csv file that has 5 columns Sender, Receiver, Weight, Fairness Score (of Sender), Goodness Score (of Receiver).
I am trying to create a network in NEO4J where goodness is a property of the sender and fairness is the relationship between the sender and the receiver. I also want it to import distinct values because I have senders that are receivers and receivers that are also senders.
0
votes
1 Answers
0
votes
If you are asking for a query to generate data from your file, this is roughly what you want (if you want to avoid duplicate nodes and relationships):
LOAD CSV WITH HEADERS FROM 'file:///input.csv' AS row
MERGE(s:Person {id: row.Sender})
SET s.fairness = TOINTEGER(row.`Fairness Score`)
MERGE(r:Person {id: row.Receiver})
SET s.goodness = TOINTEGER(row.`Goodness Score`)
MERGE (s)-[hr:SENDS_TO]->(r)
SET hr.weight = TOINTEGER(row.Weight)
In the future, you need to put much more info into your questions (like what your desired data model is, what you have already tried, and what the results were). And, most importantly, you need to actually state a question!
Weight
, but your CSV has aRating
. Are these the same? – rickhg12hs