cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

To Load the CSV data on Existing Nodes and corresponding Relationships

Hi Team,
I have been working hard on this below issues and need your suggestion on this:
Scenario:
I already have the Schema/model in my Neo4j and I want to load data into the same.
3X_d_4_d428fb119ffef2d9c57d7f37327dfc1595285d9d.png

For example - from the above screen shot: I have node "Load" and "Customer" with relation "Granted". Now I wanted to load the data from CSV on this node.

Is it possible to do ?

Thanks & Regards
Vikash

5 REPLIES 5

ameyasoft
Graph Maven

It's very unclear of your requirement. From your screenshot, what's 'Class' and 'Resource' and what's that you want to load from your .csv? Also, there is no node with label : "Load"

My Sincere apology for this,

Actually , there is "Class" Node , and if I click at "Class", then I get these labels - "Customer" and "Loan".

I have CSV file with column "Loan" and "Customer" . I want to load the CSV on to these labels inside "CLASS" node which is "Loan" and "Customer".
At the same time, I wanted to make use of the same relationship between them and that is - "Granted".
The data look for the "Loan" label inside class:

Please let me know , if I am making myself clear.

This means you have a node with multiple labels: "Class" and "Resouce" and this node has two properties: name and label being equal to "Loan". From your screenshot, you have another node with label "Loan" and is connected to "Customer" node via "Granted" relationship. Please post couple of rows of your .csv file and the Cypher query you are using under your LOAD CSV call.

Thanks a ton for your kind response.

Your assumptions are right and to be more precise:
"Class" is one Node and it has various properties like "Loan" and "Customer"

Below is the screen shot:

3X_2_1_212f223f06385efab81692815a565df95f8561e9.png

and the relationship between them:
3X_b_4_b49ab681b17efa6e80a741b76f57dd041b168533.png

Sample data from Customer CSV file:
3X_0_0_00ad39ef17f2c1c15c07a4a14a5a96c34ee6cca9.png

Sample data from Loan CSV file:
3X_c_5_c5b493db08666f7575ee19e9b222d56f0034aee1.png

For Sample Cypher:
Actually I wanted to know, if this is correct approach and is it possible to do.
Kindly advice me .

Thanks & Regards
Vikash Kumar

Simplest is to create Customer and Loan nodes:

MERGE (a:Customer {name: "Vikash", id: toInteger("10120")})
MERGE (b:Customer {name: "Roxy", id: toInteger("10305")})

MERGE (c:Loan {amount: 1000, loanid: toInteger("10001")})
MERGE (d:Loan {amount: 1500, loanid: toInteger("10002")})

MERGE (a)-[:IS_GRANTED]->(c)
MERGE (b)-[:IS_GRANTED]->(d)