
Business Intelligence as a Service
Try PlusClouds Eaglet service and find high quality B2B hot leads and opportunites with AI support.
Neo4j is a graph database that has the capability to store and process large and relational data, does not require much difficulty in usage (even has a query language they call similar to sql called cypher ) and is ranked high in the DB-Engines ranking. According to their own words, we can define it as "The Fastest Path to Graph" . After finding the answer to the question What is Neo4j?, there are a few important terms we use while determining our structure, let's go through them.
Before using the Neo4j database, let's answer the questions what are nodes and what are labels .
Each record is a node for us. These are our main records, and we can add features we call "Properties" such as id, name, title into these records. While using these, we can utilize the label feature to keep everything more organized.
Labels, or tags, are the names we give to these groups of nodes. The information such as 'Person', 'Company', etc. that we can specify as a group will be tags representing separate nodes.
While creating a node without a label
Create (n)
we can create a node with a label as
Create (n:Person)
We can also create this node particularly together
Create (n:Person {id:1, companies: [1,2,3], name: 'Burak'})
Thus, I created a few bulk records below as I will use Person and Company information in our example.
Here, 5 records belonging to the Person label and 4 nodes in the Company label were created.Create (q:Person {id:1, companies: |1,2,3|, name: 'Burak'}),(w:Person {id:2, companies: [1], name: 'Uzay'}),(e:Person {id:3, companies: [2], name: 'Yaprak'}),(r:Person {id:4, companies: [3], name: 'Ali'}),(t:Person {id:5, companies: [2,4], name: 'Veli'}),(y:Company {id:1, name: 'X Company'}),(u:Company {id:2, name: 'Y Company'}),(o:Company {id:3, name: 'Z Company'}),(p:Company {id:4, name: 'Q Company'})
Our Person nodes were formed as follows;
Our Company nodes are as follows;
A node can have multiple labels or none at all. These do not hold any extra features as they only perform grouping actions. All properties can be held by node information.
Neo4j 's most important feature is the relationships we call relationships. Depending on the query we write here, it can yield amazing results quickly while establishing relationships between levels 1-1 as well as levels 2, 3, and above.
Going from the example above, it is seen that each person is connected with one or more companies. Here, we can create the relationship we will call PersonCompany by combining it with the where clause in sql logic, as follows.
Match (a:Person), (b:Company)where (b.id IN a.companies)create (a) - [r:PersonCompany {name:a.name+'<->'+b.name}] -> (b)
return type(r), a,b
At a basic level, we have made an introduction to what a Neo4j database is and what gains it provides during use. It is up to you to develop and use these according to your needs.
Good luck!
If you are a journalist, who has desire to dig deep in topics related to businesses and sectors, we want to work with you!
With the AutoQuill tool that PlusClouds has started to offer to its affiliate partners, content creators will be able to sell with a single click. Let us show you how you can get your share of this revolution.