Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Intro to Neo4j - Nicole White

3,285 views

Published on

An introduction to graph databases and Neo4j.

Published in: Technology
  • Be the first to comment

Intro to Neo4j - Nicole White

  1. 1. Intro to Neo4j by Nicole White Data Scientist at Neo4j @_nicolemargaret
  2. 2. Agenda What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  3. 3. What is a Graph?
  4. 4. Are These Graphs? 0 1 2 3 4 5 6 Category 1 Category 2 Category 3 Category 4 Series 1 Series 2 Series 3 0 2 4 6 8 10 12 14 Category 1 Category 2 Category 3 Category 4 Series 1 Series 2 Series 3 What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  5. 5. This is a Graph What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps Node Relationship
  6. 6. Twitter Social Graph What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  7. 7. Internet Graph What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  8. 8. What is Neo4j?
  9. 9. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  10. 10. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  11. 11. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps language:’Swedish’ open_source:true year:2007 The Property Graph
  12. 12. Neo4j Recommendations eHarmony Glassdoor Logistics eBay shutl Content Management OneFineStay Lufthansa Customers neo4j.com/customers What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  13. 13. Data Modeling
  14. 14. A Journey from SQL to Graph What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  15. 15. Example: YouTube in SQL ID Name 1 Alice 2 Bob 3 Charles 4 David What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps ID Name 1 Bob’s Gaming Channel 2 Bob’s Cute Dog 3 Cooking with Charles 4 David’s How-To Channel 5 Disco Dancing with David User ID Channel ID 2 1 2 2 3 3 4 4 4 5 USERS CHANNELS USERS_CHANNELS User ID Channel ID 1 3 1 4 2 3 2 5 3 1 USERS_SUBSCRIPTIONS
  16. 16. Example: YouTube in a Graph What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED
  17. 17. Cypher Query Language
  18. 18. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (n) RETURN n;
  19. 19. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (u:User) RETURN u;
  20. 20. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (c:Channel) RETURN c;
  21. 21. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (bob:User {name:’Bob’}) RETURN bob;
  22. 22. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (u:User)-[r]->(c:Channel) RETURN u, r, c;
  23. 23. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (u:User)-[r:OPERATES]->(c:Channel) RETURN u, r, c;
  24. 24. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH p=(:User)-[:OPERATES]->(:Channel) RETURN p;
  25. 25. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH p=(:User {name:’Bob’})-[:OPERATES]->(:Channel)<-[:SUBSCRIBED]-(:User) RETURN p;
  26. 26. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (u:User)-[r]->(c:Channel) RETURN u.name, TYPE(r), c.name;
  27. 27. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (:User {name:’Bob’})-[:OPERATES]->(c:Channel) RETURN COUNT(c);
  28. 28. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH (u:User)-[:OPERATES]->(c:Channel) RETURN u.name, COUNT(c) AS channels ORDER BY channels DESC;
  29. 29. What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps name:’Alice’ name:’Bob’ name:’Charles’ name:’David’ name:’Cooking with Charles’ name:’David’s How-To Channel’ name:’Disco Dancing with David’ name:’Bob’s Gaming Channel’ name:’Bob’s Cute Dog’ User Channel SUBSCRIBED MATCH p=(:User {name:'Charles'})-[*1..4]-(:User {name:'David'}) RETURN p LIMIT 1;
  30. 30. Uniqueness Constraints CREATE CONSTRAINT ON (u:User) ASSERT u.name IS UNIQUE; CREATE CONSTRAINT ON (c:Channel) ASSERT c.name IS UNIQUE;
  31. 31. Download the Cypher Refcard bit.ly/cypher-refcard
  32. 32. Neo4j Browser Demo
  33. 33. Next Steps
  34. 34. Download Neo4j What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps neo4j.com
  35. 35. Choose a Driver neo4j.com/contrib What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  36. 36. Join the Community bit.ly/neo4j-google @neo4j #neo4j What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps neo4j.meetup.com
  37. 37. Come to the RNeo4j Meetup • Tuesday, September 9th, 2014 • 6:00-7:30PM • In this room • bit.ly/graphs-r-cool What is a Graph? What is Neo4j? Data Modeling Cypher Query Language Neo4j Browser Demo Next Steps
  38. 38. October 22, 2014 SF Jazz Innovate. Share. Connect. Register @ graphconnect.com Discount for Meetup attendees: SFLOCAL200

×