SlideShare a Scribd company logo
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Introduction to Neo4j -
a hands-on crash course
Lju Lazarevic
Developer Relations
@ElLazal
dev.neo4j.com/forum
dev.neo4j.com/chat
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 Aura 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
What is a graph?
Neo4j, Inc. All rights reserved 2021
A graph is...
...a set of discrete objects, each of which has some set of relationships with the
other objects
Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
Neo4j, Inc. All rights reserved 2021
Anything can be a graph
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
10
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
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
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
19
Graph components
Jane car
Neo4j, Inc. All rights reserved 2021
20
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 car
OWNS
Neo4j, Inc. All rights reserved 2021
21
Property graph database
Node (Vertex)
Relationship (Edge)
OWNS
Neo4j, Inc. All rights reserved 2021
22
Property graph database
Node (Vertex)
Relationship (Edge)
:Person :Car
OWNS
Label
● Define node category (optional)
Neo4j, Inc. All rights reserved 2021
23
Property graph database
Node (Vertex)
Relationship (Edge)
:Person :Car
OWNS
Label
● Define node category (optional)
● Can have more than one
:Asset
Neo4j, Inc. All rights reserved 2021
24
Node (Vertex)
Relationship (Edge)
:Person :Car
OWNS
Label
● Define node category (optional)
● Can have more than one
Properties
● Enrich a node or relationship
● No need for nulls!
name: Jane make: Volvo
model: V60
since: 2018
:Asset
Property graph database
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
How do I query the graph?
Neo4j, Inc. All rights reserved 2021 26

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

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

Cypher
A pattern matching query language made for graphs
• Declarative
• Expressive
• Pattern Matching
With ASCII ART ¯_(ツ)_/¯
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
//Create a person node called "Tom Hanks"
CREATE (p:Person {name:"Tom Hanks"});
CREATE
Neo4j, Inc. All rights reserved 2021
//Create a person node called "Tom Hanks"
CREATE (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"})
CREATE (p)-[:ACTED_IN]->(m);
CREATE
Neo4j, Inc. All rights reserved 2021
//Create a person node called "Tom Hanks"
CREATE (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"})
CREATE (p)-[:ACTED_IN]->(m);
//Create the pattern of "Tom Hanks" ACTED_IN "Apollo 13"
//This will create the entire pattern, nodes and all!
CREATE (:Person {name:"Tom Hanks")-[:ACTED_IN]->(:Movie {title:"Apollo
13});
CREATE
Neo4j, Inc. All rights reserved 2021
Time to have a go!
We are going to:
• Go to dev.neo4j.com/aura-login
• Sign in & click “Create a database”
• Give your database a name
• Selected “Shared” database size
• Click “Create Database”
• Make a copy of the generated password - keep it safe!
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
So how do I continue my graph
journey?
Neo4j, Inc. All rights reserved 2021
More training this week - all starting at 1pm UTC
Thursday: Build APIs with Neo4j
GraphQL Library
Friday: Create a Knowledge Graph:
A Simple ML Approach
Tuesday: Hands-on with Neo4j
Aura Free Tier
Wednesday: Getting Started with
Neo4j Bloom
Read all about it!
https://dev.neo4j.com/training-week
Neo4j, Inc. All rights reserved 2021
Neo4j, Inc. All rights reserved 2021
Free online training and
certification:
• dev.neo4j.com/learn
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
Ljubica Lazarevic
Developer Relations
@ElLazal
lju@neo4j.com
Join the conversation at dev.neo4j.com/forum

More Related Content

KEY
Intro to Neo4j presentation
PDF
Neo4j GraphDay Seattle- Sept19- neo4j basic training
PDF
Introduction to Neo4j - a hands-on crash course
PDF
Data Modeling with Neo4j
PDF
GPT and Graph Data Science to power your Knowledge Graph
PDF
Intro to Graphs and Neo4j
PDF
Neo4j Presentation
PDF
Standing on the Shoulders of Open-Source Giants: The Serverless Realtime Lake...
Intro to Neo4j presentation
Neo4j GraphDay Seattle- Sept19- neo4j basic training
Introduction to Neo4j - a hands-on crash course
Data Modeling with Neo4j
GPT and Graph Data Science to power your Knowledge Graph
Intro to Graphs and Neo4j
Neo4j Presentation
Standing on the Shoulders of Open-Source Giants: The Serverless Realtime Lake...

What's hot (20)

PDF
https://www.slideshare.net/neo4j/a-fusion-of-machine-learning-and-graph-analy...
PDF
Introducing Neo4j
PPTX
The Semantic Knowledge Graph
PDF
Neo4j: The path to success with Graph Database and Graph Data Science
PPTX
Intro to Neo4j
PPTX
Cloudera SDX
PDF
Introduction to Knowledge Graphs for Information Architects.pdf
PDF
Neo4j : Graphes de Connaissance, IA et LLMs
PDF
Enabling a Data Mesh Architecture with Data Virtualization
PDF
Databricks Partner Enablement Guide.pdf
PDF
What you need to know about Generative AI and Data Management?
PDF
Modeling Cybersecurity with Neo4j, Based on Real-Life Data Insights
PDF
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
PPTX
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
PDF
Neo4j 4.1 overview
PPTX
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
PDF
MLOps at OLX
PDF
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
PDF
Neo4j Graph Platform Overview, Kurt Freytag, Neo4j
PPT
Big Data Real Time Analytics - A Facebook Case Study
https://www.slideshare.net/neo4j/a-fusion-of-machine-learning-and-graph-analy...
Introducing Neo4j
The Semantic Knowledge Graph
Neo4j: The path to success with Graph Database and Graph Data Science
Intro to Neo4j
Cloudera SDX
Introduction to Knowledge Graphs for Information Architects.pdf
Neo4j : Graphes de Connaissance, IA et LLMs
Enabling a Data Mesh Architecture with Data Virtualization
Databricks Partner Enablement Guide.pdf
What you need to know about Generative AI and Data Management?
Modeling Cybersecurity with Neo4j, Based on Real-Life Data Insights
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Knowledge Graphs and Generative AI_GraphSummit Minneapolis Sept 20.pptx
Neo4j 4.1 overview
Neo4j GraphSummit London March 2023 Emil Eifrem Keynote.pptx
MLOps at OLX
Product Keynote: Denodo 8.0 - A Logical Data Fabric for the Intelligent Enter...
Neo4j Graph Platform Overview, Kurt Freytag, Neo4j
Big Data Real Time Analytics - A Facebook Case Study
Ad

Similar to Training Week: Introduction to Neo4j (20)

PDF
Workshop Introduction to Neo4j
PDF
Training Week: Introduction to Neo4j 2022
PPTX
Introduction to Cypher.pptx
PDF
Training di Base Neo4j
PDF
Introduction to neo4j - a hands-on crash course
PDF
Introduction to Neo4j - a hands-on crash course
PPTX
How to Import JSON Using Cypher and APOC
PDF
Introduction to Graphs with Neo4j
PDF
Intro to Neo4j 2.0
PDF
Einblicke ins Dickicht der Parteiprogramme
PDF
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
PDF
Road to NODES Workshop Series - Intro to Neo4j
PDF
Morpheus - Cypher for Apache Spark
PDF
Training Series - Intro to Neo4j
PDF
Neo4j (Part 1)
PDF
Getting the Most From Today's Java Tooling With Neo4j
PPTX
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
PDF
Training Week: Create a Knowledge Graph: A Simple ML Approach
PPTX
Graph Data Modeling Best Practices(Eric_Monk).pptx
PDF
Lab3-DB_Neo4j
Workshop Introduction to Neo4j
Training Week: Introduction to Neo4j 2022
Introduction to Cypher.pptx
Training di Base Neo4j
Introduction to neo4j - a hands-on crash course
Introduction to Neo4j - a hands-on crash course
How to Import JSON Using Cypher and APOC
Introduction to Graphs with Neo4j
Intro to Neo4j 2.0
Einblicke ins Dickicht der Parteiprogramme
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Road to NODES Workshop Series - Intro to Neo4j
Morpheus - Cypher for Apache Spark
Training Series - Intro to Neo4j
Neo4j (Part 1)
Getting the Most From Today's Java Tooling With Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Training Week: Create a Knowledge Graph: A Simple ML Approach
Graph Data Modeling Best Practices(Eric_Monk).pptx
Lab3-DB_Neo4j
Ad

More from Neo4j (20)

PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
PDF
Jin Foo - Prospa GraphSummit Sydney Presentation.pdf
PDF
GraphSummit Singapore Master Deck - May 20, 2025
PPTX
Graphs & GraphRAG - Essential Ingredients for GenAI
PPTX
Neo4j Knowledge for Customer Experience.pptx
PPTX
GraphTalk New Zealand - The Art of The Possible.pptx
PDF
Neo4j: The Art of the Possible with Graph
PDF
Smarter Knowledge Graphs For Public Sector
PDF
GraphRAG and Knowledge Graphs Exploring AI's Future
PDF
Matinée GenAI & GraphRAG Paris - Décembre 24
PDF
ANZ Presentation: GraphSummit Melbourne 2024
PDF
Google Cloud Presentation GraphSummit Melbourne 2024: Building Generative AI ...
PDF
Telstra Presentation GraphSummit Melbourne: Optimising Business Outcomes with...
PDF
Hands-On GraphRAG Workshop: GraphSummit Melbourne 2024
PDF
Démonstration Digital Twin Building Wire Management
PDF
Swiss Life - Les graphes au service de la détection de fraude dans le domaine...
PDF
Démonstration Supply Chain - GraphTalk Paris
PDF
The Art of Possible - GraphTalk Paris Opening Session
PPTX
How Siemens bolstered supply chain resilience with graph-powered AI insights ...
PDF
Knowledge Graphs for AI-Ready Data and Enterprise Deployment - Gartner IT Sym...
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Jin Foo - Prospa GraphSummit Sydney Presentation.pdf
GraphSummit Singapore Master Deck - May 20, 2025
Graphs & GraphRAG - Essential Ingredients for GenAI
Neo4j Knowledge for Customer Experience.pptx
GraphTalk New Zealand - The Art of The Possible.pptx
Neo4j: The Art of the Possible with Graph
Smarter Knowledge Graphs For Public Sector
GraphRAG and Knowledge Graphs Exploring AI's Future
Matinée GenAI & GraphRAG Paris - Décembre 24
ANZ Presentation: GraphSummit Melbourne 2024
Google Cloud Presentation GraphSummit Melbourne 2024: Building Generative AI ...
Telstra Presentation GraphSummit Melbourne: Optimising Business Outcomes with...
Hands-On GraphRAG Workshop: GraphSummit Melbourne 2024
Démonstration Digital Twin Building Wire Management
Swiss Life - Les graphes au service de la détection de fraude dans le domaine...
Démonstration Supply Chain - GraphTalk Paris
The Art of Possible - GraphTalk Paris Opening Session
How Siemens bolstered supply chain resilience with graph-powered AI insights ...
Knowledge Graphs for AI-Ready Data and Enterprise Deployment - Gartner IT Sym...

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Nekopoi APK 2025 free lastest update
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Digital Strategies for Manufacturing Companies
PPTX
Transform Your Business with a Software ERP System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
AI in Product Development-omnex systems
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Odoo POS Development Services by CandidRoot Solutions
Odoo Companies in India – Driving Business Transformation.pdf
Understanding Forklifts - TECH EHS Solution
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Nekopoi APK 2025 free lastest update
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Reimagine Home Health with the Power of Agentic AI​
Digital Strategies for Manufacturing Companies
Transform Your Business with a Software ERP System
Softaken Excel to vCard Converter Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
AI in Product Development-omnex systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Internet Downloader Manager (IDM) Crack 6.42 Build 41
VVF-Customer-Presentation2025-Ver1.9.pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo POS Development Services by CandidRoot Solutions

Training Week: Introduction to Neo4j

  • 1. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Introduction to Neo4j - a hands-on crash course Lju Lazarevic Developer Relations @ElLazal dev.neo4j.com/forum dev.neo4j.com/chat
  • 2. 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 Aura Free ◦ dev.neo4j.com/aura-login • Continuing your graph journey Useful reference: https://dev.neo4j.com/rdbms-gdb
  • 3. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 What is a graph?
  • 4. Neo4j, Inc. All rights reserved 2021 A graph is... ...a set of discrete objects, each of which has some set of relationships with the other objects Seven Bridges of Konigsberg problem. Leonhard Euler, 1735
  • 5. Neo4j, Inc. All rights reserved 2021 Anything can be a graph the Internet a water molecule H O H
  • 6. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Why are graphs amazing?
  • 7. Neo4j, Inc. All rights reserved 2021
  • 8. Neo4j, Inc. All rights reserved 2021 Follow the flow - buying trainers
  • 9. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Panama papers: simple model, powerful outcome
  • 10. Neo4j, Inc. All rights reserved 2021 10 The Panama papers data model...
  • 11. Neo4j, Inc. All rights reserved 2021 Roses are red, facebook is blue, No mutual friends, So who are you?
  • 12. Neo4j, Inc. All rights reserved 2021 Friends of friends ...or co-actors of co-actors
  • 13. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 What are good graph scenarios?
  • 14. 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
  • 15. 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
  • 16. 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
  • 17. 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
  • 18. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 So what does a (property) graph look like?
  • 19. Neo4j, Inc. All rights reserved 2021 Node (Vertex) ● The main data element from which graphs are constructed 19 Graph components Jane car
  • 20. Neo4j, Inc. All rights reserved 2021 20 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 car OWNS
  • 21. Neo4j, Inc. All rights reserved 2021 21 Property graph database Node (Vertex) Relationship (Edge) OWNS
  • 22. Neo4j, Inc. All rights reserved 2021 22 Property graph database Node (Vertex) Relationship (Edge) :Person :Car OWNS Label ● Define node category (optional)
  • 23. Neo4j, Inc. All rights reserved 2021 23 Property graph database Node (Vertex) Relationship (Edge) :Person :Car OWNS Label ● Define node category (optional) ● Can have more than one :Asset
  • 24. Neo4j, Inc. All rights reserved 2021 24 Node (Vertex) Relationship (Edge) :Person :Car OWNS Label ● Define node category (optional) ● Can have more than one Properties ● Enrich a node or relationship ● No need for nulls! name: Jane make: Volvo model: V60 since: 2018 :Asset Property graph database
  • 25. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 How do I query the graph?
  • 26. Neo4j, Inc. All rights reserved 2021 26  Cypher A pattern-matching query language made for graphs
  • 27. Neo4j, Inc. All rights reserved 2021 27  Cypher A pattern matching query language made for graphs • Declarative • Expressive • Pattern-Matching
  • 28. Neo4j, Inc. All rights reserved 2021 28  Cypher A pattern matching query language made for graphs • Declarative • Expressive • Pattern Matching With ASCII ART ¯_(ツ)_/¯
  • 29. 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’}]-
  • 30. Neo4j, Inc. All rights reserved 2021 Use MATCH to retrieve nodes //Match all nodes MATCH (n) RETURN n;
  • 31. 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;
  • 32. 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;
  • 33. 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
  • 34. 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
  • 35. 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
  • 36. Neo4j, Inc. All rights reserved 2021 Extending the MATCH
  • 37. 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
  • 38. 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
  • 39. 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
  • 40. Neo4j, Inc. All rights reserved 2021 //Create a person node called "Tom Hanks" CREATE (p:Person {name:"Tom Hanks"}); CREATE
  • 41. Neo4j, Inc. All rights reserved 2021 //Create a person node called "Tom Hanks" CREATE (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"}) CREATE (p)-[:ACTED_IN]->(m); CREATE
  • 42. Neo4j, Inc. All rights reserved 2021 //Create a person node called "Tom Hanks" CREATE (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"}) CREATE (p)-[:ACTED_IN]->(m); //Create the pattern of "Tom Hanks" ACTED_IN "Apollo 13" //This will create the entire pattern, nodes and all! CREATE (:Person {name:"Tom Hanks")-[:ACTED_IN]->(:Movie {title:"Apollo 13}); CREATE
  • 43. Neo4j, Inc. All rights reserved 2021 Time to have a go! We are going to: • Go to dev.neo4j.com/aura-login • Sign in & click “Create a database” • Give your database a name • Selected “Shared” database size • Click “Create Database” • Make a copy of the generated password - keep it safe! Can’t access Aura Free? No problem! Use Neo4j Sandbox: • Go to dev.neo4j.com/try • Sign in & click “Blank sandbox”
  • 44. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 So how do I continue my graph journey?
  • 45. Neo4j, Inc. All rights reserved 2021 More training this week - all starting at 1pm UTC Thursday: Build APIs with Neo4j GraphQL Library Friday: Create a Knowledge Graph: A Simple ML Approach Tuesday: Hands-on with Neo4j Aura Free Tier Wednesday: Getting Started with Neo4j Bloom Read all about it! https://dev.neo4j.com/training-week
  • 46. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Free online training and certification: • dev.neo4j.com/learn 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
  • 47. Neo4j, Inc. All rights reserved 2021 Neo4j, Inc. All rights reserved 2021 Ljubica Lazarevic Developer Relations @ElLazal lju@neo4j.com Join the conversation at dev.neo4j.com/forum