SlideShare a Scribd company logo
1 of 37
Introduction to Graph 
Databases in term of Neo4j 
By: Abdullah Hamidi 
Seminar Teacher: Ms.Agnieszka Zielinska
Table of contents 
• Graph Introduction 
• Graph Database Management Systems 
• Graph Database 
• The Power of Graphs 
• Weaknesses of Graphs 
• Lack Relationships in Relational Databases 
• Neo4j and Cypher Query Language 
• Simple Cypher Query Examples 
• Conclusion 
• More on this Subject
Graph Introduction 
• A set of nodes and the relationships that connect them. 
• Graphs represent entities as nodes and the ways in which those entities 
relate to the world as relationships.
Example of Graph 
• Twiter 
Figure 1 : Graph Databases (O’ Really) , page: 3
Graph Database Management System 
• Is an online database management system with Create, Read, Update, and 
Delete (CRUD) methods that expose a graph data model. 
• They are normally optimized for transactional performance. 
• Relationships are first-class citizens of the graph data model, unlike other 
database management systems (Foreign Keys)
Graph Database 
• The records in a graph database are called Nodes . 
• Nodes are connected through typed, directed Relationships. 
• Each single Node and Relationship can have named attributes referred to 
as Properties. 
• A Label is a name that organizes nodes into groups.
Property Graph 
Figure 2 : http://www.neo4j.org/learn/neo4j (online course)
Graph Database 
• Nodes: 
• Nodes are used to represent entities like actors, directors and movies (in 
a movie and actor graph database). 
• Some nodes 
(a) actors 
(m) movies 
() some anonymous nodes
Graph Database 
• Relationships: 
• Relationships are used to connect nodes. 
(a)-[r]->(m) actors having a relationship referred to as "r" to movies 
(a)-[:ACTED_IN]->(m) actors that ACTED_IN some movie 
• Properties 
• Nodes with properties 
(m {title:"The Matrix"}) Movie with a title property
Graph Database 
• Labels 
• Are used to distinguish between nodes 
(a:Person) a Person
The power of Graphs 
• Performance 
• Connected data versus relational databases and NOSQL stores. 
• Performance remains relatively constant, even as the dataset grows. 
• The execution time for each query is proportional only to the size of the part of the graph 
traversed, rather than the size of the overall graph. 
• Flexibility 
• Graphs are naturally additive, meaning we can add new kinds of relationships, new nodes, 
and new sub graphs to an existing structure without disturbing existing queries and 
application functionality
Weaknesses of Graph Databases 
• Maturity or levels of Support 
• Less support 
• Less market 
• Ease of Programming 
• Is a little bit harder than Mysql or other Relational Databases (Resolved by Neo4j) 
• Does not have built in security and assumed as a trusted environment
Lack Relationships in Relational Databases 
• Relationships do exist in relational databases as joining tables 
• The relational model becomes burdened with large join tables 
• The rise in connectedness translates in the relational world into increased 
joins in response to changing business needs. 
• As data size increases, the query runtime increases too.
Understand the cost of performing connected 
queries 
Figure 4 : Graph Databases (O’ Really) , page: 13
Understand the cost of performing connected 
queries 
• Who are Bob’s friends? 
Figure 5 : Graph Databases (O’ Really) , page: 13 
• Alice and Zach
Understand the cost of performing connected 
queries 
• Who is friends with Bob? 
• Alice 
Figure 6 : Graph Databases (O’ Really) , page: 13
Undrestand the cost of performing connected 
queries 
• Alice’s friends-of-friends 
• Who are my friends-of-friends-of-friends? Figure 7 : Graph Databases (O’ Really) , page: 13
But a Graph Approach 
Figure 8 : Graph Databases (O’ Really) , page: 19
A Graph Approach 
• The flexibility of the graph model has allowed us to add new nodes and new 
relationships. 
• We can see who LOVES whom , who is a COLLEAGUE_OF of whom, and 
who is BOSS_OF them all. 
• Relationships in a graph naturally form paths. Querying—or traversing—the 
graph involves following paths.
An Experiment 
• Partner and Vukotic’s experiment seeks to find friends-of-friends in a social 
network, to a maximum depth of five. 
• For a social network containing 1,000,000 people 
• Each with approximately 50 friends
Result of Experiment 
Table 1 : Graph Databases (O’ Really) , page: 20
Neo4J and Cypher 
• Neo4j is a Database - use it to reliably store information and find it later 
• Neo4j's data model is a Graph 
• Opensource 
• Written in Java 
• Brief History 
• Official v1.0 2010 
• Current Version 2.4 
Neo4j 
Graph 
Database
James 
Marry 
BMW 
Name:Marry 
Age: 22 
Brand: BMW 
Model: 2004a 
Name: James 
Age: 26 
Purchased_at: 12-01-2001
Traversal in Graph 
Figure 9: What is Graph Database, slideshare.com, page: 82
Traversal in Graph 
Figure 10: What is Graph Database, slideshare.com, page: 83
Neo4J and Cypher 
• Querying Language 
• Cypher is Neo4j's graph query language (SQL for graphs!) 
• Cypher is a declarative query language 
• Cypher is meant to be very readable and expressive 
• Similar to SQL 
• Based on Graph traversal
Cypher Query Language 
• Cypher is a declarative, SQL inspired language for describing patterns in 
graphs. 
Figure 11: http://neo4j.com/graphacademy/online-course/
Some Simple Queries on Movie and Actor 
Database 
MATCH(n)(m) 
RETURN n, m; Returns all records which an actor has relationship with movies
Some Simple Queries on Movie and Actor 
Database 
MATCH(n)() 
RETURN n; Returns all records or nodes that are actors
Some Simple Queries on Movie and Actor 
Database 
MATCH(actor)-[:ACTED_IN]->(movie) 
RETURN actor.name, movie.title; 
Returns all actor names and movie titles that each actor acted in
Some Simple Queries on Movie and Actor 
Database 
MATCH(actor:Person)-[:ACTED_IN]->(m:Movie) 
WHERE actor.name = “Tom Hanks” 
RETURN actor, m; 
Returns Tom Hanks with its properties and all the movies he acted in.
Some Simple Queries on Movie and Actor 
Database 
MATCH(actor:Person)-[role:ACTED_IN]->(m:Movie) 
WHERE m.title= “The Matrix” 
RETURN role.roles, actor.name, m; 
Returns all the actors with their roles they played in Matrix movie.
Other Queries Using Cypher 
• Querying the graph 
• MATCH 
• WHERE 
• RETURN 
• ORDER BY 
• SKIP/LIMIT
Other Queries Using Cypher 
• Updating the graph 
• CREATE: Creates nodes and relationships. 
• MERGE: Creates nodes uniquely. 
• CREATE UNIQUE: Creates relationships uniquely. 
• DELETE: Removes nodes, relationships. 
• SET: Updates properties and labels. 
• REMOVE: Removes properties and labels. 
• FOREACH: Performs updating actions once per element in a list. 
• WITH: Divides a query into multiple, distinct parts and passes results from one to the 
next.
Conclusion 
• The world is a Graph. 
• Natural way to model almost everything 
• “Whiteboard Friendly” 
• Even the internet is a Graph 
• Relational Databases are not so great for storing graph structures 
• Expensive joins 
• Expensive lookups during graph traversals 
• Graph Databases fix these 
• Efficient Storage 
• Direct pointers and no joins 
•
More on this subject: 
• http://neo4j.com/graphacademy/online-course/ 
• Free Online Courses 
• Graph Databases by Ian Robinson, Jim Webber and Emil Eifrem (O’Reilly) 
• A Comparison of a Graph Database and a Relational Database
Any Question?

More Related Content

What's hot

Neo4j - graph database for recommendations
Neo4j - graph database for recommendationsNeo4j - graph database for recommendations
Neo4j - graph database for recommendationsproksik
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph DatabasesMax De Marzi
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databasesthai
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph SchemaJoshua Shinavier
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageNeo4j
 
Introduction to Graph Database
Introduction to Graph DatabaseIntroduction to Graph Database
Introduction to Graph DatabaseEric Lee
 
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionIntroduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionAleksander Stensby
 
Using Neo4j from Java
Using Neo4j from JavaUsing Neo4j from Java
Using Neo4j from JavaNeo4j
 

What's hot (10)

Neo4j - graph database for recommendations
Neo4j - graph database for recommendationsNeo4j - graph database for recommendations
Neo4j - graph database for recommendations
 
Introduction to Graph Databases
Introduction to Graph DatabasesIntroduction to Graph Databases
Introduction to Graph Databases
 
Graph based data models
Graph based data modelsGraph based data models
Graph based data models
 
Neo4j in Depth
Neo4j in DepthNeo4j in Depth
Neo4j in Depth
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph Schema
 
The openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query LanguageThe openCypher Project - An Open Graph Query Language
The openCypher Project - An Open Graph Query Language
 
Introduction to Graph Database
Introduction to Graph DatabaseIntroduction to Graph Database
Introduction to Graph Database
 
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 EditionIntroduction to graph databases, Neo4j and Spring Data - English 2015 Edition
Introduction to graph databases, Neo4j and Spring Data - English 2015 Edition
 
Using Neo4j from Java
Using Neo4j from JavaUsing Neo4j from Java
Using Neo4j from Java
 

Viewers also liked

How to take control of your l ife
How to take control of your l ifeHow to take control of your l ife
How to take control of your l ifeMashooq Jami
 
Tarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfTarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfBU
 
How to speak in public
How to speak in publicHow to speak in public
How to speak in publicJawid Qaumi
 
Bitcharities Cause Presentation
Bitcharities Cause PresentationBitcharities Cause Presentation
Bitcharities Cause PresentationFrancesco Rulli
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Hassen Poreya
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and AwarenessAbdul Rahman Sherzad
 
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraFondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraAlessandro Califano, PhD
 
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanEnterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanFarshid Ghyasi
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Markus Eisele
 
Monitoring Virtualized Environments
Monitoring Virtualized EnvironmentsMonitoring Virtualized Environments
Monitoring Virtualized EnvironmentsAhmad Khalid Nasrat
 

Viewers also liked (20)

Lecture 1. java database connectivity
Lecture 1. java database connectivityLecture 1. java database connectivity
Lecture 1. java database connectivity
 
Introduction to sql_02
Introduction to sql_02Introduction to sql_02
Introduction to sql_02
 
How to take control of your l ife
How to take control of your l ifeHow to take control of your l ife
How to take control of your l ife
 
E learning ict4-d_presentation
E learning ict4-d_presentationE learning ict4-d_presentation
E learning ict4-d_presentation
 
Web design - Working with forms in HTML
Web design - Working with forms in HTMLWeb design - Working with forms in HTML
Web design - Working with forms in HTML
 
Simple past
Simple pastSimple past
Simple past
 
MyCV
MyCVMyCV
MyCV
 
Tarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdfTarjumaye jadwali-quran-karim-pdf
Tarjumaye jadwali-quran-karim-pdf
 
How to speak in public
How to speak in publicHow to speak in public
How to speak in public
 
Bitcharities Cause Presentation
Bitcharities Cause PresentationBitcharities Cause Presentation
Bitcharities Cause Presentation
 
Computational Advertising
Computational AdvertisingComputational Advertising
Computational Advertising
 
Web app development_cookies_sessions_14
Web app development_cookies_sessions_14Web app development_cookies_sessions_14
Web app development_cookies_sessions_14
 
Web Application Security and Awareness
Web Application Security and AwarenessWeb Application Security and Awareness
Web Application Security and Awareness
 
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostraFondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
Fondo gallerie storiche romane - Destinazione Donna - catalogo della mostra
 
Google Search Console
Google Search ConsoleGoogle Search Console
Google Search Console
 
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in AfghanistanEnterprise Resource Planning using Odoo/OpenERP in Afghanistan
Enterprise Resource Planning using Odoo/OpenERP in Afghanistan
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Mite Nroc Beebe Aeqa
Mite Nroc Beebe AeqaMite Nroc Beebe Aeqa
Mite Nroc Beebe Aeqa
 
Bootstrap day3
Bootstrap day3Bootstrap day3
Bootstrap day3
 
Monitoring Virtualized Environments
Monitoring Virtualized EnvironmentsMonitoring Virtualized Environments
Monitoring Virtualized Environments
 

Similar to Introduction to graph databases in term of neo4j

Graphs fun vjug2
Graphs fun vjug2Graphs fun vjug2
Graphs fun vjug2Neo4j
 
Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol
 
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...Jean Ihm
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training IntroductionMax De Marzi
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large GraphsNishant Gandhi
 
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 BeyondNeo4j
 
GraphTour Boston - Graphs for AI and ML
GraphTour Boston - Graphs for AI and MLGraphTour Boston - Graphs for AI and ML
GraphTour Boston - Graphs for AI and MLNeo4j
 
AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017Kisung Kim
 
Intro to Graphs for Fedict
Intro to Graphs for FedictIntro to Graphs for Fedict
Intro to Graphs for FedictRik Van Bruggen
 
Improve ML Predictions using Graph Analytics (today!)
Improve ML Predictions using Graph Analytics (today!)Improve ML Predictions using Graph Analytics (today!)
Improve ML Predictions using Graph Analytics (today!)Neo4j
 
Introduction to Graph databases and Neo4j (by Stefan Armbruster)
Introduction to Graph databases and Neo4j (by Stefan Armbruster)Introduction to Graph databases and Neo4j (by Stefan Armbruster)
Introduction to Graph databases and Neo4j (by Stefan Armbruster)barcelonajug
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .NetNeo4j
 
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jTransforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jDatabricks
 
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jTransforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jFred Madrid
 
Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?DATAVERSITY
 

Similar to Introduction to graph databases in term of neo4j (20)

10. Graph Databases
10. Graph Databases10. Graph Databases
10. Graph Databases
 
Graphs fun vjug2
Graphs fun vjug2Graphs fun vjug2
Graphs fun vjug2
 
Graph Databases
Graph DatabasesGraph Databases
Graph Databases
 
GraphDatabases
GraphDatabasesGraphDatabases
GraphDatabases
 
Gerry McNicol Graph Databases
Gerry McNicol Graph DatabasesGerry McNicol Graph Databases
Gerry McNicol Graph Databases
 
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
How To Model and Construct Graphs with Oracle Database (AskTOM Office Hours p...
 
Neo4j Training Introduction
Neo4j Training IntroductionNeo4j Training Introduction
Neo4j Training Introduction
 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
 
Betabit - syrwag 2018-03-28
Betabit - syrwag 2018-03-28Betabit - syrwag 2018-03-28
Betabit - syrwag 2018-03-28
 
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
 
GraphTour Boston - Graphs for AI and ML
GraphTour Boston - Graphs for AI and MLGraphTour Boston - Graphs for AI and ML
GraphTour Boston - Graphs for AI and ML
 
GraphDB
GraphDBGraphDB
GraphDB
 
AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017AgensGraph Presentation at PGConf.us 2017
AgensGraph Presentation at PGConf.us 2017
 
Intro to Graphs for Fedict
Intro to Graphs for FedictIntro to Graphs for Fedict
Intro to Graphs for Fedict
 
Improve ML Predictions using Graph Analytics (today!)
Improve ML Predictions using Graph Analytics (today!)Improve ML Predictions using Graph Analytics (today!)
Improve ML Predictions using Graph Analytics (today!)
 
Introduction to Graph databases and Neo4j (by Stefan Armbruster)
Introduction to Graph databases and Neo4j (by Stefan Armbruster)Introduction to Graph databases and Neo4j (by Stefan Armbruster)
Introduction to Graph databases and Neo4j (by Stefan Armbruster)
 
Introduction to Neo4j and .Net
Introduction to Neo4j and .NetIntroduction to Neo4j and .Net
Introduction to Neo4j and .Net
 
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jTransforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
 
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4jTransforming AI with Graphs: Real World Examples using Spark and Neo4j
Transforming AI with Graphs: Real World Examples using Spark and Neo4j
 
Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?Graph Databases - Where Do We Do the Modeling Part?
Graph Databases - Where Do We Do the Modeling Part?
 

Recently uploaded

Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Pooja Nehwal
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAroojKhan71
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 

Recently uploaded (20)

Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 

Introduction to graph databases in term of neo4j

  • 1. Introduction to Graph Databases in term of Neo4j By: Abdullah Hamidi Seminar Teacher: Ms.Agnieszka Zielinska
  • 2. Table of contents • Graph Introduction • Graph Database Management Systems • Graph Database • The Power of Graphs • Weaknesses of Graphs • Lack Relationships in Relational Databases • Neo4j and Cypher Query Language • Simple Cypher Query Examples • Conclusion • More on this Subject
  • 3. Graph Introduction • A set of nodes and the relationships that connect them. • Graphs represent entities as nodes and the ways in which those entities relate to the world as relationships.
  • 4. Example of Graph • Twiter Figure 1 : Graph Databases (O’ Really) , page: 3
  • 5. Graph Database Management System • Is an online database management system with Create, Read, Update, and Delete (CRUD) methods that expose a graph data model. • They are normally optimized for transactional performance. • Relationships are first-class citizens of the graph data model, unlike other database management systems (Foreign Keys)
  • 6. Graph Database • The records in a graph database are called Nodes . • Nodes are connected through typed, directed Relationships. • Each single Node and Relationship can have named attributes referred to as Properties. • A Label is a name that organizes nodes into groups.
  • 7. Property Graph Figure 2 : http://www.neo4j.org/learn/neo4j (online course)
  • 8. Graph Database • Nodes: • Nodes are used to represent entities like actors, directors and movies (in a movie and actor graph database). • Some nodes (a) actors (m) movies () some anonymous nodes
  • 9. Graph Database • Relationships: • Relationships are used to connect nodes. (a)-[r]->(m) actors having a relationship referred to as "r" to movies (a)-[:ACTED_IN]->(m) actors that ACTED_IN some movie • Properties • Nodes with properties (m {title:"The Matrix"}) Movie with a title property
  • 10. Graph Database • Labels • Are used to distinguish between nodes (a:Person) a Person
  • 11. The power of Graphs • Performance • Connected data versus relational databases and NOSQL stores. • Performance remains relatively constant, even as the dataset grows. • The execution time for each query is proportional only to the size of the part of the graph traversed, rather than the size of the overall graph. • Flexibility • Graphs are naturally additive, meaning we can add new kinds of relationships, new nodes, and new sub graphs to an existing structure without disturbing existing queries and application functionality
  • 12. Weaknesses of Graph Databases • Maturity or levels of Support • Less support • Less market • Ease of Programming • Is a little bit harder than Mysql or other Relational Databases (Resolved by Neo4j) • Does not have built in security and assumed as a trusted environment
  • 13. Lack Relationships in Relational Databases • Relationships do exist in relational databases as joining tables • The relational model becomes burdened with large join tables • The rise in connectedness translates in the relational world into increased joins in response to changing business needs. • As data size increases, the query runtime increases too.
  • 14. Understand the cost of performing connected queries Figure 4 : Graph Databases (O’ Really) , page: 13
  • 15. Understand the cost of performing connected queries • Who are Bob’s friends? Figure 5 : Graph Databases (O’ Really) , page: 13 • Alice and Zach
  • 16. Understand the cost of performing connected queries • Who is friends with Bob? • Alice Figure 6 : Graph Databases (O’ Really) , page: 13
  • 17. Undrestand the cost of performing connected queries • Alice’s friends-of-friends • Who are my friends-of-friends-of-friends? Figure 7 : Graph Databases (O’ Really) , page: 13
  • 18. But a Graph Approach Figure 8 : Graph Databases (O’ Really) , page: 19
  • 19. A Graph Approach • The flexibility of the graph model has allowed us to add new nodes and new relationships. • We can see who LOVES whom , who is a COLLEAGUE_OF of whom, and who is BOSS_OF them all. • Relationships in a graph naturally form paths. Querying—or traversing—the graph involves following paths.
  • 20. An Experiment • Partner and Vukotic’s experiment seeks to find friends-of-friends in a social network, to a maximum depth of five. • For a social network containing 1,000,000 people • Each with approximately 50 friends
  • 21. Result of Experiment Table 1 : Graph Databases (O’ Really) , page: 20
  • 22. Neo4J and Cypher • Neo4j is a Database - use it to reliably store information and find it later • Neo4j's data model is a Graph • Opensource • Written in Java • Brief History • Official v1.0 2010 • Current Version 2.4 Neo4j Graph Database
  • 23. James Marry BMW Name:Marry Age: 22 Brand: BMW Model: 2004a Name: James Age: 26 Purchased_at: 12-01-2001
  • 24. Traversal in Graph Figure 9: What is Graph Database, slideshare.com, page: 82
  • 25. Traversal in Graph Figure 10: What is Graph Database, slideshare.com, page: 83
  • 26. Neo4J and Cypher • Querying Language • Cypher is Neo4j's graph query language (SQL for graphs!) • Cypher is a declarative query language • Cypher is meant to be very readable and expressive • Similar to SQL • Based on Graph traversal
  • 27. Cypher Query Language • Cypher is a declarative, SQL inspired language for describing patterns in graphs. Figure 11: http://neo4j.com/graphacademy/online-course/
  • 28. Some Simple Queries on Movie and Actor Database MATCH(n)(m) RETURN n, m; Returns all records which an actor has relationship with movies
  • 29. Some Simple Queries on Movie and Actor Database MATCH(n)() RETURN n; Returns all records or nodes that are actors
  • 30. Some Simple Queries on Movie and Actor Database MATCH(actor)-[:ACTED_IN]->(movie) RETURN actor.name, movie.title; Returns all actor names and movie titles that each actor acted in
  • 31. Some Simple Queries on Movie and Actor Database MATCH(actor:Person)-[:ACTED_IN]->(m:Movie) WHERE actor.name = “Tom Hanks” RETURN actor, m; Returns Tom Hanks with its properties and all the movies he acted in.
  • 32. Some Simple Queries on Movie and Actor Database MATCH(actor:Person)-[role:ACTED_IN]->(m:Movie) WHERE m.title= “The Matrix” RETURN role.roles, actor.name, m; Returns all the actors with their roles they played in Matrix movie.
  • 33. Other Queries Using Cypher • Querying the graph • MATCH • WHERE • RETURN • ORDER BY • SKIP/LIMIT
  • 34. Other Queries Using Cypher • Updating the graph • CREATE: Creates nodes and relationships. • MERGE: Creates nodes uniquely. • CREATE UNIQUE: Creates relationships uniquely. • DELETE: Removes nodes, relationships. • SET: Updates properties and labels. • REMOVE: Removes properties and labels. • FOREACH: Performs updating actions once per element in a list. • WITH: Divides a query into multiple, distinct parts and passes results from one to the next.
  • 35. Conclusion • The world is a Graph. • Natural way to model almost everything • “Whiteboard Friendly” • Even the internet is a Graph • Relational Databases are not so great for storing graph structures • Expensive joins • Expensive lookups during graph traversals • Graph Databases fix these • Efficient Storage • Direct pointers and no joins •
  • 36. More on this subject: • http://neo4j.com/graphacademy/online-course/ • Free Online Courses • Graph Databases by Ian Robinson, Jim Webber and Emil Eifrem (O’Reilly) • A Comparison of a Graph Database and a Relational Database