Your SlideShare is downloading. ×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

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

1,979
views

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 …

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

0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,979
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
33
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Innovate. Share. Connect.Chicago June 12-13DIY Graph SearchMax De Marzi, Neo TechnologyTuesday, June 18, 13
  • 2. Can I Haz?Tuesday, June 18, 13
  • 3. NopeTuesday, June 18, 13
  • 4. #9,998,383,750,000Tuesday, June 18, 13
  • 5. Can I makemy own?Tuesday, June 18, 13
  • 6. MaybeTuesday, June 18, 13
  • 7. What do Iknow aboutNLP?Tuesday, June 18, 13
  • 8. NothingTuesday, June 18, 13
  • 9. What do Iknow?Tuesday, June 18, 13
  • 10. Tuesday, June 18, 13
  • 11. andTuesday, June 18, 13
  • 12. CypherTuesday, June 18, 13
  • 13. I can querya graphTuesday, June 18, 13
  • 14. How?Tuesday, June 18, 13
  • 15. Matching PatternsTuesday, June 18, 13
  • 16. ASCII ArtTuesday, June 18, 13
  • 17. () --> ()ASCII ArtTuesday, June 18, 13
  • 18. Named NodesTuesday, June 18, 13
  • 19. (A) --> (B)Named NodesTuesday, June 18, 13
  • 20. LOVESTyped RelationshipsTuesday, June 18, 13
  • 21. A -[:LOVES]-> BLOVESTyped RelationshipsTuesday, June 18, 13
  • 22. Describing a PathTuesday, June 18, 13
  • 23. A --> B --> CDescribing a PathTuesday, June 18, 13
  • 24. AB CMultiple PathsTuesday, June 18, 13
  • 25. A --> B --> C, A --> CAB CMultiple PathsTuesday, June 18, 13
  • 26. A --> B --> C, A --> CAB CA --> B --> C <-- AMultiple PathsTuesday, June 18, 13
  • 27. The START ClauseTuesday, June 18, 13
  • 28. The START ClauseSTART me=node(1)RETURN meTuesday, June 18, 13
  • 29. with an IndexTuesday, June 18, 13
  • 30. with an IndexSTART me=node:Users(name=‘Max’)RETURN meTuesday, June 18, 13
  • 31. The MATCH ClauseTuesday, June 18, 13
  • 32. The MATCH ClauseSTART me=node:Users(name=‘Max’)MATCH me -[:friends]-> peopleRETURN peopleTuesday, June 18, 13
  • 33. My friends who like cheeseTuesday, June 18, 13
  • 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. My friends who like cheeseTuesday, June 18, 13
  • 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. My friends who like ?Tuesday, June 18, 13
  • 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. My friends who like ? and ?Tuesday, June 18, 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]-> thing2RETURN peopleParams :{“me”: 1, “thing1”: “name: cheese”,“thing2”: “name: wine”}Tuesday, June 18, 13
  • 41. People who like ? and ?Tuesday, June 18, 13
  • 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. I need to build aCypher QueryTuesday, June 18, 13
  • 44. SEMR✦ Gateway drug to NLP✦ 4 years old✦ Didn’t work on my Mac✦ Pointed me to TreetopTuesday, June 18, 13
  • 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. Friends RuleTuesday, June 18, 13
  • 47. Friends Rulerule friends“friends” <Friends>endTuesday, June 18, 13
  • 48. friends to_cypherTuesday, June 18, 13
  • 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. Likes RuleTuesday, June 18, 13
  • 51. Likes Rulerule likes"who like" <Likes>endTuesday, June 18, 13
  • 52. likes to_cypherTuesday, June 18, 13
  • 53. likes to_cypherclass Likes < Treetop::Runtime::SyntaxNodedef to_cypherreturn {:match => "people -[:likes]-> thing"}endendTuesday, June 18, 13
  • 54. Thing RuleTuesday, June 18, 13
  • 55. Thing Rulerule thing[a-zA-Z0-9]+ <Thing>endTuesday, June 18, 13
  • 56. thing to_cypherTuesday, June 18, 13
  • 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. 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