SlideShare a Scribd company logo
1 of 57
Download to read offline
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Introduction to Neo4j -
a hands-on crash course
Michael Hunger
Developer Relations
@mesirii
dev.neo4j.com/forum
dev.neo4j.com/chat
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
This is an interactive session!
Tell us where you're from!
And please ask Questions
as we go along!
In any of the chats
Neo4j, Inc. All rights reserved 2021
In this session
We will cover:
• What is a graph and why they are amazing
• Spotting good graph scenarios
• Property graph database anatomy and introduction to Cypher
• Hands-on: the movie graph on Neo4j AuraDB Free
◦ dev.neo4j.com/aura-login
• Continuing your graph journey
Useful reference: https://dev.neo4j.com/rdbms-gdb
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Because it takes a few minutes to launch
Let's get started on
AuraDB Free
dev.neo4j.com/aura-login
Ask in the chat if something doesn't work!
Neo4j, Inc. All rights reserved 2021
Time to have a go! With AuraDB Free
We are going to:
1. Go to dev.neo4j.com/aura-login
2. Sign in & click “Create a database”
3. Selected “AuraDB Free” database size
4. Give your database a name
5. Select a Region
6. Select Movies Database
7. Click “Create Database”
8. Make a copy of the generated password - keep it safe!
9. Wait for 3-5 minutes
Can’t access Aura Free? No problem! Use Neo4j Sandbox:
• Go to dev.neo4j.com/try
• Sign in & click “Blank sandbox”
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
What is a graph?
versus
Neo4j, Inc. All rights reserved 2021
A graph is...
...a set of discrete entities, each of which has some set of relationships with the
other entities
Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
Neo4j, Inc. All rights reserved 2021
Anything can be a graph - do you have examples too?
the Internet a water molecule
H
O
H
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Why are graphs amazing?
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Follow the flow - buying trainers
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Panama papers:
simple model, powerful outcome
Neo4j, Inc. All rights reserved 2021
18
The Panama papers data
model...
Neo4j, Inc. All rights reserved 2021
Roses are red,
facebook is blue,
No mutual friends,
So who are you?
Neo4j, Inc. All rights reserved 2021
Friends of friends
...or co-actors of co-actors
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
What are good graph scenarios?
Neo4j, Inc. All rights reserved 2021
Scenario 1: Does our problem involve understanding relationships between
entities?
Identifying good graph scenarios
● Recommendations
● Fraud detection
● Finding duplicates
● Data lineage
● Social Networks
Neo4j, Inc. All rights reserved 2021
Scenario 2: Does the problem involve a lot of self-referencing to the same type
of entity?
Identifying good graph scenarios
● Organisational
hierarchies
● Access management
● Social influencers
● Friends of friends
Neo4j, Inc. All rights reserved 2021
Scenario 3: Does the problem explore relationships of varying or unknown
depth?
Identifying good graph scenarios
● Supply chain
visibility
● Bill of Materials
● Network
management
● Routing
Neo4j, Inc. All rights reserved 2021
Scenario 4: Does our problem involve discovering lots of different routes or
paths?
Identifying good graph scenarios
● Logistics and routing
● Infrastructure
management
● Dependency tracing
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
So what does a (property) graph
look like?
Neo4j, Inc. All rights reserved 2021
Node (Vertex)
● The main data element from which graphs are constructed
27
Graph components
Jane bike
Neo4j, Inc. All rights reserved 2021
28
Graph components
Node (Vertex)
● The main data element from which graphs are constructed
Relationship (Edge)
● A link between two nodes. Has:
○ Direction
○ Type
● A node without relationships is permitted. A relationship without nodes is not
Jane OWNS bike
Neo4j, Inc. All rights reserved 2021
29
Property graph database
Node (Vertex)
Relationship (Edge)
OWNS
Neo4j, Inc. All rights reserved 2021
30
Property graph database
Node (Vertex)
Relationship (Edge)
:Person :Bike
OWNS
Label
● Define node role (optional)
Neo4j, Inc. All rights reserved 2021
31
Property graph database
Node (Vertex)
Relationship (Edge)
:Person
:Vehicle
:Bike
OWNS
Label
● Define node role (optional)
● Can have more than one
Neo4j, Inc. All rights reserved 2021
32
Node (Vertex)
Relationship (Edge)
:Person OWNS
Label
● Define node role (optional)
● Can have more than one
Properties
● Enrich a node or relationship
● No need for nulls!
name: Jane make: Specialized
model: Crux Pro
since: 2018
Property graph database
:Vehicle
:Bike
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
And now query the graph
together!
Neo4j, Inc. All rights reserved 2021 34

Cypher
A pattern-matching query language made for graphs
Neo4j, Inc. All rights reserved 2021 35

Cypher
A pattern matching query language made for graphs
• Declarative
• Expressive
• Pattern-Matching
Neo4j, Inc. All rights reserved 2021 36

Cypher
A pattern matching query language made for graphs
• Declarative
• Expressive
• Pattern Matching
With ASCII ART ¯_(ツ)_/¯
Neo4j, Inc. All rights reserved 2021
dev.neo4j.com/refcard
Neo4j, Inc. All rights reserved 2021
Nodes and relationships at a glance
Description Node Relationship
Generic () -- --> -[]-
With a reference (n) -[r]-
With a node label or rel
type
(:Person) -[:ACTED_IN]-
With a label/type and an
inline property
(:Person {name: ‘Bob’}) -[:ACTED_IN {role: ‘Dave’}]-
With a reference,
label/type and an inline
property
(p:Person {name: ‘Bob’})
-[r:ACTED_IN {role:
‘Rob’}]-
Neo4j, Inc. All rights reserved 2021
Use MATCH to retrieve nodes
//Match all nodes
MATCH (n)
RETURN n;
Neo4j, Inc. All rights reserved 2021
Use MATCH to retrieve nodes
//Match all nodes
MATCH (n)
RETURN n;
//Match all nodes with a Person label
MATCH (n:Person)
RETURN n;
Neo4j, Inc. All rights reserved 2021
Use MATCH to retrieve nodes
//Match all nodes
MATCH (n)
RETURN n;
//Match all nodes with a Person label
MATCH (n:Person)
RETURN n;
//Match all nodes with a Person label and property name is "Tom Hanks"
MATCH (n:Person {name: "Tom Hanks"})
RETURN n;
Neo4j, Inc. All rights reserved 2021
//Return nodes with label Person and name property is "Tom Hanks" -
Inline
MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches
RETURN p;
Use MATCH and properties to retrieve nodes
Neo4j, Inc. All rights reserved 2021
//Return nodes with label Person and name property is "Tom Hanks" -
Inline
MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches
RETURN p;
//Return nodes with label Person and name property equals "Tom Hanks"
MATCH (p:Person)
WHERE p.name = "Tom Hanks"
RETURN p;
Use MATCH and properties to retrieve nodes
Neo4j, Inc. All rights reserved 2021
//Return nodes with label Person and name property is "Tom Hanks" -
Inline
MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches
RETURN p;
//Return nodes with label Person and name property equals "Tom Hanks"
MATCH (p:Person)
WHERE p.name = "Tom Hanks"
RETURN p;
//Return nodes with label Movie, released property is between 1991 and
1999
MATCH (m:Movie)
WHERE m.released > 1990 AND m.released < 2000
RETURN m;
Use MATCH and properties to retrieve nodes
Neo4j, Inc. All rights reserved 2021
Extending the MATCH
Neo4j, Inc. All rights reserved 2021
//Find all the movies Tom Hanks is connected to
MATCH (:Person {name:"Tom Hanks"})--(m:Movie)
RETURN m.title;
Extending the MATCH
Neo4j, Inc. All rights reserved 2021
//Find all the movies Tom Hanks is connected to
MATCH (:Person {name:"Tom Hanks"})--(m:Movie)
RETURN m.title;
//Find all the movies Tom Hanks directed and order by latest movie
MATCH (:Person {name:"Tom Hanks"})-[:DIRECTED]->(m:Movie)
RETURN m.title, m.released ORDER BY m.released DESC;
Extending the MATCH
Neo4j, Inc. All rights reserved 2021
//Find all the movies Tom Hanks is connected to
MATCH (:Person {name:"Tom Hanks"})--(m:Movie)
RETURN m.title;
//Find all the movies Tom Hanks directed and order by latest movie
MATCH (:Person {name:"Tom Hanks"})-[:DIRECTED]->(m:Movie)
RETURN m.title, m.released ORDER BY m.released DESC;
//Find all of the co-actors Tom Hanks have worked with
MATCH (:Person {name:"Tom Hanks"})-->(:Movie)<-[:ACTED_IN]-(coActor:Person)
RETURN coActor.name;
Extending the MATCH
Neo4j, Inc. All rights reserved 2021
//Uniquely create a person node called "Tom Hanks"
MERGE (p:Person {name:"Tom Hanks"});
MERGE
Neo4j, Inc. All rights reserved 2021
//Create a person node called "Tom Hanks"
MERGE (p:Person {name:"Tom Hanks"});
//Create an ACTED_IN relationship between "Tom Hanks" and "Apollo 13"
MATCH (p:Person {name:"Tom Hanks"}), (m:Movie {title:"Apollo 13"})
MERGE (p)-[:ACTED_IN]->(m);
MERGE
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
What Else is There?
Neo4j, Inc. All rights reserved 2021
Connectors
• Spark
• Kafka
• JDBC
What else is there?
Drivers
• Python
• JavaScript
• Java
• .Net
• Go
Data Science
• Graph Data Science Library
• Bloom Visualization
Libraries / Integrations
• neo4j/graphql
• Spring Data Neo4j
• neosemantics (RDF)
• APOC (utility)
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
So how do I continue my graph
journey?
Neo4j, Inc. All rights reserved 2021
A training class each week - Tuesdays, 2pm UTC
23 Nov: Build APIs with Neo4j GraphQL Library
30 Nov: Create a Knowledge Graph: A Simple ML Approach
7 Dec: Getting Started with Neo4j Bloom
Quick sign-up: dev.neo4j.com/training-q4-2021
Neo4j, Inc. All rights reserved 2021
A training class each week - Tuesdays, 2pm UTC
30 Nov: Create a Knowledge
Graph: A Simple ML Approach
23 Nov: Build APIs with Neo4j
GraphQL Library
7 Dec: Getting Started with Neo4j
Bloom
Read all about it!
dev.neo4j.com/training-q4-2021
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Free online training and
certification:
• dev.neo4j.com/learn
• dev.neo4j.com/datasets
How to, best practices, hands on
and community stories:
• dev.neo4j.com/videos
Come say hello :)
• dev.neo4j.com/chat
• dev.neo4j.com/forum
Continue your journey
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Michael Hunger
Developer Relations
@mesirii
michael@neo4j.co
m
Join the conversation at dev.neo4j.com/forum

More Related Content

What's hot

An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
Tobias Lindaaker
 
Training Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL LibraryTraining Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL Library
Neo4j
 
Training Week: Introduction to Neo4j Bloom 2022
Training Week: Introduction to Neo4j Bloom 2022Training Week: Introduction to Neo4j Bloom 2022
Training Week: Introduction to Neo4j Bloom 2022
Neo4j
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
jexp
 

What's hot (20)

Training Week: Introduction to Neo4j
Training Week: Introduction to Neo4jTraining Week: Introduction to Neo4j
Training Week: Introduction to Neo4j
 
An overview of Neo4j Internals
An overview of Neo4j InternalsAn overview of Neo4j Internals
An overview of Neo4j Internals
 
Neo4j Fundamentals
Neo4j FundamentalsNeo4j Fundamentals
Neo4j Fundamentals
 
Neo4j Graph Platform Overview, Kurt Freytag, Neo4j
Neo4j Graph Platform Overview, Kurt Freytag, Neo4jNeo4j Graph Platform Overview, Kurt Freytag, Neo4j
Neo4j Graph Platform Overview, Kurt Freytag, Neo4j
 
Graph databases
Graph databasesGraph databases
Graph databases
 
Training Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL LibraryTraining Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL Library
 
Introduction to Neo4j
Introduction to Neo4jIntroduction to Neo4j
Introduction to Neo4j
 
Top 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & TricksTop 10 Cypher Tuning Tips & Tricks
Top 10 Cypher Tuning Tips & Tricks
 
Training Week: Introduction to Neo4j Bloom 2022
Training Week: Introduction to Neo4j Bloom 2022Training Week: Introduction to Neo4j Bloom 2022
Training Week: Introduction to Neo4j Bloom 2022
 
Introducing Neo4j
Introducing Neo4jIntroducing Neo4j
Introducing Neo4j
 
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data ScienceScaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
 
Graphdatabases
GraphdatabasesGraphdatabases
Graphdatabases
 
Introduction to Neo4j
Introduction to Neo4jIntroduction to Neo4j
Introduction to Neo4j
 
Neo4j 4.1 overview
Neo4j 4.1 overviewNeo4j 4.1 overview
Neo4j 4.1 overview
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
 
Neo4J 사용
Neo4J 사용Neo4J 사용
Neo4J 사용
 
Get Started with the Most Advanced Edition Yet of Neo4j Graph Data Science
Get Started with the Most Advanced Edition Yet of Neo4j Graph Data ScienceGet Started with the Most Advanced Edition Yet of Neo4j Graph Data Science
Get Started with the Most Advanced Edition Yet of Neo4j Graph Data Science
 
How Graph Databases efficiently store, manage and query connected data at s...
How Graph Databases efficiently  store, manage and query  connected data at s...How Graph Databases efficiently  store, manage and query  connected data at s...
How Graph Databases efficiently store, manage and query connected data at s...
 

Similar to Introduction to Neo4j - a hands-on crash course

Introduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash courseIntroduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash course
Neo4j
 
Training Week: Create a Knowledge Graph: A Simple ML Approach
Training Week: Create a Knowledge Graph: A Simple ML Approach Training Week: Create a Knowledge Graph: A Simple ML Approach
Training Week: Create a Knowledge Graph: A Simple ML Approach
Neo4j
 
Training Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura FreeTraining Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura Free
Neo4j
 

Similar to Introduction to Neo4j - a hands-on crash course (20)

Training Week: Introduction to Neo4j 2022
Training Week: Introduction to Neo4j 2022Training Week: Introduction to Neo4j 2022
Training Week: Introduction to Neo4j 2022
 
Workshop Introduction to Neo4j
Workshop Introduction to Neo4jWorkshop Introduction to Neo4j
Workshop Introduction to Neo4j
 
Introduction to Cypher.pptx
Introduction to Cypher.pptxIntroduction to Cypher.pptx
Introduction to Cypher.pptx
 
Training Series - Intro to Neo4j
Training Series - Intro to Neo4jTraining Series - Intro to Neo4j
Training Series - Intro to Neo4j
 
Introduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash courseIntroduction to Neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash course
 
Training di Base Neo4j
Training di Base Neo4jTraining di Base Neo4j
Training di Base Neo4j
 
Introduction to neo4j - a hands-on crash course
Introduction to neo4j - a hands-on crash courseIntroduction to neo4j - a hands-on crash course
Introduction to neo4j - a hands-on crash course
 
Road to NODES Workshop Series - Intro to Neo4j
Road to NODES Workshop Series - Intro to Neo4jRoad to NODES Workshop Series - Intro to Neo4j
Road to NODES Workshop Series - Intro to Neo4j
 
Intro to Neo4j 2.0
Intro to Neo4j 2.0Intro to Neo4j 2.0
Intro to Neo4j 2.0
 
Einblicke ins Dickicht der Parteiprogramme
Einblicke ins Dickicht der ParteiprogrammeEinblicke ins Dickicht der Parteiprogramme
Einblicke ins Dickicht der Parteiprogramme
 
Training Week: Create a Knowledge Graph: A Simple ML Approach
Training Week: Create a Knowledge Graph: A Simple ML Approach Training Week: Create a Knowledge Graph: A Simple ML Approach
Training Week: Create a Knowledge Graph: A Simple ML Approach
 
How to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOCHow to Import JSON Using Cypher and APOC
How to Import JSON Using Cypher and APOC
 
Introduction to Graphs with Neo4j
Introduction to Graphs with Neo4jIntroduction to Graphs with Neo4j
Introduction to Graphs with Neo4j
 
Graph Data Modeling Best Practices(Eric_Monk).pptx
Graph Data Modeling Best Practices(Eric_Monk).pptxGraph Data Modeling Best Practices(Eric_Monk).pptx
Graph Data Modeling Best Practices(Eric_Monk).pptx
 
Enabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsEnabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge Graphs
 
Training Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura FreeTraining Week: Introduction to Neo4j Aura Free
Training Week: Introduction to Neo4j Aura Free
 
Getting the Most From Today's Java Tooling With Neo4j
Getting the Most From Today's Java Tooling With Neo4jGetting the Most From Today's Java Tooling With Neo4j
Getting the Most From Today's Java Tooling With Neo4j
 
UX in the Jungle - 如何應用敏捷實務設計出好玩的桌上遊戲
UX in the Jungle - 如何應用敏捷實務設計出好玩的桌上遊戲UX in the Jungle - 如何應用敏捷實務設計出好玩的桌上遊戲
UX in the Jungle - 如何應用敏捷實務設計出好玩的桌上遊戲
 
UX in the Jungle - My journey of applying agile practices in board game design
UX in the Jungle - My journey of applying agile practices in board game designUX in the Jungle - My journey of applying agile practices in board game design
UX in the Jungle - My journey of applying agile practices in board game design
 
Morpheus - Cypher for Apache Spark
Morpheus - Cypher for Apache SparkMorpheus - Cypher for Apache Spark
Morpheus - Cypher for Apache Spark
 

More from Neo4j

More from Neo4j (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
ISDEFE - GraphSummit Madrid - ARETA: Aviation Real-Time Emissions Token Accre...
 
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafosBBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
BBVA - GraphSummit Madrid - Caso de éxito en BBVA: Optimizando con grafos
 
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
Graph Everywhere - Josep Taruella - Por qué Graph Data Science en tus modelos...
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdfNeo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
Neo4j_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdfRabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
Rabobank_Exploring the Impact of Graph Technology on Financial Services.pdf
 
Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!Webinar - IA generativa e grafi Neo4j: RAG time!
Webinar - IA generativa e grafi Neo4j: RAG time!
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)Neo4j: Data Engineering for RAG (retrieval augmented generation)
Neo4j: Data Engineering for RAG (retrieval augmented generation)
 
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdfNeo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
Neo4j Graph Summit 2024 Workshop - EMEA - Breda_and_Munchen.pdf
 
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdfNeo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
Neo4j_Anurag Tandon_Product Vision and Roadmap.Benelux.pptx.pdf
 
Neo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with GraphNeo4j Jesus Barrasa The Art of the Possible with Graph
Neo4j Jesus Barrasa The Art of the Possible with Graph
 
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
SWIFT: Maintaining Critical Standards in the Financial Services Industry with...
 

Recently uploaded

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

Introduction to Neo4j - a hands-on crash course

  • 1. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Introduction to Neo4j - a hands-on crash course Michael Hunger Developer Relations @mesirii dev.neo4j.com/forum dev.neo4j.com/chat
  • 2. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 This is an interactive session! Tell us where you're from! And please ask Questions as we go along! In any of the chats
  • 3. Neo4j, Inc. All rights reserved 2021 In this session We will cover: • What is a graph and why they are amazing • Spotting good graph scenarios • Property graph database anatomy and introduction to Cypher • Hands-on: the movie graph on Neo4j AuraDB Free ◦ dev.neo4j.com/aura-login • Continuing your graph journey Useful reference: https://dev.neo4j.com/rdbms-gdb
  • 4. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Because it takes a few minutes to launch Let's get started on AuraDB Free dev.neo4j.com/aura-login Ask in the chat if something doesn't work!
  • 5. Neo4j, Inc. All rights reserved 2021 Time to have a go! With AuraDB Free We are going to: 1. Go to dev.neo4j.com/aura-login 2. Sign in & click “Create a database” 3. Selected “AuraDB Free” database size 4. Give your database a name 5. Select a Region 6. Select Movies Database 7. Click “Create Database” 8. Make a copy of the generated password - keep it safe! 9. Wait for 3-5 minutes Can’t access Aura Free? No problem! Use Neo4j Sandbox: • Go to dev.neo4j.com/try • Sign in & click “Blank sandbox”
  • 6. Neo4j, Inc. All rights reserved 2021
  • 7. Neo4j, Inc. All rights reserved 2021
  • 8. Neo4j, Inc. All rights reserved 2021
  • 9. Neo4j, Inc. All rights reserved 2021
  • 10. Neo4j, Inc. All rights reserved 2021
  • 11. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 What is a graph? versus
  • 12. Neo4j, Inc. All rights reserved 2021 A graph is... ...a set of discrete entities, each of which has some set of relationships with the other entities Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
  • 13. Neo4j, Inc. All rights reserved 2021 Anything can be a graph - do you have examples too? the Internet a water molecule H O H
  • 14. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Why are graphs amazing?
  • 15. Neo4j, Inc. All rights reserved 2021
  • 16. Neo4j, Inc. All rights reserved 2021 Follow the flow - buying trainers
  • 17. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Panama papers: simple model, powerful outcome
  • 18. Neo4j, Inc. All rights reserved 2021 18 The Panama papers data model...
  • 19. Neo4j, Inc. All rights reserved 2021 Roses are red, facebook is blue, No mutual friends, So who are you?
  • 20. Neo4j, Inc. All rights reserved 2021 Friends of friends ...or co-actors of co-actors
  • 21. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 What are good graph scenarios?
  • 22. Neo4j, Inc. All rights reserved 2021 Scenario 1: Does our problem involve understanding relationships between entities? Identifying good graph scenarios ● Recommendations ● Fraud detection ● Finding duplicates ● Data lineage ● Social Networks
  • 23. Neo4j, Inc. All rights reserved 2021 Scenario 2: Does the problem involve a lot of self-referencing to the same type of entity? Identifying good graph scenarios ● Organisational hierarchies ● Access management ● Social influencers ● Friends of friends
  • 24. Neo4j, Inc. All rights reserved 2021 Scenario 3: Does the problem explore relationships of varying or unknown depth? Identifying good graph scenarios ● Supply chain visibility ● Bill of Materials ● Network management ● Routing
  • 25. Neo4j, Inc. All rights reserved 2021 Scenario 4: Does our problem involve discovering lots of different routes or paths? Identifying good graph scenarios ● Logistics and routing ● Infrastructure management ● Dependency tracing
  • 26. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 So what does a (property) graph look like?
  • 27. Neo4j, Inc. All rights reserved 2021 Node (Vertex) ● The main data element from which graphs are constructed 27 Graph components Jane bike
  • 28. Neo4j, Inc. All rights reserved 2021 28 Graph components Node (Vertex) ● The main data element from which graphs are constructed Relationship (Edge) ● A link between two nodes. Has: ○ Direction ○ Type ● A node without relationships is permitted. A relationship without nodes is not Jane OWNS bike
  • 29. Neo4j, Inc. All rights reserved 2021 29 Property graph database Node (Vertex) Relationship (Edge) OWNS
  • 30. Neo4j, Inc. All rights reserved 2021 30 Property graph database Node (Vertex) Relationship (Edge) :Person :Bike OWNS Label ● Define node role (optional)
  • 31. Neo4j, Inc. All rights reserved 2021 31 Property graph database Node (Vertex) Relationship (Edge) :Person :Vehicle :Bike OWNS Label ● Define node role (optional) ● Can have more than one
  • 32. Neo4j, Inc. All rights reserved 2021 32 Node (Vertex) Relationship (Edge) :Person OWNS Label ● Define node role (optional) ● Can have more than one Properties ● Enrich a node or relationship ● No need for nulls! name: Jane make: Specialized model: Crux Pro since: 2018 Property graph database :Vehicle :Bike
  • 33. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 And now query the graph together!
  • 34. Neo4j, Inc. All rights reserved 2021 34  Cypher A pattern-matching query language made for graphs
  • 35. Neo4j, Inc. All rights reserved 2021 35  Cypher A pattern matching query language made for graphs • Declarative • Expressive • Pattern-Matching
  • 36. Neo4j, Inc. All rights reserved 2021 36  Cypher A pattern matching query language made for graphs • Declarative • Expressive • Pattern Matching With ASCII ART ¯_(ツ)_/¯
  • 37. Neo4j, Inc. All rights reserved 2021 dev.neo4j.com/refcard
  • 38. Neo4j, Inc. All rights reserved 2021 Nodes and relationships at a glance Description Node Relationship Generic () -- --> -[]- With a reference (n) -[r]- With a node label or rel type (:Person) -[:ACTED_IN]- With a label/type and an inline property (:Person {name: ‘Bob’}) -[:ACTED_IN {role: ‘Dave’}]- With a reference, label/type and an inline property (p:Person {name: ‘Bob’}) -[r:ACTED_IN {role: ‘Rob’}]-
  • 39. Neo4j, Inc. All rights reserved 2021 Use MATCH to retrieve nodes //Match all nodes MATCH (n) RETURN n;
  • 40. Neo4j, Inc. All rights reserved 2021 Use MATCH to retrieve nodes //Match all nodes MATCH (n) RETURN n; //Match all nodes with a Person label MATCH (n:Person) RETURN n;
  • 41. Neo4j, Inc. All rights reserved 2021 Use MATCH to retrieve nodes //Match all nodes MATCH (n) RETURN n; //Match all nodes with a Person label MATCH (n:Person) RETURN n; //Match all nodes with a Person label and property name is "Tom Hanks" MATCH (n:Person {name: "Tom Hanks"}) RETURN n;
  • 42. Neo4j, Inc. All rights reserved 2021 //Return nodes with label Person and name property is "Tom Hanks" - Inline MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches RETURN p; Use MATCH and properties to retrieve nodes
  • 43. Neo4j, Inc. All rights reserved 2021 //Return nodes with label Person and name property is "Tom Hanks" - Inline MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches RETURN p; //Return nodes with label Person and name property equals "Tom Hanks" MATCH (p:Person) WHERE p.name = "Tom Hanks" RETURN p; Use MATCH and properties to retrieve nodes
  • 44. Neo4j, Inc. All rights reserved 2021 //Return nodes with label Person and name property is "Tom Hanks" - Inline MATCH (p:Person {name: "Tom Hanks"}) //Only works with exact matches RETURN p; //Return nodes with label Person and name property equals "Tom Hanks" MATCH (p:Person) WHERE p.name = "Tom Hanks" RETURN p; //Return nodes with label Movie, released property is between 1991 and 1999 MATCH (m:Movie) WHERE m.released > 1990 AND m.released < 2000 RETURN m; Use MATCH and properties to retrieve nodes
  • 45. Neo4j, Inc. All rights reserved 2021 Extending the MATCH
  • 46. Neo4j, Inc. All rights reserved 2021 //Find all the movies Tom Hanks is connected to MATCH (:Person {name:"Tom Hanks"})--(m:Movie) RETURN m.title; Extending the MATCH
  • 47. Neo4j, Inc. All rights reserved 2021 //Find all the movies Tom Hanks is connected to MATCH (:Person {name:"Tom Hanks"})--(m:Movie) RETURN m.title; //Find all the movies Tom Hanks directed and order by latest movie MATCH (:Person {name:"Tom Hanks"})-[:DIRECTED]->(m:Movie) RETURN m.title, m.released ORDER BY m.released DESC; Extending the MATCH
  • 48. Neo4j, Inc. All rights reserved 2021 //Find all the movies Tom Hanks is connected to MATCH (:Person {name:"Tom Hanks"})--(m:Movie) RETURN m.title; //Find all the movies Tom Hanks directed and order by latest movie MATCH (:Person {name:"Tom Hanks"})-[:DIRECTED]->(m:Movie) RETURN m.title, m.released ORDER BY m.released DESC; //Find all of the co-actors Tom Hanks have worked with MATCH (:Person {name:"Tom Hanks"})-->(:Movie)<-[:ACTED_IN]-(coActor:Person) RETURN coActor.name; Extending the MATCH
  • 49. Neo4j, Inc. All rights reserved 2021 //Uniquely create a person node called "Tom Hanks" MERGE (p:Person {name:"Tom Hanks"}); MERGE
  • 50. Neo4j, Inc. All rights reserved 2021 //Create a person node called "Tom Hanks" MERGE (p:Person {name:"Tom Hanks"}); //Create an ACTED_IN relationship between "Tom Hanks" and "Apollo 13" MATCH (p:Person {name:"Tom Hanks"}), (m:Movie {title:"Apollo 13"}) MERGE (p)-[:ACTED_IN]->(m); MERGE
  • 51. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 What Else is There?
  • 52. Neo4j, Inc. All rights reserved 2021 Connectors • Spark • Kafka • JDBC What else is there? Drivers • Python • JavaScript • Java • .Net • Go Data Science • Graph Data Science Library • Bloom Visualization Libraries / Integrations • neo4j/graphql • Spring Data Neo4j • neosemantics (RDF) • APOC (utility)
  • 53. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 So how do I continue my graph journey?
  • 54. Neo4j, Inc. All rights reserved 2021 A training class each week - Tuesdays, 2pm UTC 23 Nov: Build APIs with Neo4j GraphQL Library 30 Nov: Create a Knowledge Graph: A Simple ML Approach 7 Dec: Getting Started with Neo4j Bloom Quick sign-up: dev.neo4j.com/training-q4-2021
  • 55. Neo4j, Inc. All rights reserved 2021 A training class each week - Tuesdays, 2pm UTC 30 Nov: Create a Knowledge Graph: A Simple ML Approach 23 Nov: Build APIs with Neo4j GraphQL Library 7 Dec: Getting Started with Neo4j Bloom Read all about it! dev.neo4j.com/training-q4-2021
  • 56. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Free online training and certification: • dev.neo4j.com/learn • dev.neo4j.com/datasets How to, best practices, hands on and community stories: • dev.neo4j.com/videos Come say hello :) • dev.neo4j.com/chat • dev.neo4j.com/forum Continue your journey
  • 57. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Michael Hunger Developer Relations @mesirii michael@neo4j.co m Join the conversation at dev.neo4j.com/forum