8. Ecosystem
Neo4j Professional Services
300+ partners
47,000 group members
61,000 trained engineers
3.5M downloads
Mindset
“Graph Thinking” is all about
considering connections in
data as important as the data
itself.
Native Graph Platform
Neo4j is an internet-scale,
native graph database which
executes connected workloads
faster than any other database
management system.
Neo4j
10. Graph thinking: A modern Swedish family
Icons designed by Freepik www.freepik.com/free-vector/people-icons-collection_1024244.htm
Maria
OscarThomas
Ann
FRIEND OF
MOTHER OFMOTHER OF
FRIEND OF
Cody
EX OF
FATHER OF
11. Graph thinking: A modern Swedish family
Icons designed by Freepik www.freepik.com/free-vector/people-icons-collection_1024244.htm
FRIEND OF
MOTHER OF
FRIEND OF
Thomas
Ann
Cody
EX OFMARRIED TO
Dan
12. Graph thinking: A modern Swedish family
Icons designed by Freepik www.freepik.com/free-vector/people-icons-collection_1024244.htm
Karl Ben
Chris Carrie
Elizabeth
EX OF
FRIEND OF
MOTHER OF
FRIEND OF
Thomas
Ann
Cody
EX OFMARRIED TO
Dan
15. since: Jan 10, 2011
brand: “Volvo”
model: “V70”
D
R
IVES
O
W
NS
Car
LIVES_WITH
LOVES
name:”Dan”
born: May 29, 1970
twitter:”@dan”
name:”Ann”
born: Dec 5, 1975
LOVES
Person Person
The property graph model
16. Cypher: The Graph Query Language
• The “SQL for graphs”: An open language (http://www.opencypher.org/)
• The formal semantics are in the process of being defined: collaboration
with the University of Edinburgh, UK
• Declarative
• Focus on pattern matching
• Intuitive and easy to learn (ASCII-Art)
17. Cypher: The Graph Query Language
CREATE
LABEL PROPERTYLABEL PROPERTY RELATIONSHIP
TYPE
(:Person { name:“Dan”} ) - [:LOVES]-> (:Person { name:“Ann”} )
NODE NODERELATIONSHIP
name:”Dan” name:”Ann”
LOVES
Person Person
MERGE
18. Index-free adjacency
Credit: Dan McCreary
https://medium.com/@dmccreary/how-to-explain-index-free-adjacency-to-your-manager-1a8e68ec664a
Maria’s
house
Ann’s
house
19. Index-free adjacency
Credit: Dan McCreary
https://medium.com/@dmccreary/how-to-explain-index-free-adjacency-to-your-manager-1a8e68ec664a
22. Graph data modeling
• Relational to graph
• Different ways of modelling
• Refactoring
• Inference
• A social recommendation example
23. Relational to Graph
select restaurant.name
from person join review on (...) join restaurant on(…)
where person.name = “Maria”
reviewperson business
Maria
Sushi Lovers
The Burger Joint
Pedro’s Pizza
28. A Social Recommendation
Maria
Ann
Diana
FRIEND OF
FRIEND OF
LIKES
LIKES
iSushi
:Restaurant
New York
:Location
Sushi
:Cuisine
SERVES
SERVES
LOCATED_IN
LOCATED_IN
Sushi Lovers
:Restaurant
Icons designed by Freepik www.freepik.com/free-vector/people-icons-collection_1024244.htm
29. A Social Recommendation
Some icons designed by Freepik
www.freepik.com/free-vector/people-icons-collection_1024244.htm
Maria Ann
Diana
FRIEND OF
FRIEND OF
LIKES
LIKES
iSushi
New York
Sushi
SERVES
SERVES
LOCATED_IN
LOCATED_IN
:Restaurant
:Location
:Cuisine
:Restaurant
Sushi Lovers
30. A Social Recommendation
Some icons designed by Freepik
www.freepik.com/free-vector/people-icons-collection_1024244.htm
Maria Ann
Diana
FRIEND OF
FRIEND OF
LIKES
LIKES
iSushi
New York
Sushi
SERVES
SERVES
LOCATED_IN
LOCATED_IN
:Restaurant
:Location
:Cuisine
:Restaurant
Sushi Lovers
https://neo4j.com/docs/developer-manual/current/cypher/query-tuning/
31. A Social Recommendation
Some icons designed by Freepik
www.freepik.com/free-vector/people-icons-collection_1024244.htm
Maria Ann
Diana
FRIEND OF
FRIEND OF
LIKES
LIKES
iSushi
New York
Sushi
SERVES
SERVES
LOCATED_IN
LOCATED_IN
:Restaurant
:Location
:Cuisine
Sushi Lovers
:Restaurant
39. Import data: LOAD CSV
Cypher-Based LOAD CSV Capability
• Transactional (ACID) writes
• Initial and incremental loads of up to 10 million nodes and relationships
• From HTTP and Files
• Power of Cypher:
• Create and update graph structures
• Data conversion, filtering, aggregation
• De-structuring of input data
• Transaction size control
• Via Neo4j Browser or cypher-shell
• https://neo4j.com/docs/cypher-refcard/current/
46. Use JDBC with your sql database
apoc.load.jdbc
Access any database that provides a JDBC driver
Execute queries whose results are turned into streams of rows
Use the rows to update or create graph structures
https://neo4j-contrib.github.io/neo4j-apoc-procedures/index30.html#_load_jdbc
47. Use JDBC with your sql database
CALL apoc.load.jdbc(“jdbc:mysql://localhost:3306/yelp_db?
user=user&password=pwd", “business")
YIELD row
RETURN row
https://neo4j-contrib.github.io/neo4j-apoc-procedures/index30.html#_load_jdbc
48. Use JDBC with your sql database
CALL apoc.load.jdbc("jdbc:mysql://localhost:3306/yelp_db?
user=user&password=pwd", “business")
YIELD row
RETURN row.id, row.name, row.address, row.state
https://neo4j-contrib.github.io/neo4j-apoc-procedures/index30.html#_load_jdbc
49. Use JDBC with your sql database
CALL apoc.load.jdbc("jdbc:mysql://localhost:3306/yelp_db?
user=user&password=pwd", “business")
YIELD row
MERGE (:Business {id: row.id, name:row.name, address:row.address,
state:row.state})
https://neo4j-contrib.github.io/neo4j-apoc-procedures/index30.html#_load_jdbc
50. Import data: neo4j-admin import
Command line bulk loader neo4j-admin import
• For initial database population
• Scale across CPUs and disk performance
• Efficient RAM usage
• Split- and compressed file support
• For loads up to 10B+ records
• Up to 1M records per second
https://neo4j.com/docs/operations-manual/3.3/tutorial/import-tool/
51. • Neo4j Desktop - Free for download
• Neo4j Browser (included in Neo4j Desktop)
• Sandbox: neo4j.com/sandbox
• Drivers - Official Drivers and Community Supported Drivers
• Webinars and Tutorials
• Community and Meetups
Get started with Neo4j