Getting started with Neo4j and Gephi

Nidhish Gandhi
4 min readSep 13, 2021

Neo4j facilitates personal data storage and management: it allows you to track where private information is stored and which systems, applications, and users access it. The graph data model helps visualize personal data and allows for data analysis and pattern detection.

Neo4j provides its own implementation of graph theory concepts.Let’s take an in-depth look at the Labeled Property Graph Model in the Neo4j database. It has the following components:

  • Nodes (equivalent to vertices in graph theory). These are the main data elements that are interconnected through relationships. A node can have one or more labels (that describe its role) and properties (i.e. attributes).
  • Relationships (equivalent to edges in graph theory). A relationship connects two nodes that, in turn, can have multiple relationships. Relationships can have one or more properties.
  • Labels. These are used to group nodes, and each node can be assigned multiple labels. Labels are indexed to speed up finding nodes in a graph.
  • Properties. These are attributes of both nodes and relationships. Neo4j allows for storing data as key-value pairs, which means properties can have any value (string, number, or boolean).

The graph data structure might seem unusual, but it’s simple and natural. Here’s an example of a simple graph data model in Neo4j:

As you can see, this graph contains two nodes (Alice and Bob) that are connected by relationships. Both nodes share the same label, Person. In the graph, only Bob’s node has properties, but in Neo4j every node and relationship can have properties.

First download and install Neo4j and then run the server in localhost.

Now, For the example I am running hello world query which will create the 2 nodes called Neo4j and Hello world and 1 relation called says.

We can see that the 2 nodes is created and one relation called says is created using the query.

In the below image you can see the table view of nodes and relations.

Here you can see database and the message.

After that load the movie database to the neo4j and it will show the data in graph format.

In this database,There are 9 person nodes and 8 movies nodes and total 18 relationships between nodes.

By using this query we can know that how the person is connected to the movie,who is producer of movie, which role person acted in the movie.

By using different query we can find the appropriate information like how many labels is there.

By using this query we can count total number of relationships.

Here the list of movie released between 1995 and 1999,

So this was the basic information about neo4j to get started with..

Gephi tool

Gephi is an open-source software for visualizing and analysing large networks graphs. Gephi uses a 3D render engine to display graphs in real-time and speed up the exploration. You can use it to explore, analyse, spatialise, filter, cluterize, manipulate and export all types of graphs.

So after downloading and installing, we will use the dataset from the gephi website and we will import it in our workspace.

Here are some of the graphical layouts like random, expansion and force atlas.

So these were some basic operation in the Gephi tool.

--

--