Databases Reference
In-Depth Information
we should also be able to reference the original email from the forwarded mail so that
we always have detailed and accurate provenance data. And the same applies if the
forwarded mail is itself forwarded, and so on. For example, if Alice (Bob's alter-ego)
emails Bob to try to establish separate concrete identities, and then Bob (wishing to
perform some subterfuge) forwards that email onto Charlie, who then forwards it onto
Davina, we actually have three emails to consider. Assuming the users (and their aliases)
are already in the database, in Cypher we'd write that audit information into the database
as follows:
CREATE (email_11 { id : '11' , content: 'email' }),
(alice)-[:SENT]->(email_11)-[:TO]->(bob);
CREATE (email_12 { id : '12' , content: 'email' }),
(email_12)-[:FORWARD_OF]->(email_11),
(bob)-[:SENT]->(email_12)-[:TO]->(charlie);
CREATE (email_13 { id : '13' , content: 'email' }),
(email_13)-[:FORWARD_OF]->(email_12),
(charlie)-[:SENT]->(email_13)-[:TO]->(davina);
On completion of these writes, our database will contain the subgraph shown in
Figure 3-13 .
Figure 3-13. Explicitly modeling email forwarding
Using this graph, we can determine the length of an email chain.
 
Search WWH ::




Custom Search