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.

Bulk Import Neo4j 3.5.0 desktop windows

Just installed Neo4j desktop this passed week. I was able to create a graph.db and start it up and browser took me to play screen. Appears I have thing installed correctly.
I've scourged the import documentation and tried several flavors.
Issue:
Unable to successfully complete a bulk load on existing files. (Meaning I had a colleague sent me his exported neo4j database files. To get a jump start.)

  • The command I'm attempting to run via the windows command prompt in C:.Neo4jDesktop\neo4jDatabases\database-90a638ae-1915-462e-8944-beb1bc456849\installation-3.5.0\import\

neo4j-admin import --f=allfiles.txt (> is my command prompt)

Bulk file: allfiles.txt contains this:
--nodes:Race "race/race_node*.csv"
--nodes:Track "track/tracks.csv"
--nodes:Person "person/person.csv"
--nodes:Team "team/team.csv"
--nodes "race/play_node*.csv"
--nodes:RaceLog "racelog/racelog.csv"
--nodes:Appearance "race/appearance_node*.csv"
--nodes:TeamRace "race/team_race_node*.csv"
--nodes "race/simple_node*.csv"
--relationships "race/simple_relationship*.csv"
--relationships "race/participated*.csv"
--relationships:COMMITTED_ERROR "race/committed_error*.csv"

As you noticed with the *, I have a large number of named files.

Action so far.
0. Deleted grab.db from database folder since this is a new db import.

  1. I've export Neo4j_dir to .Neo4jDesktop\neo4jDatabases\database-90a638ae-1915-462e-8944-beb1bc456849\installation-3.5.0\bin
  2. I added %Neo4j_dir% to my %PATH%
  3. Only way I was successful with the "import" I had to run each node and relationship individually with the import command. NOT how I want to do it.
  4. Attempted to execute the neo4-admin import command via copy paste embedding of the contents of allfiles.txt with it.
    4.1 Tried different escape sequence character from "\ to `" to "\ to ^".
  5. Updated the file to change escape sequence character and even removed them. Due to the console error message it said it could understand them.

IMO - acts like it doesn't know how to parse all the commands individually in the file or embedded in the command line.

Anyone can tell me the obvious thing I'm missing.

1 ACCEPTED SOLUTION

Good call - one .* made the difference. Thank you.
Once file was updated.

 --nodes:Race "race/race_node.*.csv"
 --nodes:Track "track/tracks.csv" 
 --nodes:Person "person/person.csv" 
 --nodes:Team "team/team.csv" 
 --nodes "race/play_node.*.csv" 
 --nodes:RaceLog "racelog/racelog.csv" 
 --nodes:Appearance "race/appearance_node.*.csv" 
 --nodes:TeamRace "race/team_race_node.*.csv" 
 --nodes "race/simple_node.*.csv" 
 --relationships "race/simple_relationship.*.csv" 
 --relationships "race/participated.*.csv" 
 --relationships:COMMITTED_ERROR "race/committed_error.*.csv"

neo4j-admin import --f=allfiles.txt (Success!)

View solution in original post

2 REPLIES 2

The file pattern is a regular expression (regexp) so your * has to be written as .* or better .+

Not sure about the / in Windows but I guess it should still work.
Btw. you have a "Terminal" screen in your Desktop for each database which gives you\bin\Neo4jAdmin.cmd (or bat don't recall) directly.

Good call - one .* made the difference. Thank you.
Once file was updated.

 --nodes:Race "race/race_node.*.csv"
 --nodes:Track "track/tracks.csv" 
 --nodes:Person "person/person.csv" 
 --nodes:Team "team/team.csv" 
 --nodes "race/play_node.*.csv" 
 --nodes:RaceLog "racelog/racelog.csv" 
 --nodes:Appearance "race/appearance_node.*.csv" 
 --nodes:TeamRace "race/team_race_node.*.csv" 
 --nodes "race/simple_node.*.csv" 
 --relationships "race/simple_relationship.*.csv" 
 --relationships "race/participated.*.csv" 
 --relationships:COMMITTED_ERROR "race/committed_error.*.csv"

neo4j-admin import --f=allfiles.txt (Success!)