marlon
marlon

Reputation: 7663

Create graph reports "no protocol" error message

WITH "/Users/nlp/social_graph/graph-nodes.csv" as uri
LOAD CSV WITH HEADERS FROM uri as row
MERGE (:User {id: row.id})

I have a CSV file to contains some nodes, and I want to load it into neo4j through Neo4j Desktop, but got the following error message:

Invalid URL '/Users/nlp/social_graph/graph-nodes.csv': no protocol: /Users/nlp/social_graph/social-nodes.csv

What's the error? Note that before I run the command in the browser, the database is empty. How to load the database?

EDIT: Did some search and added 'file:///' to the file path, this time I got another message:

Couldn't load the external resource at: file:/Users/congminmin/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-fdb13bea-33f7-409b-a6bd-387a25a679e6/installation-3.5.12/import/Users/congminmin/social_graph/social-nodes.csv

Upvotes: 1

Views: 652

Answers (2)

Pooya Mohammadi Kazaj
Pooya Mohammadi Kazaj

Reputation: 153

I know it's late, but if you are using neo4j on docker, the import folder path is as follows:

/var/lib/neo4j/import

You can create a volume that bounds to the import directory. After mounting, copy your local files to your mounted directory, then use file:///file-name in your LOAD command.

Upvotes: 0

NonameCurious
NonameCurious

Reputation: 596

The easiest would be to copy your cv file into the import directory under your neo4j installation directory. Then use file:///social-nodes.csv In your LOAD CSV command. Find more details here: https://neo4j.com/developer/guide-import-csv/

Upvotes: 1

Related Questions