Database Reference
In-Depth Information
2.2. Domain modeling
In the model discussed in the previous section, the nodes carried very little extra informa-
tion about themselves, besides their identifying names. It was intuitively clear how the do-
main entities— User s, Group s, Role s, and Permission s—should be represented by
nodes in the graph. But not everything has to be a node; for example, there weren't any
nodes for users' names, which were instead modeled as properties on User nodes.
Properties are an important part of Neo4j's data model, and they're also an important way
in which it differs from the RDBMS model. In Neo4j, both nodes and relationships can
have any number of properties, which are essentially key/value pairs (for example, name/
“Irene”).Theyarenormallyusedtostorethespecificpropertiesofnodesandrelationships.
Let's consider a scenario where the distinction between an entity (modeled with a node)
and a property of an entity is less intuitively obvious.
2.2.1. Entities and properties
Sometimes whenpeoplefirstbeginmodelingwithNeo4j,theycomeupwithdiagramsthat
look a bit like figure 2.7 .
Search WWH ::




Custom Search