0
votes

I am new to neo4j and have "0" coding background (although trying to learn some). I understand the basic functionalities and am also able to import nodes and relationships using LOAD CSV. However, I absolutely can not make the neo4j-admin import tool work.

I created a new database, included the simplest CSV file in the import folder and tried the following (I will have to explain in the most simple terms - so don't laugh :))

Name of the file is test.csv Content;

PropertyTest,:LABEL proptest,TEST

  • I tried running the neo4j-import file by trying to open it. A black screen opens up and immediately disappears.
  • I tried ---> bin/neo4j-admin import --id-type=STRING \ --nodes:TEST=test.csv \ --nodes="test.csv" \

Could someone please explain to me with the simplest terms what the steps would be to import this?

Thank you.

1
What response did you get from the command you executed in your second bullet?hoyski
Thank you for your response. I got; Expected '--nodes' to have at least 1 valid item, but had 0 []Can Tokcan
In your post the contents of test.csv appear to be on a single line. I assumed that was just a display issue but if it's truly one line you'll need to make it two lines. The first line should be PropertyTest,:LABEL and the second should be proptest,TEST Also, you only need the --nodes switch once per CSV. Since you have the label in your file, this should be all you need to execute bin/neo4j-admin import --nodes=test.csv . Please let me know if that runs successfullyhoyski
Hi Hoyski. Thank you for your support. I actually do have two lines as you have suggested above. This is what I get ---> C:\Users\CanTOKCAN\.Neo4jDesktop\neo4jDatabases\database-04dafbb5-5fda-413e-8ebd-fb837ae597c6\installation-3.5.14\bin>neo4j-admin import --nodes=test.csv Expected '--nodes' to have at least 1 valid item, but had 0 []Can Tokcan
I believe the issue is that test.csv is not in your bin directory. Unfortunately the import utility doesn't report "File not found" which would be far more helpful. Try moving your test.csv file to your bin folder. Or specify the full or relative path to test.csv in the switch. E.g. If test.csv is in the folder above bin, run neo4j-admin import --nodes=..\test.csvhoyski

1 Answers

0
votes

The import folder under your Neo4j installation is fine to use but just bear in mind that the dbms.directories.import setting in neo4j.conf is just for the LOAD CSV command, not for neo4j-admin import.

Since your current directory in the command prompt is the bin folder, when you run the import command specifying import/movies.csv then that implies that the CSV file is in a folder called import under the current directory, under the bin folder.

If you run the command this way it should find the CSV files:

neo4j-admin import --nodes=../import/movies.csv --nodes=../import/actors.csv --relationships=../import/roles.csv

.. means the parent directory so running the command this way means to go up to the parent directory and then into the import directory under the parent dir.