How to build your own Facebook Graph Search with Cypher and Neo4j.
Demo:
neographsearch.herokuapp.com
Blog post:
http://maxdemarzi.com/2013/01/28/facebook-graph-search-with-cypher-and-neo4j/
Github:
https://github.com/maxdemarzi/neo_graph_search
34. My friends who like cheese
START me=node:Users(name=‘Max’)
thing=node:Things(name=‘Cheese’)
MATCH me -[:friends]-> people -[:like]-> thing
RETURN people
Monday, April 29, 13
36. My friends who like cheese
START me=node:Users(name=‘Max’)
thing=node:Things(name=‘Cheese’)
MATCH me -[:friends]-> people,
people -[:like]-> thing
RETURN people
Monday, April 29, 13
38. My friends who like ?
START me=node({me}),
thing=node:Things({thing})
MATCH me -[:friends]-> people,
people -[:like]-> thing
RETURN people
Params :{“me”: 1, “thing”: “name: cheese”}
Monday, April 29, 13
40. My friends who like ? and ?
START me=node({me}),
thing1=node:Things({thing1}),
thing2=node:Things({thing2})
MATCH me -[:friends]-> people,
people -[:like]-> thing1,
people -[:like]-> thing2
RETURN people
Params :{“me”: 1, “thing1”: “name: cheese”,
“thing2”: “name: wine”}
Monday, April 29, 13
41. I need to build a
Cypher Query
Monday, April 29, 13
42. SEMR
✦ Gateway drug to NLP
✦ 4 years old
✦ Didn’t work on my Mac
✦ Pointed me to Treetop
Monday, April 29, 13
43. Treetop
✦ Create a Grammar by
making some Rules
✦ Turn expression into
Syntax Tree
✦ Build custom Syntax Nodes
✦ Prune the tree
✦ to_cypher
Monday, April 29, 13