Database Reference
In-Depth Information
This graph data model gives us four different fundamental building blocks to
structure and store our data. Let's go through them:
The labeled property graph model
•
Nodes
: These are typically used to store entity information. In the preceding
example, these are the individual books, readers, and authors that are present
in the library data model.
•
Relationships
: These are used to connect nodes to one another explicitly
and therefore provide a means of structuring your entities. They are the
equivalent of an explicitly stored, and therefore pre-calculated, join-like
operation in a relational database management system. As we have seen
in the previous chapters, joins are no longer a query-time operation—they
are as simple as the traversal of a relationship connecting two nodes.
Relationships always have a type, a start-
and
an end-node, and a direction.
Theycanbeself-referencing/loopingandcanneverbedangling(missing
start- or end-node).
•
Properties
: Both nodes and relationships are containers for properties,
whichareeffectivelyname/valuepairs.Inthecaseofthenodes,thisis
very intuitive. Just like a record in the relational database world has one or
moreieldsorattributes,socanthenodehaveoneormoreproperties.Less
intuitive is the fact that relationships can have properties too. These are used
to further qualify the strength or quality of a relationship and can be used
duringqueries/traversalstoevaluatethepatternsthatwearelookingfor.