Here I am visualizing the famous requests library for HTTP. The _main_ function now looks like below: For that purpose, I will be using pip show command. Next, I need to grab an individual installed module information. I imported pkg_resources to get all installed modules. For that purpose, I am using the neo4j Python driver.įirst, we need a list of all installed modules on my machine Our purpose is to communicate with neo4j from Python. OK, we know what are the queries that are needed to create both node and relationship. > is used to tell that the relationship begins from a to b. The query matches a couple of nodes based on name attribute, if found, it creates a directional relationship with the label USED_BY. I used this initially but I wanted to make sure that all nodes are unique and do not create if exists so I used this query thenĬreating a relationship between nodes is not difficult either. Here a node was created of type Module with the attribute name in it. In order to create a node of a certain type you will be executing the following command: Let’s discuss a few Cypher queries Creating a node Neo4j uses Cypher Query Language for different operations. In order to run it, execute the following command:ĭocker run -publish=7474:7474 -publish=7687:7687 -volume=$HOME/neo4j/data:/data neo4jĪnd you will see something like the below:Īnd when you visit d it shows something like the below: Start Docker and execute the command docker pull neo4j to pull the Neo4j docker image. Let’s move forward and set up our development environment. You can read further about it over the web. This is not the case in graph databases since information is added in the form of attributes.
In my case, the same thing could be done in RDBMS too but it goes more efficient too in Graph Database since all the required info is available at the node level and all is just needed to fetch relationships between nodes.
If your project does not require too much relationship then Graph Database is useless. Often times you do not need a relationship and data is stored as a single entity.
That tweet got stuck in my mind and I thought it a great excuse to explore Neo4j. Guido, the Python creator had responded to that tweet. The other day I found a tweet( which unfortunately I forgot to bookmark and can’t find it anymore) about visualizing python modules in Neo4J.
#Arangodb visualization series#
I am taking a short break from the Blockchain Programming series and writing this post because I found it pretty interesting.