Database Reference
In-Depth Information
• Marriage is the relationship between John and Mary.
• Age of
John
, age of
Mary
, and the year of their marriage become the properties.
•
Male
and
Female
become the labels.
Easy, simple, flexible, and natural… isn't it?
The data structure in Neo4j is adaptive and effectively can model everything that is not
fixed and evolves over a period of time.
The next step in data modeling is fetching the data from the data model, which is done
through traversals. Traversals are another important aspect of graphs, where you need to
follow paths within the graph starting from a given node and then following its relation-
ships with other nodes. Neo4j provides two kinds of traversals: breadth first available at
http://en.wikipedia.org/wiki/Breadth-first_search
and depth first available at
ht-
tp://en.wikipedia.org/wiki/Depth-first_search
.
We will discuss traversals in detail in
If you are from the RDBMS world, then you must now be wondering, "What about the
schema?" and you will be surprised to know that Neo4j is a schemaless or schema-option-
al graph database. We do not have to define the schema unless we are at a stage where we
want to provide some structure to our data for performance gains. Once performance be-