SlideShare una empresa de Scribd logo
1 de 47
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Knowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based SearchKnowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based Search
Neo4j
 

La actualidad más candente (20)

Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4jNeo4j Graph Use Cases, Bruno Ungermann, Neo4j
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
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
 
Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...
Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...
Knowledge Graphs & Graph Data Science, More Context, Better Predictions - Neo...
 
Neo4j graph database
Neo4j graph databaseNeo4j graph database
Neo4j graph database
 
Neo4j 4 Overview
Neo4j 4 OverviewNeo4j 4 Overview
Neo4j 4 Overview
 
Improving Machine Learning using Graph Algorithms
Improving Machine Learning using Graph AlgorithmsImproving Machine Learning using Graph Algorithms
Improving Machine Learning using Graph Algorithms
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
 
The Knowledge Graph Explosion
The Knowledge Graph ExplosionThe Knowledge Graph Explosion
The Knowledge Graph Explosion
 
Workshop - Build a Graph Solution
Workshop - Build a Graph SolutionWorkshop - Build a Graph Solution
Workshop - Build a Graph Solution
 
Building a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and OntologiesBuilding a Knowledge Graph using NLP and Ontologies
Building a Knowledge Graph using NLP and Ontologies
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
 
Intro to Cypher
Intro to CypherIntro to Cypher
Intro to Cypher
 
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
 
Introduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AIIntroduction to Knowledge Graphs and Semantic AI
Introduction to Knowledge Graphs and Semantic AI
 
Intro to Neo4j
Intro to Neo4jIntro to Neo4j
Intro to Neo4j
 
Demystifying Graph Neural Networks
Demystifying Graph Neural NetworksDemystifying Graph Neural Networks
Demystifying Graph Neural Networks
 
Graph Databases for Master Data Management
Graph Databases for Master Data ManagementGraph Databases for Master Data Management
Graph Databases for Master Data Management
 
How Graph Algorithms Answer your Business Questions in Banking and Beyond
How Graph Algorithms Answer your Business Questions in Banking and BeyondHow Graph Algorithms Answer your Business Questions in Banking and Beyond
How Graph Algorithms Answer your Business Questions in Banking and Beyond
 
Knowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based SearchKnowledge Graphs - The Power of Graph-Based Search
Knowledge Graphs - The Power of Graph-Based Search
 

Similar a Training Week: Introduction 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
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
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
 

Similar a Training Week: Introduction to Neo4j (20)

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
 
Workshop Introduction to Neo4j
Workshop Introduction to Neo4jWorkshop Introduction to Neo4j
Workshop Introduction to Neo4j
 
Training Week: Introduction to Neo4j 2022
Training Week: Introduction to Neo4j 2022Training Week: Introduction to Neo4j 2022
Training Week: Introduction to Neo4j 2022
 
Introduction to Cypher.pptx
Introduction to Cypher.pptxIntroduction to Cypher.pptx
Introduction to Cypher.pptx
 
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
 
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
 
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
 
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
 
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH) Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
Neo4j Introduction (Basics, Cypher, RDBMS to GRAPH)
 
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
 
Morpheus - Cypher for Apache Spark
Morpheus - Cypher for Apache SparkMorpheus - Cypher for Apache Spark
Morpheus - Cypher for Apache Spark
 
Training Series - Intro to Neo4j
Training Series - Intro to Neo4jTraining Series - Intro to Neo4j
Training Series - Intro to Neo4j
 
Neo4j (Part 1)
Neo4j (Part 1)Neo4j (Part 1)
Neo4j (Part 1)
 
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
 
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
 
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
 
Lab3-DB_Neo4j
Lab3-DB_Neo4jLab3-DB_Neo4j
Lab3-DB_Neo4j
 

Más de Neo4j

Más de 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
 
Enabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge GraphsEnabling GenAI Breakthroughs with Knowledge Graphs
Enabling GenAI Breakthroughs with Knowledge Graphs
 
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
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+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
 

Último (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
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...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
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
 
%+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...
 
%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
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 

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