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.

Neo4j-admin import: Creating multiple nodes per line of CSV data

Hello,

i am planing on importing a huge dataset consisting of CSV files into neo4j.
The data is formatted similar to the following example:

user, gender, company
bob123,M,Apple
tom234,M,IBM

The graph structure should consist of nodes with labels User, Gender or Company and should be connected like this:

(Apple:Company)<-(bob123:User)->(M:Gender)<-(tom234:User)->(IBM:Company)

I wanted to use the neo4j-admin import tool because of the performance advantage in comparison to LOAD CSV, but as far as I understand, the import tool only creates one node for for every node in a csv input file, which is not what I am aiming for. Furthermore it needs a seperate relationship table.

Is there a way to use the import tool with the CSV table above as it is or do i have to reformat the data before importing?

Best regards,
Mario

1 REPLY 1

You have 2 options here:

  • separate the header from the files
  • you can use the same file multiple times e.g. for several nodes or relationships
  • use different header files for each case with the irrelevant columns set to :IGNORE

please note that de-duplication of nodes is slow and expensive in the current implementation.
also relationships will not be de-duplicated if they appear multiple times