'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



Solution 1:[1]

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/

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 NonameCurious
Solution 2 Pooya Mohammadi Kazaj