Skip to content

Instantly share code, notes, and snippets.

@mneedham
mneedham / 1_twitter.cypher
Last active February 28, 2017 15:38
Querying the twitter graph
// Sandbox instance
https://10-0-1-157-32898.neo4jsandbox.com/browser/
readonly / twitter
// find tweets that quote each other
MATCH tweets = (t:Tweet)-[:QUOTED*]->(t2:Tweet) WHERE not exists((t2)-[:QUOTED]->())
RETURN tweets;
// find the longest chain
MATCH path = shortestpath((start:Tweet)-[:QUOTED*]->(origin))