Graph data modeling
To build a data model, you can use the Arrows.app site (https://arrows.app). The following screenshot shows an example diagram:
Figure 3.1 – Graph data model
This can be thought of as a data diagram where a set of data is drawn as a graph. It is possible to directly load the data into Neo4j with an assumed data model by skipping this part, but this approach can facilitate larger team collaboration and arrive at a better graph model. One of the aspects of this approach is to represent part of the data as a graph diagram and see how the graph traversal would work to answer our questions.
Say we have a set of questions; we can try to trace the model to see whether we can answer them:
- How many addresses are OWNED by a person?
- Find the person, traverse the
OWNS
relationship, and count the addresses
- Find the person, traverse the
- At which address is a person living?
- Find the person and traverse the
LIVES_AT
relationship to find the required address
- Find the person and traverse the
- How...