Loading various kinds of files into Neo4j requires different locations depending on the tool you are using.
Import methods we will cover: 1. Neo4j Desktop 2. Neo4j Sandbox
Filepath for Neo4j Desktop will vary based on your operating system.
Mac OS or Linux – <neo4j-home>/import
For example, mine is located in the following path:
If you used the default application path when Neo4j Desktop was installed, your path could be the same as the path above (after substituting your user account, database id, and version). If you changed the path of Neo4j Desktop when it was installed, the path should follow those changes.
Windows Desktop – <neo4j-home>\import
As an example, this is the path for my Windows installation (assuming the default application path when Neo4j Desktop was installed):
Custom Import Folder
If you require a file location different from the default, you can update the following setting in the neo4j.conf file. We recommend specifying a directory path, rather than commenting out the setting, to avoid the security issue mentioned in the configuration comment.
Importing files in Neo4j Sandbox works a bit differently. Sandboxes are instance that are spun up and hosted in the cloud and expire after a certain period of time. Because of this, the security settings do not allow sandboxes to access local file settings on a desktop. Any files that need to be imported must be stored or placed in a remote location that the instance can access – like GitHub, a website, Google Drive, or Dropbox. We will look at examples for each of the locations for importing into a Neo4j Sandbox instance.
If you find or place a file in a GitHub repository, Neo4j Sandbox can access the content in a raw format. You just need to navigate to the GitHub repository that contains the file and drill down to the file itself. Once there, you should see a menu bar like the one below right above the file contents.
Click on the
Raw button in the button list on the right and copy the url path when the page loads (url should start like
https://raw.githubusercontent.com/…;). Now you should be able to view the data in your sandbox browser session with a query like this one.
If the file is hosted on a website, Neo4j Sandbox can access it there with a url. For example, in the Neo4j Cypher Manual, the
LOAD CSV page uses a csv file on neo4j.com.
You can access files uploaded to Google Sheets, as long as the permissions are set correctly. Once the file is uploaded to Google Drive, you can follow the screenshots below to walk through the rest of the process. The red boxes and numbering show where to click and what order to do the steps.
A file uploaded to Dropbox works similarly to the process with Google Drive. Again, you will need to ensure permissions are set appropriately. Screenshots below step through the rest of the steps.