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.

How to construct nodes and relationships with one transaction table for community detection?

I have a big table with transaction records. It has 2 columns, one is FROM and the other is TO. I want to do community detection but don't know how to construct the nodes and relationships automatically with the transaction records. All the examples are about matching with relevant properties or manually creating nodes and connections. How to import the CSV file could I generate all the nodes and transaction relationships all at once? Is there an example I can refer to?

1 ACCEPTED SOLUTION

You need to create a data model, then create an import script to reads your data from a csv file and relates the nodes and relationships according to your data model. 

What kind of entity does the ‘from’ column column relate to, and the same for the ‘to’ column?  These descriptions would correspond to your node labels. You could have a something like HAS_TRANSACTION as your relationship type. 

Do the ‘from’ and ‘to’ entities have properties describing each that you also need to save?  These need to be included in the spreadsheet. 

we can try to assist if you provide more details. In the meantime, you can read this on importing. You may also want to look into taking some of the fundamental GraphAcademy classes. 

https://neo4j.com/docs/cypher-manual/current/clauses/load-csv/

View solution in original post

1 REPLY 1

You need to create a data model, then create an import script to reads your data from a csv file and relates the nodes and relationships according to your data model. 

What kind of entity does the ‘from’ column column relate to, and the same for the ‘to’ column?  These descriptions would correspond to your node labels. You could have a something like HAS_TRANSACTION as your relationship type. 

Do the ‘from’ and ‘to’ entities have properties describing each that you also need to save?  These need to be included in the spreadsheet. 

we can try to assist if you provide more details. In the meantime, you can read this on importing. You may also want to look into taking some of the fundamental GraphAcademy classes. 

https://neo4j.com/docs/cypher-manual/current/clauses/load-csv/