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. This is a Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
Node
Relationship
6. Twitter Social Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
7. Internet Graph
What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
9. What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
10. What is a Graph? What is Neo4j? Data Modeling
Cypher Query
Language
Neo4j Browser Demo Next Steps
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
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. 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. 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
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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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;
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. October 22, 2014
SF Jazz
Innovate. Share. Connect.
Register @ graphconnect.com
Discount for Meetup attendees:
SFLOCAL200
Hinweis der Redaktion
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?