Need to create a graph but don’t have coding skills? I’ve been there. In this blog post we will show you how to turn a spreadsheet into a Neo4j graph database without having to type a single line of code.
So how to load an Excel spreadsheet into Neo4j? We have built a spreadsheet where you can copy/paste your data and automatically turn it into Cypher code, Neo4j’s query language. The code can then be typed in Neo4j to load your data. A big shout out to Rik Van Bruggen from Neo4j who inspired this blog post!
How to add your data to the spreadsheet
The spreadsheet contains 3 tabs: a set of instructions, a tab for nodes and a tab for edges. The nodes and edges tabs are loaded with dummy data that you can replace with your own data.
- Node type: a description of the sort of entity a node belongs to (eg PERSON, COMPANY, etc)
- Node ID: a number, it must be unique to each node
- Property 1-4: a description that can be attached to a node (eg an age, a name, etc)
- Cypher statement: the cypher statement needed to create the node
The relationships tab contains:
- From: the unique identifier of a node (as defined in the nodes tab) on the outbound side of a relationship
- To: the unique identifier of a node (as defined in the nodes tab) on the inbound side of a relationship
- Relationship Type: the type of relationship between the “from” and the “to” nodes
- Property 1: a description that can be attached to the relationship (eg an amount, a date)
- Cypher statement: the cypher statement needed to create the relationship
How to load the spreadsheet into Neo4j
Now it’s time to load your data into a Neo4j graph database. You can go on Neo4j’s website to download the software and get instructions on how to install it.
Start Neo4j. Create a new project. Click on start. Click on the Neo4j Browser.
Now copy paste the content of the Cypher statement column in the nodes tab. Click enter, it will create your nodes.
Go to the edges tab of the spreadsheet. Copy/paste one by one the Cypher statements to create your relationships.
Please not that this method is really meant to import a small dataset. For larger datasets, there are other options available. If you are using Excel, there’s a plugin you may want to install.
Now that your data is loaded in Neo4j, simply connect Linkurious Enterprise to your database to start exploring it!