cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.

Error Loading CSV Files with Neo4j macOS Desktop App

Ciro
Node Clone

I'm running the Neo4J desktop app (V1.2.1) for macOS (v10.14.5). I downloaded the Northwinds database to follow along the "Import Data into Neo4j" tutorial in the online developer guides.

  1. I created a local database
  2. Started it in the desktop app
  3. I launched the Neo4j browser (V3.2.20)
  4. Copied the following commands from the tutorial
    USING PERIODIC COMMIT
    LOAD CSV WITH HEADERS FROM "file:customers.csv" AS row
    CREATE (:Customer {companyName: row.CompanyName, customerID: row.CustomerID, fax: row.Fax, phone: row.Phone});
  5. The app returns the following error message "Neo.DatabaseError.General.UnknownError: URI is not hierarchical"

Can you help me decipher this message so I can understand what I need to do to have the app properly upload the CSV file?

Thanks,
Ciro

3 REPLIES 3

dana_canzano
Neo4j
Neo4j

Can you change the Cypher statement to

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///customers.csv" AS row
CREATE (:Customer {companyName: row.CompanyName, customerID: row.CustomerID, fax: row.Fax, phone: row.Phone});

changing file:customers.csv to file:///customers.csv. Also I presume the customers.csv is located in the import directory?

Ciro
Node Clone

Dana,
You're a Neo4j whisperer! That worked beautifully, but why?

Thanks so much for taking the time to answer a simple, newbie question. I really appreciate it!
Regards,
Ciro

https://neo4j.com/docs/cypher-manual/3.5/clauses/load-csv/ makes a number of references to file:///, for example

File URLs will be resolved relative to the dbms.directories.import directory. For example, a file URL will typically look like file:///myfile.csv or file:///myproject/myfile.csv .