Your SlideShare is downloading. ×
0
Innovate. Share. Connect.Chicago June 12-13DIY Graph SearchMax De Marzi, Neo TechnologyTuesday, June 18, 13
Can I Haz?Tuesday, June 18, 13
NopeTuesday, June 18, 13
#9,998,383,750,000Tuesday, June 18, 13
Can I makemy own?Tuesday, June 18, 13
MaybeTuesday, June 18, 13
What do Iknow aboutNLP?Tuesday, June 18, 13
NothingTuesday, June 18, 13
What do Iknow?Tuesday, June 18, 13
Tuesday, June 18, 13
andTuesday, June 18, 13
CypherTuesday, June 18, 13
I can querya graphTuesday, June 18, 13
How?Tuesday, June 18, 13
Matching PatternsTuesday, June 18, 13
ASCII ArtTuesday, June 18, 13
() --> ()ASCII ArtTuesday, June 18, 13
Named NodesTuesday, June 18, 13
(A) --> (B)Named NodesTuesday, June 18, 13
LOVESTyped RelationshipsTuesday, June 18, 13
A -[:LOVES]-> BLOVESTyped RelationshipsTuesday, June 18, 13
Describing a PathTuesday, June 18, 13
A --> B --> CDescribing a PathTuesday, June 18, 13
AB CMultiple PathsTuesday, June 18, 13
A --> B --> C, A --> CAB CMultiple PathsTuesday, June 18, 13
A --> B --> C, A --> CAB CA --> B --> C <-- AMultiple PathsTuesday, June 18, 13
The START ClauseTuesday, June 18, 13
The START ClauseSTART me=node(1)RETURN meTuesday, June 18, 13
with an IndexTuesday, June 18, 13
with an IndexSTART me=node:Users(name=‘Max’)RETURN meTuesday, June 18, 13
The MATCH ClauseTuesday, June 18, 13
The MATCH ClauseSTART me=node:Users(name=‘Max’)MATCH me -[:friends]-> peopleRETURN peopleTuesday, June 18, 13
My friends who like cheeseTuesday, June 18, 13
My friends who like cheeseSTART me=node:Users(name=‘Max’)thing=node:Things(name=‘Cheese’)MATCH me -[:friends]-> people -[:...
My friends who like cheeseTuesday, June 18, 13
My friends who like cheeseSTART me=node:Users(name=‘Max’)thing=node:Things(name=‘Cheese’)MATCH me -[:friends]-> people,peo...
My friends who like ?Tuesday, June 18, 13
My friends who like ?START me=node({me}),thing=node:Things({thing})MATCH me -[:friends]-> people,people -[:like]-> thingRE...
My friends who like ? and ?Tuesday, June 18, 13
My friends who like ? and ?START me=node({me}),thing1=node:Things({thing1}),thing2=node:Things({thing2})MATCH me -[:friend...
People who like ? and ?Tuesday, June 18, 13
People who like ? and ?START thing1=node:Things({thing1}),thing2=node:Things({thing2})MATCH people -[:like]-> thing1,peopl...
I need to build aCypher QueryTuesday, June 18, 13
SEMR✦ Gateway drug to NLP✦ 4 years old✦ Didn’t work on my Mac✦ Pointed me to TreetopTuesday, June 18, 13
Treetop✦ Create a Grammar bymaking some Rules✦ Turn expression intoSyntax Tree✦ Build custom Syntax Nodes✦ Prune the tree✦...
Friends RuleTuesday, June 18, 13
Friends Rulerule friends“friends” <Friends>endTuesday, June 18, 13
friends to_cypherTuesday, June 18, 13
friends to_cypherclass Friends < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:start => "me = node({me})",:match => "m...
Likes RuleTuesday, June 18, 13
Likes Rulerule likes"who like" <Likes>endTuesday, June 18, 13
likes to_cypherTuesday, June 18, 13
likes to_cypherclass Likes < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:match => "people -[:likes]-> thing"}endendT...
Thing RuleTuesday, June 18, 13
Thing Rulerule thing[a-zA-Z0-9]+ <Thing>endTuesday, June 18, 13
thing to_cypherTuesday, June 18, 13
thing to_cypherclass Thing < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:start => "thing = node:things({thing})",:pa...
Show and Tellhttps://github.com/maxdemarzi/neo_graph_searchhttp://maxdemarzi.com/2013/01/28/facebook-graph-search-with-cyp...
Upcoming SlideShare
Loading in...5
×

DIY Graph Search - Max De Marzi @ GraphConnect Boston + Chicago 2013

2,059

Published on

Facebook Graph Search has given the Graph Database community a simpler way to explain what it is we do and why it matters. I wanted to drive the point home by building a proof of concept of how you could do this with Neo4j.

Published in: Technology

Transcript of "DIY Graph Search - Max De Marzi @ GraphConnect Boston + Chicago 2013"

  1. 1. Innovate. Share. Connect.Chicago June 12-13DIY Graph SearchMax De Marzi, Neo TechnologyTuesday, June 18, 13
  2. 2. Can I Haz?Tuesday, June 18, 13
  3. 3. NopeTuesday, June 18, 13
  4. 4. #9,998,383,750,000Tuesday, June 18, 13
  5. 5. Can I makemy own?Tuesday, June 18, 13
  6. 6. MaybeTuesday, June 18, 13
  7. 7. What do Iknow aboutNLP?Tuesday, June 18, 13
  8. 8. NothingTuesday, June 18, 13
  9. 9. What do Iknow?Tuesday, June 18, 13
  10. 10. Tuesday, June 18, 13
  11. 11. andTuesday, June 18, 13
  12. 12. CypherTuesday, June 18, 13
  13. 13. I can querya graphTuesday, June 18, 13
  14. 14. How?Tuesday, June 18, 13
  15. 15. Matching PatternsTuesday, June 18, 13
  16. 16. ASCII ArtTuesday, June 18, 13
  17. 17. () --> ()ASCII ArtTuesday, June 18, 13
  18. 18. Named NodesTuesday, June 18, 13
  19. 19. (A) --> (B)Named NodesTuesday, June 18, 13
  20. 20. LOVESTyped RelationshipsTuesday, June 18, 13
  21. 21. A -[:LOVES]-> BLOVESTyped RelationshipsTuesday, June 18, 13
  22. 22. Describing a PathTuesday, June 18, 13
  23. 23. A --> B --> CDescribing a PathTuesday, June 18, 13
  24. 24. AB CMultiple PathsTuesday, June 18, 13
  25. 25. A --> B --> C, A --> CAB CMultiple PathsTuesday, June 18, 13
  26. 26. A --> B --> C, A --> CAB CA --> B --> C <-- AMultiple PathsTuesday, June 18, 13
  27. 27. The START ClauseTuesday, June 18, 13
  28. 28. The START ClauseSTART me=node(1)RETURN meTuesday, June 18, 13
  29. 29. with an IndexTuesday, June 18, 13
  30. 30. with an IndexSTART me=node:Users(name=‘Max’)RETURN meTuesday, June 18, 13
  31. 31. The MATCH ClauseTuesday, June 18, 13
  32. 32. The MATCH ClauseSTART me=node:Users(name=‘Max’)MATCH me -[:friends]-> peopleRETURN peopleTuesday, June 18, 13
  33. 33. My friends who like cheeseTuesday, June 18, 13
  34. 34. My friends who like cheeseSTART me=node:Users(name=‘Max’)thing=node:Things(name=‘Cheese’)MATCH me -[:friends]-> people -[:like]-> thingRETURN peopleTuesday, June 18, 13
  35. 35. My friends who like cheeseTuesday, June 18, 13
  36. 36. My friends who like cheeseSTART me=node:Users(name=‘Max’)thing=node:Things(name=‘Cheese’)MATCH me -[:friends]-> people,people -[:like]-> thingRETURN peopleTuesday, June 18, 13
  37. 37. My friends who like ?Tuesday, June 18, 13
  38. 38. My friends who like ?START me=node({me}),thing=node:Things({thing})MATCH me -[:friends]-> people,people -[:like]-> thingRETURN peopleParams :{“me”: 1, “thing”: “name: cheese”}Tuesday, June 18, 13
  39. 39. My friends who like ? and ?Tuesday, June 18, 13
  40. 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]-> thing2RETURN peopleParams :{“me”: 1, “thing1”: “name: cheese”,“thing2”: “name: wine”}Tuesday, June 18, 13
  41. 41. People who like ? and ?Tuesday, June 18, 13
  42. 42. People who like ? and ?START thing1=node:Things({thing1}),thing2=node:Things({thing2})MATCH people -[:like]-> thing1,people -[:like]-> thing2RETURN peopleParams :{“thing1”: “name: cheese”,“thing2”: “name: wine”}Tuesday, June 18, 13
  43. 43. I need to build aCypher QueryTuesday, June 18, 13
  44. 44. SEMR✦ Gateway drug to NLP✦ 4 years old✦ Didn’t work on my Mac✦ Pointed me to TreetopTuesday, June 18, 13
  45. 45. Treetop✦ Create a Grammar bymaking some Rules✦ Turn expression intoSyntax Tree✦ Build custom Syntax Nodes✦ Prune the tree✦ to_cypherTuesday, June 18, 13
  46. 46. Friends RuleTuesday, June 18, 13
  47. 47. Friends Rulerule friends“friends” <Friends>endTuesday, June 18, 13
  48. 48. friends to_cypherTuesday, June 18, 13
  49. 49. friends to_cypherclass Friends < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:start => "me = node({me})",:match => "me -[:friends]-> people",:return => "people",:params => {"me" => nil }}endendTuesday, June 18, 13
  50. 50. Likes RuleTuesday, June 18, 13
  51. 51. Likes Rulerule likes"who like" <Likes>endTuesday, June 18, 13
  52. 52. likes to_cypherTuesday, June 18, 13
  53. 53. likes to_cypherclass Likes < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:match => "people -[:likes]-> thing"}endendTuesday, June 18, 13
  54. 54. Thing RuleTuesday, June 18, 13
  55. 55. Thing Rulerule thing[a-zA-Z0-9]+ <Thing>endTuesday, June 18, 13
  56. 56. thing to_cypherTuesday, June 18, 13
  57. 57. thing to_cypherclass Thing < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:start => "thing = node:things({thing})",:params => {"thing" => "name: " + self.text_value } }endendTuesday, June 18, 13
  58. 58. Show and Tellhttps://github.com/maxdemarzi/neo_graph_searchhttp://maxdemarzi.com/2013/01/28/facebook-graph-search-with-cypher-and-neo4j/Tuesday, June 18, 13
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×