Databases Reference
In-Depth Information
(email_4)-[:TO]->(davina),
(email_4)-[:TO]->(edward);
CREATE
(email_5 {
id
:
'5'
, content:
'email contents'
}),
(davina)-[:SENT]->(email_5),
(email_5)-[:TO]->(alice),
(email_5)-[:BCC]->(bob),
(email_5)-[:BCC]->(edward);
This leads to the more complex, and interesting, graph we see in
Figure 3-10
.
Figure 3-10. A graph of email interactions
We can now query this graph to identify potentially suspect behavior:
START
bob=
node
:user(username=
'Bob'
)
MATCH
(bob)-[:SENT]->(email)-[:CC]->(alias),
(alias)-[:ALIAS_OF]->(bob)
RETURN
email