Graphs, GraphDBs and JavaScript

Graphs, GraphDBs and JavaScript

A look at graphs, graph databases, and JavaScript

E2e942d05d5ea93ad2eddd3394ffcd96?s=128

Carlos Justiniano

February 22, 2017
Tweet

Transcript

  1. Graphs, GraphDB’s and JavaScript

  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. ? ? ?

  12. None
  13. None
  14. Graphs revealed

  15. None
  16. None
  17. ? Start

  18. ? Start

  19. None
  20. None
  21. Graphs are everywhere

  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. None
  37. Graph Databases

  38. None
  39. None
  40. None
  41. Lots of Graph Databases to choose from…

  42. None
  43. None
  44. None
  45. None
  46. $ docker pull neo4j:3.1.0 $ docker run -d -p 7474:7474

    -p 7687:7687 
 -v ~/data:/data --name neo4j neo4j:3.1.0
  47. None
  48. (NODE) [RELATIONSHIP] (NODE) (Person)-[:KNOWS {since: "20120225"}]-(Person)

  49. (NODE) [RELATIONSHIP] (NODE) (Person)-[:KNOWS {since: "20120225"}]-(Person)

  50. (NODE) [RELATIONSHIP] (NODE) (Person)-[:KNOWS {since: "20120225"}]-(Person)

  51. (NODE) [RELATIONSHIP] (NODE) (Person)-[:KNOWS {since: "20120225"}]-(Person)

  52. MATCH (p:Person {name: "Alex"}) RETURN p;

  53. MATCH (p:Person {name: "Alex"}) RETURN p;

  54. MATCH (p:Person {name: "Alex"}) RETURN p;

  55. MATCH (p:Person {name: "Alex"}) RETURN p;

  56. MATCH (p:Person {name: "Alex"}) RETURN p;

  57. MATCH (p:Person) RETURN p;

  58. None
  59. MATCH (p1:Person {name: "Alex"}) -[r:Knows]- (p2:Person {name: "Susan"}) RETURN p1,

    r, p2;
  60. MATCH (p1:Person {name: "Alex"}) -[r:Knows]- (p2:Person {name: "Susan"}) RETURN p1,

    r, p2;
  61. MATCH (p1:Person {name: "Alex"}) -[r:Knows]- (p2:Person) RETURN p1, r, p2;

  62. None
  63. MATCH (p1:Person)-[]-(p2:Person) RETURN p1, p2;

  64. None
  65. MATCH (p1:Person {name: "Susan"}) -[r:Knows*2]- (p2:Person {interest: "business"}) RETURN p1,

    r, p2;
  66. MATCH (p1:Person {name: "Susan"}) -[r:Knows*2]- (p2:Person {interest: "business"}) RETURN p1,

    r, p2;
  67. MATCH (p1:Person {name: "Susan"}) -[r:Knows*2]- (p2:Person {interest: "business"}) RETURN p1,

    r, p2;
  68. MATCH (p1:Person {name: "Susan"}) -[r:Knows*2]- (p2:Person {interest: "business"}) RETURN p1,

    r, p2;
  69. MATCH (p1:Person {name: "Susan"}) -[r:Knows*2]- (p2:Person {interest: "business"}) RETURN p1,

    r, p2;
  70. None
  71. None
  72. Accessing Neo from JavaScript

  73. $ mkdir neo-test; cd neo-test $ npm init -y $

    npm install neo4j-driver
  74. Sample code

  75. TrumpWorld

  76. None
  77. None
  78. None
  79. Trump World Visiting Trump World

  80. None
  81. None
  82. None
  83. None
  84. None
  85. Recap • We began our journey by learning about network

    graphs • We discovered that graphs are everywhere
  86. Recap • We also learned that we actually think in

    terms of graphs • We learned that graph databases are a natural extension for representing our data models and their relationships • Finally, we saw the power of using graph databases to better understand current events
  87. Next Steps • If you enjoyed this presentation say thanks

    by staring the github repo. https://github.com/cjus/node-neo4j-presentation • Visit the Neo4j website: https://neo4j.com/ • Download their free book: https://neo4j.com/graph-databases-book • Enroll in a free online training course: https://neo4j.com/ graphacademy/online-training/introduction-graph-databases
  88. Books • Graph Databases by Ian Robison, Jim Webber &

    Emil Eifrem • Learning Neo4j by Rik Bruggen • Linked: The New Science Of Networks Science Of Networks by Albert-laszlo Barabasi • The Tipping Point: How Little Things Can Make a Big Difference by Malcolm Gladwell • Six Degrees: The Science of a Connected Age by Duncan J. Watts There a lots of books on Graphs and Graph Databases. 
 Here are just the ones I've read.
  89. Photos / diagrams created by the author or licensed from

    iStockPhoto
 Trump caricature by Denys Almaral @cjus - github / twitter http://cjus.me