Database Reference
In-Depth Information
ferent moments in time, and use the lineup_of relationship to link these states to the
central node, indicating that they are different states of the same thing. Likewise, the iden-
tities of the various musicians who have played in The Tax Evaders remain the same, even
though their relationship to the band (and possibly other bands) will change over time.
This example demonstrates a use of reification —representing a relationship between entit-
ies, such as musicians and a band, as a node in its own right. The concept of a lineup as a
thing representing the composition of a band at a particular moment in time turns out to be
indispensable in the fast-moving world of rock and roll; reification is equally useful in less
glamorous contexts, such as modeling the relationships between people and the addresses
they live at, or software licenses and the computers they're activated on.
2.4. Summary
In this chapter you've seen how flexible data modeling for Neo4j can be, and how there
maybeseveralpossiblerepresentationsofthesamedomain.It'seasytostartmodelingwith
just pencil and paper, but you should be prepared to try putting the same data in different
places—as properties on nodes, or on relationships, or pulled out into a node of its own.
We've considered some strategies for modeling data in a way that suits particular patterns
of querying, choosing which data is to be explicitly represented by nodes and what can be
left implicit and later inferred from queryable patterns within the data. We've also looked
at data that changes over time and seen one pattern for modeling a mixture of variable and
invariant data.
Theexamplesyou'veseeninthischaptershowthediversityofapplicationstowhichgraph
data modeling is suited. In the next chapter, you'll see how to traverse your model in order
to retrieve data efficiently and powerfully.
Search WWH ::




Custom Search