Introduction To Neo4j and Gephi Tool

Nandish Bhayani
4 min readOct 29, 2021

--

Gephi Tool

Gephi is a tool for data analysts and scientists keen to explore and understand graphs. Like Photoshop but for graph data, the user interacts with the representation, manipulate the structures, shapes and colors to reveal hidden patterns. The goal is to help data analysts to make hypothesis, intuitively discover patterns, isolate structure singularities or faults during data sourcing

  1. For creating new project open Gephi and click on New Project. Then choose File->Open and load the dataset of your choice as shown below. On loading the dataset it would show the number of nodes and edges present in the dataset as well as the type of the graph.

2. The below image show how our data is look like when initially load.

3. We can select multiple layout of data represent. For that you have to select one of the layout from left side panel of tool. Here is ForceAtlas 2 layout.

Now another feature is that we can differentiate node according to there In-Degree, Out-Degree or Degree and show them in different color. For this in the left pane on top side choose Nodes->Ranking there choose the ranking like in below image In-Degree is chosen.

For more clear appearance we can also be made by displaying the nodes in various sizes. For instance in the below image nodes having higher degree are larger in size compared to nodes having less degree for instance nodes in Dark grey have high value of degree compared to nodes in white and red color.

Here, below image show how we can change size of nodes.

Next we generate a Degree Distribution graph for Degree, In-Degree and Out-Degree and also get the Average Degree value for all the nodes. To generate the graph simply in the right pane choose Statistics tab and there run Average Degree in the Network Overview section.

Now, it’s time to show data table. For that go Window->Data Table and you would be able to see your table like as in above image where after running the Average Degree function columns.

Now, we can create or try different functionalities and layout for graph.

Neo4j Tool

The Neo4j ETL tool was developed to make this initial import straightforward. It extracts the schema from any relational database and allows you to turn it into the graph schema you need. Then it takes care of importing the data into your graph either in bulk or online mode.

For this practical, you have to install application named “NEO4j Desktop” and then firstly, you have to run a hello world query which will create the 2 nodes called Neo4j and Hello world and 1 relation called says.

Here, you can see database.

I use movie database for this demo you can choose any other database and try it. 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. use below command to find total nodes.

For finding labels ,

Getting knowledge about relationship between different model you can run following query

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.

Finding movies in which tom hanks as a hero

Matched Output

--

--