Databases Reference
In-Depth Information
This first modeling attempt results in a star-shaped graph. Bob is represented by a central
node; his actions of emailing, copying, and blind-copying are represented by relationā
ships that extend from Bob to the nodes representing the recipients of his mail. As we
see in
Figure 3-8
, however, the most critical element of the data, the actual
email
, is
missing.
Figure 3-8. Missing email node leads to lost information
That such a structure is lossy becomes evident when we pose the following query:
START
bob=
node
:user(username=
'Bob'
),
charlie=
node
:user(username=
'Charlie'
)
MATCH
(bob)-[e:EMAILED]->(charlie)
RETURN
e
This query returns the
EMAILED
relationships between Bob and Charlie (there will be
one for each email that Bob has sent to Charlie). This tells us that emails have been
exchanged, but it tells us nothing about the emails themselves:
+----------------+
| e |
+----------------+
| :EMAILED[1] {} |
+----------------+
1 row