top of page
  • Writer's pictureRevanth Reddy Tondapu

Part 3: Setting Up Neo4j on a Windows Machine


Setting Up Neo4j on a Windows Machine
Setting Up Neo4j on a Windows Machine

In this blog post, we will walk through the process of setting up Neo4j on a Windows machine. Neo4j is a popular graph database that allows you to represent and manage data in a way that emphasizes relationships between data points. Let's get started!


Step 1: Downloading Neo4j

First, open your preferred web browser and search for "install Neo4j". This should lead you to the official Neo4j website. Once there, follow these steps:

  1. Navigate to the Deployment Center.

  2. You will find installation files for Mac, Linux, and Windows. For this demo, choose the Windows option.

  3. Click on Download. Before the download starts, you will need to fill out a form with your details.

  4. After filling out the form, the download will start automatically.

You will also receive a software key, which is free of cost. This key will be required when you start Neo4j for the first time. Save this key in a text file for easy access later.


Step 2: Installing Neo4j

Now that the download is complete, let's proceed with the installation:

  1. Locate the downloaded Neo4j setup file and double-click to run it.

  2. Follow the installation prompts. You can choose any installation options that suit your needs and click Next for the remaining steps.

  3. Within a few seconds, Neo4j will be installed on your machine.

If you are installing Neo4j for the first time, you will be prompted to paste the software key. Alternatively, you can set up the key by clicking on Software Key and adding the key manually.


Step 3: Creating a Project and Database Management System (DBMS)

Once Neo4j is installed, follow these steps to create a project and add DBMS under it:

  1. Open Neo4j Desktop.

  2. If this is your first time installing Neo4j, you might see a default project with an active DBMS already present. For this demo, create a new project.

  3. Add a DBMS to your new project and set a password that you can remember.

  4. Click Create to create a DBMS under the project.

  5. Click Start to make this DBMS active. Within a few seconds, your DBMS should be in an active state, indicating that the Neo4j setup is complete.


Step 4: Accessing Neo4j Browser

Now, let's access the Neo4j Browser to interact with your database:

  1. Go to Graph Apps on the left menu and click on Neo4j Browser.

  2. If a new window opens with a Neo4j prompt and a screen like the one shown below, you are good to go!


Setting Up Initial Data in Neo4j Browser

Next, let's explore the Neo4j Browser and set up some initial data.

  1. In the Neo4j Browser, click on Open Guide.

  2. Click Next to proceed through the guide.

  3. You will find a script to import some sample data related to movies. Run this script to set up the sample data. This dataset comes by default with the desktop installation.

  4. After running the script, you will see a glimpse of the data and how it looks in a graph database.



Visualizing the Schema

To better understand the schema of this dataset, follow these steps:

  1. Run the command DB schema visualization to get information related to all nodes, their labels, relationships, and types.

call db.schema.visualization

2. You can change the orientation of the diagram as per your choice.


3. Click on a node (e.g., the red node) and on the right-hand side, click on the label (e.g., "movie"). This will give you an option to select the caption of the node. A caption is what you want to display in your visualization.


4. Adjust the graph by zooming in or out and maximizing its size for better readability.


Understanding the Schema

From the visualization, you can observe:

  • There are two labels: movie and person.

  • There are five types of relationships from person to movie:

    • ACTED_IN

    • REVIEWED

    • PRODUCED

    • WROTE

    • DIRECTED

  • There is also a FOLLOWS relationship between two person nodes, indicating one person follows another.

Relationships are directional, meaning if A knows B, it does not imply B knows A unless explicitly defined.


Exploring the Database

To explore further:

  1. Click on Databases in the left menu to find details such as node labels, relationship types, and all property keys.

  2. Click on the database image again to close this view.

  3. Use the clear command to remove everything from the screen.

  4. Run the schema visualization command again to refresh the view.

These commands are part of Cypher Query Language, which we will explore in detail in future sections.


Conclusion

In this demo, we learned how to set up Neo4j's desktop version on a Windows machine, how to create a project and DBMS, and how to visualize the schema of a sample dataset. We also explored the Neo4j Browser and learned how to upload and visualize data. Stay tuned for more detailed tutorials on using Cypher Query Language and other advanced features of Neo4j. Happy graphing!

17 views0 comments

Comments


bottom of page