0
Intro to Neo4j
by Nicole White
Data Scientist at Neo4j
@_nicolemargaret
Agenda
What is a
Graph?
What is
Neo4j?
Data
Modeling
Cypher
Query
Language
Neo4j
Browser
Demo
Next Steps
What is a Graph?
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
...
This is a Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
Node
Rel...
Twitter Social Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
Internet Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
What is Neo4j?
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
language:’Swedish’
open_...
Neo4j
Recommendations
eHarmony
Glassdoor
Logistics
eBay
shutl
Content
Management
OneFineStay
Lufthansa
Customers
neo4j.com...
Data Modeling
A Journey from SQL to Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next St...
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...
Example: YouTube in a Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next St...
Cypher Query Language
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
name:’Alice’
name:’Bob’
...
Uniqueness Constraints
CREATE CONSTRAINT ON (u:User) ASSERT u.name IS UNIQUE;
CREATE CONSTRAINT ON (c:Channel) ASSERT c.na...
Download the Cypher Refcard
bit.ly/cypher-refcard
Neo4j Browser Demo
Next Steps
Download Neo4j
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
neo4j.com
Choose a Driver
neo4j.com/contrib
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo N...
Join the Community
bit.ly/neo4j-google
@neo4j
#neo4j
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
N...
Come to the RNeo4j Meetup
• Tuesday, September 9th, 2014
• 6:00-7:30PM
• In this room
• bit.ly/graphs-r-cool
What is a Gra...
October 22, 2014
SF Jazz
Innovate. Share. Connect.
Register @ graphconnect.com
Discount for Meetup attendees:
SFLOCAL200
Upcoming SlideShare
Loading in...5
×

Intro to Neo4j - Nicole White

1,784

Published on

An introduction to graph databases and Neo4j.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

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

No notes for slide
  • How is User A connected to User B?
    Who is the most influential or central in this social network?
  • How many ways can I get from Webpage A to Webpage B?
    What is the shortest path, the longest?
    Which pages would I pass through on my way from A to B?
  • Filter on node label – users.
  • Filter on node label – channels.
  • Filter on node label and property.
  • Relationships.
  • Filter on relationships types – operates.
  • Path identifier – more succinct.
  • Longer paths.
  • Returning entity properties.
  • Aggregate function.
  • Order by.
  • shortestPath
  • Transcript of "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
    1. A particular slide catching your eye?

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

    ×