We will try to clarify the Concepts of Graph Database in context of neo4j – a graph database in our posts one-by-one.
So below is our first post which describes the quick start up concepts of Graph Database.
A graph consists of information in Nodes which are interconnected. A Graph can consists of a single node also.
A particular node can have multiple properties in it as key-value pair. Also the nodes are connected in multiple ways,
which we can describe as relationship.
A School information is a single node.
Students and Teachers are different nodes which are connected through relationship.
Students(Nodes) study(Relationship) in School(Node).
Teachers(Nodes) teach(Relationship) in School(Node).
School has name, address, year of stablishment, accreditation etc. which can be described as Properties.
Student has name, address, year of join, class etc. which can be described as Properties.
Teacher has name, address, year of join, highest qualification etc. which can be described as Properties.
Nodes are every single set of entity information in a Graph.
If we consider a school information system as a Graph,
School itself is a node in the School Graph.
Each Student is node in the School Graph.
Also, each Teacher is node in the School Graph.
Nodes are joined by some information – which are relationship in graph.
Students study in School.
Teachers teach in School.
Here study and teach are the relationship information between nodes in a School Graph.
Labels – When nodes form a group in a graph and are identified by some information, then that information will be called label.
In a school graph,
we can classify
(All Students) label for all the students in the school graph.
(5th Class Students), (6th Class Students) label can be given for respective students.
Here (All Students), (5th Class Students), (6th Class Students) can be called as sub graphs.
Node Traversal -
When we look for some specific information in a graph of all the Nodes, we process the information udentsin some specific pre-determined optimum way
and this is called Graph Traversal.
In a school graph, to have a information like “Name of the teachers who teaches the 5th Class students”,
We can traverse by
In (Paricular SChool) –>> study by –>> (5th Class Students) –>> Teached by –>> (Teachers)
Note : Above is a traversal information, which ma y be used for understanding traversal in a Graph.
When we want for a specific set of information of nodes or relationship, we put all those information in specific maps, which will be called as index.
In a school graph-
We can have specific set of nodes for
(Science Subject Teachers), (Art Subject Teachers) etc. which we can put in indexes.
In next part of our posts related to Graph Database,
we will describe a Case Study where we can use a Graph Database.
We will describe the schema and information we can obtain from Graph Database through Cypher Query in context of neo4j.
The diagrammatic representation of the Graph Database is here.
Most of the queries with Neo4j Cypher Language for the Diagram are explained in this post.
So keep visiting here. Comments are welcome.
Sign Up to read the rest of the content
Email will be used only for updates of our site