SlideShare a Scribd company logo
Soulemane Moumie
@moumie.org
Graph Based Data Models
Outline
 Introduction
 Graph in real world
 What is a Graph ?
 Data Model
 Graph in RDBMS
 Graph-based modeling
 Graph Databases
 Graph Query Languages
 Demo with Neo4J and OrientDB
 Conclusions
Introduction
 We live in a connected world. There are no isolated pieces of information
around us but rich ,connected domains all around us.
 Interconnectivity of data is an important aspect.
 Early adopters of graph technology re-imagined their businesses around
the value of data relationship.
 These companies quickly grew up from unknown startup to large
industrial corporations.
 Google, LinkedIn, PayPal, Facebook, Twitter.
Graph in real world
Fraud detection: uncovering fraud ring
Ref: 1
Graph in real world
Realtime recommendation engine
Ref: 1
Graph in real world
Master data management solutions: employee hierarchy data
Ref: 1
Graph in real world
Empowering Network and IT solutions: Troubleshooting
Ref: 1
Graph in real world
Social network
Ref: 1
What is a graph ?
Graph Theory is Boring …
Ref: 2
What is a graph ? : History
Ref: 3
What is a graph ? : Definition
What is a graph ? : Definition
What is a graph ? : Definition
What is a graph ? : Type
What is a graph ? : Density
What is a graph ? : Density
What is a graph ? : Density
What is a graph ? : Graph storage
Graph in RDMBS ?
Ref: 6
Data model
Definition: A data model is an abstract model that organizes elements of data and standardizes how they
relate to one another and to properties of the real world.
Ref: 7
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS : Model
Ref: 4, 5
Graph in RDMBS ?: Model
Ref: 4, 5
Graph in RDMBS ?: Model
Ref: 4, 5
Graph in RDMBS ?: Model
Ref: 4, 5
Graph in RDMBS ?: Model
Ref: 4, 5
Graph in JSON Database ?
Ref: 8
Graph in XML Database?
Ref: 8
Graph in RDMBS ?: Issues
While storing a graph in a relational
database is simple, querying it,
particularly traversing it,
can be time-inefficient due to the
number of potential joins with its
complex queries
Graph Database?
If any database can represent the
graph, then what is the graph
database ?
NoSQL : Characteristics
NoSQL : History
Ref: 9
NoSQL : Categories
Ref: 9
Graph Database?: Definition
“A graph database is any storage system that
provides index-free adjacency. ”
• Each vertex serves as a “mini index” of its adjacent elements
•No index lookups are necessary.
• The cost of the local step remains constant as the graph grows
• Cheaper than global indexes
Ref: 10
Graph Database?: Traversal
Ref: 11
Graph Database?: Traversal
Ref: 11
Graph Database?: Definition
“A database that uses graph structures for semantic
queries with nodes,
edges and properties to represent and store data”
Independent of the way the data is stored internally.
It‟s really the model and the implemented algorithms that matter.
Ref: 12
Graph data model : Representation
Graph data model : Representation
Graph data model : Representation
Graph data model : Representation
Graph data model : Representation
Graph data model : Building blocks
 Nodes : entities
 Relationships: connect
entities and structure
domain
 Properties: attributes
and meta data
 Labels: group node by
role
Graph data model : Building blocks
Graph data model : ERD example
Ref: 13
Graph data model : ERD example
Ref: 13
Graph data model : Why ?
 For applications where „Interconnectivity and topology‟ matters.
 It allows for a more natural modeling of connected data. Graph
structures are visible to the user and they allow a natural way of
handling applications data, for example, hypertext or geographic
data
 Queries can refer directly to graph structure.
So, we can do specific graph operations like – shortest path, sub
graph determining etc.
 For implementation, graph databases may provide special graph
storage structures, and efficient graph algorithms for realizing
specific operations
Ref: 14
Graph data model : Motivation and Application
 Critic on classical DB models – drawbacks + difficulty for user
to see data connectivity.
 For applications – where complexity exceed capabilities of
relational database. e.g. Managing transport n/w.
 Limited expressive power of current query language.
 the appearance of on-line hypertext evidenced the need for
other db-models.
 In technological networks, the spatial and geographical aspects
of the structure are dominant.
Ref: 14
Database model : Components
Database model : Notions
Schema:
-Database schema is the skeleton of database.
- It is designed when the database doesn't exist at all.
- A database schema does not contain any data or information.
Instance
- It is a state of operational database with data at any given time.
- It contains a snapshot of the database.
- Database instances tend to change with time.
Graph database model : Definition
Ref: 14
Graph database model : representation
Representation of database:
 flat graph: has many interconnected nodes, not expressive, extendible ,
difficult to present the information to the user in a clear way.
 hypernode: set of nested graphs, expressive, it is a graph whose nodes
can themselves be a graph. Offers the ability to represent each real-world
object as a separate database entity.
Graph database model : Data structures
1. Genealogy diagram example
Ref: 14
Graph database model : Data structures
1. Logical Data model
The schema uses two basic type nodes for representing data values (N,L), and two product
type nodes (NL,PP) to establish relations among data values in a relational
style. The instance is a collection of tables, one for each node of the schema
Ref: 14
Graph database model : Data structures
2. Hypernode Data Model
The schema defines a person as a complex object with the properties name
and lastname of type string, and parent of type person (recursively defined). The instance
shows the relations in the genealogy among different instances of person
Ref: 14
Graph database model : Data structures
3. Hypergraph-Based Data Model (GROOVY)
GROOVY: Graphically Represented Object-Oriented data model with Values
The schema level models an object PERSON as a hypergraph that relates the attributes
NAME, LASTNAME and PARENTS.
Ref: 14
Graph database model : Data structures
4. Graph Data Model (GDM)
Ref: 14
Graph database model : Integrity constraints
Integrity constraints are general statements and rules that define the set of consistent
database states, or changes of state. In the case of graph db-models, it includes:
 Schema instance integrity: Entity types and type checking
 Schema instance separation: degree to which schema and instance are different objects
in the database
 Redundancy of data: preserve uniqueness of data
 Object identity and referential integrity: Entity Integrity assures that each hypernode is a
unique real world entity identified by its content; Referential Integrity requires that only
existing entities be referenced. Ref: 14
Graph database model : Comparison with other Database Models
Ref: 14
Graph Databases : Critics
 Yes, graph model is more versatile than relational model, but it doesn't
make it universal - in some cases, this versatility is a roadblock for
optimizations.
In fact, modern graph databases are a niche solutions for a narrow set of
tasks - finding a route from A to B, working with friends in a social
network, information technology in medicine.
For most business applications relational databases continue to prevail.
Graph Databases : Critics
 Relational databases were designed to aggregate
data, graph to find relations.
E.g: In the financial domain, all connections are known,
You only aggregate data by other data to find sums
and so on.
Graph Databases : Critics
 Usually need to learn a new query language like
CIPHER, Gremlin, SparcQL
 You have to use an API.
 Fewer vendors to choose from, and smaller user
base, so harder to get support when you run into
issues
Graph Databases : Critics
 Graph databases are relatively immature
compared to well-established RDBMS.
 Requires conceptual shift
 No standardization
Graph Databases : Trends
Ref: 15
Graph Databases : The most popular
Ref: 16
Graph Query Language:
 Cypher
 Extended SQL
 Gremlin
Graph Query Language: CQL
Ref: 17
Graph Query Language: Neo4j CQL Commands/Clauses
Graph Query Language: Cypher
Ref: 18
Graph Query Language: Cypher
Ref: 18
Graph Query Language: Cypher
Ref: 18
Graph Query Language: Cypher
Ref: 18
Graph Query Language: Cypher
Ref: 18
Graph Query Language: Cypher
Ref: 18
Graph Query Language : Extended SQL &Gremlin
OrientDB is a 2nd Generation Distributed
Graph Database with the flexibility of
Documents in one product. OrientDB is
another great graph DB tool which also
operates as a document DB or an Object-
Oriented Database. Its query language is
based on SQL to make it 'more familiar to
TSQL developers'. Like Neo4J there is a
community edition available and licensing
for enterprise is very reasonable.
Ref: 19
Graph Query Language: Extended&SQL,&Gremlin
Ref: 20
Graph Query Language: OrientDB SQL: schema
Ref: 20
Graph Query Language: Populate orientDB
Graph Query Language: Queries
Graph Query Language: Gremlin
A lot of graph databases support their custom languages (e.g. Cipher in Neo4j).
These languages are really useful, however they become useless on other databases.
Gremlin is a powerful domain specific traversal language for graph databases.
This language is supported by all popular graph databases.
Learning Gremlin for graph databases is equivalent to learning SQL for relational
databases.
Ref: 21
Graph Query Language: Gremlin
Ref: 22,23
References
[1] https://neo4j.com/blog/rdbms-graphs-basics-for-relational-developer/
[2] http://images.google.de/imgres?imgurl=https%3A%2F%2Fp.rizon.top%3A443%2Fhttp%2Fcdn2.business2community.com%2Fwp-
content%2Fuploads%2F2014%2F03%2Fistock_000006832296xsmall_small.jpg&imgrefurl=https%3A%2F%2Fp.rizon.top%3A443%2Fhttp%2Fwww.business2
community.com%2Fcontent-marketing%2Fbrand-boring-content-marketing-0819786&h=232&w=300&tbnid=GUe7dYIZl9-
29M%3A&docid=jRPxqmLQ1TLKWM&ei=2V1uV4-eG8yWgAad_baAAQ&tbm=isch&client=firefox-
b&iact=rc&uact=3&dur=226&page=3&start=42&ndsp=27&ved=0ahUKEwjP7pz8_MLNAhVMC8AKHZ2-
DRAQMwiLASgrMCs&bih=634&biw=1366
[3] http://www.slideshare.net/infinitegraph/an-introduction-to-graph-databases, slide 5
[4] Trees and Hierarchies in SQL for Smarties, Joe Celko, Morgan Kaufmann, ISBN: 1558609202
[5] http://www.slideshare.net/ehildebrandt/trees-and-hierarchies-in-sql
[6] http://www.slideshare.net/navicorevn/hierarchical-data-models-in-relational-databases
[7] https://en.wikipedia.org/wiki/Data_model
[8] http://www.slideshare.net/slidarko/graph-windycitydb2010/25-Representing_a_Graph_in_a
[9] GRAPH DATABASES AND ORIENTDB. INFO-H-415: Advanced Databases (Project). Professor: Esteban Zimányi,
cs.ulb.ac.be/public/_media/teaching/infoh415/student_projects/orientdb.pdf
References
[10] http://systemg.research.ibm.com/database.html
[11] https://www.youtube.com/watch?v=kpLqfFGubKM
[12] https://www.arangodb.com/2016/04/index-free-adjacency-hybrid-indexes-graph-databases/
[13] https://neo4j.com/blog/rdbms-vs-graph-data-modeling/
[14] Angles, R., & Gutierrez, "Survey of graph database models", ACM Computing Surveys, Vol.40, No.1, Article 1, Feb.2008
[15] http://db-engines.com/en/ranking_trend/graph+dbms
[16] R.Campbell et al., "A performance evaluation of open source graph databases",ACM ,PPAA ‟14, February 16, 2014.
[17] http://www.tutorialspoint.com/neo4j/neo4j_cql_introduction.htm
[18] https://neo4j.com/developer/cypher-query-language/
[19] http://orientdb.com/docs/last/index.html
[20] http://pettergraff.blogspot.de/2014/01/getting-started-with-orientdb.html
[21] http://www.fromdev.com/2013/09/Gremlin-Example-Query-Snippets-Graph-DB.html
[22] http://sql2gremlin.com/
[23] http://gremlindocs.spmallette.documentup.com/
Danke !

More Related Content

PDF
RDBMS to Graph
PPTX
Introduction to Graph Databases
PDF
Intro to Neo4j and Graph Databases
PPTX
Intro to Neo4j
PPTX
Graph databases
PDF
The Knowledge Graph Explosion
PPTX
NoSQL Graph Databases - Why, When and Where
PDF
Introduction to Knowledge Graphs for Information Architects.pdf
RDBMS to Graph
Introduction to Graph Databases
Intro to Neo4j and Graph Databases
Intro to Neo4j
Graph databases
The Knowledge Graph Explosion
NoSQL Graph Databases - Why, When and Where
Introduction to Knowledge Graphs for Information Architects.pdf

What's hot (20)

PDF
How Graph Algorithms Answer your Business Questions in Banking and Beyond
PPTX
Databricks Platform.pptx
PDF
Modern Data Architecture for a Data Lake with Informatica and Hortonworks Dat...
PDF
Data Mesh for Dinner
PDF
NOSQLEU - Graph Databases and Neo4j
PPT
Graph database
PDF
Ibis: Seamless Transition Between Pandas and Apache Spark
PDF
Introduction to Graph Databases
PDF
Conceptual vs. Logical vs. Physical Data Modeling
PDF
Data Modeling with Neo4j
PDF
Data platform architecture
PDF
Slides: Knowledge Graphs vs. Property Graphs
PDF
Base de données graphe et Neo4j
PPTX
Knowledge Graph Introduction
PDF
Introduction to Data Virtualization (session 1 from Packed Lunch Webinar Series)
ODP
Graph databases
PPTX
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
PPTX
Big data architectures and the data lake
PDF
An overview of Neo4j Internals
PDF
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
How Graph Algorithms Answer your Business Questions in Banking and Beyond
Databricks Platform.pptx
Modern Data Architecture for a Data Lake with Informatica and Hortonworks Dat...
Data Mesh for Dinner
NOSQLEU - Graph Databases and Neo4j
Graph database
Ibis: Seamless Transition Between Pandas and Apache Spark
Introduction to Graph Databases
Conceptual vs. Logical vs. Physical Data Modeling
Data Modeling with Neo4j
Data platform architecture
Slides: Knowledge Graphs vs. Property Graphs
Base de données graphe et Neo4j
Knowledge Graph Introduction
Introduction to Data Virtualization (session 1 from Packed Lunch Webinar Series)
Graph databases
Neo4j Graph Use Cases, Bruno Ungermann, Neo4j
Big data architectures and the data lake
An overview of Neo4j Internals
Scaling into Billions of Nodes and Relationships with Neo4j Graph Data Science
Ad

Viewers also liked (18)

PDF
Graph lecture
PDF
University Cafeteria Operations using Business Process Model and Notation (B...
PPT
NoSQL Options Compared
PDF
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
PPT
Facebook Technology Stack
PDF
OrientDB Distributed Architecture v2.0
PDF
Intro to Graphs and Neo4j
PPTX
Game Development with Unity
PPT
An Introduction to Graph Databases
PPT
Test Planning
PPTX
File Format Benchmark - Avro, JSON, ORC & Parquet
PDF
Performance Test Plan - Sample 2
PDF
Recommending for the World
PPTX
Unity 3d Basics
PDF
Test plan
PDF
Netflix's Recommendation ML Pipeline Using Apache Spark: Spark Summit East ta...
PPTX
Big data storages
PPT
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
Graph lecture
University Cafeteria Operations using Business Process Model and Notation (B...
NoSQL Options Compared
OrientDB, the fastest document-based graph database @ Confoo 2014 in Montreal...
Facebook Technology Stack
OrientDB Distributed Architecture v2.0
Intro to Graphs and Neo4j
Game Development with Unity
An Introduction to Graph Databases
Test Planning
File Format Benchmark - Avro, JSON, ORC & Parquet
Performance Test Plan - Sample 2
Recommending for the World
Unity 3d Basics
Test plan
Netflix's Recommendation ML Pipeline Using Apache Spark: Spark Summit East ta...
Big data storages
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
Ad

Similar to Graph based data models (20)

PDF
Ted Willke, Senior Principal Engineer & GM, Datacenter Group, Intel at MLconf SF
PPTX
Ramya ppt.pptx
PDF
aRangodb, un package per l'utilizzo di ArangoDB con R
PDF
How Graph Databases used in Police Department?
PPTX
New Data Technologies, Graph Computing and Relationship Discovery in the Ente...
PDF
Graph database in sv meetup
PPTX
Graph RAG Varieties and Their Enterprise Applications
PPTX
no sql ppt.pptx
PPT
Graph db
PDF
Graph Databases and Graph Data Science in Neo4j
PPTX
Graph Database and Why it is gaining traction
PDF
OUTCOME ANALYSIS IN ACADEMIC INSTITUTIONS USING NEO4J
PPTX
Module 2.3 Document Databases in NoSQL Systems
PDF
Big dataintegration rahm-part3Scalable and privacy-preserving data integratio...
PPTX
Graph database
PPTX
Using Graph Databases For Insights Into Connected Data.
PDF
Graph Databases - Where Do We Do the Modeling Part?
PPTX
AI, Knowledge Representation and Graph Databases -
 Key Trends in Data Science
PDF
Oslo baksia2014
PPTX
Fast Focus: SQL Server Graph Database & Processing
Ted Willke, Senior Principal Engineer & GM, Datacenter Group, Intel at MLconf SF
Ramya ppt.pptx
aRangodb, un package per l'utilizzo di ArangoDB con R
How Graph Databases used in Police Department?
New Data Technologies, Graph Computing and Relationship Discovery in the Ente...
Graph database in sv meetup
Graph RAG Varieties and Their Enterprise Applications
no sql ppt.pptx
Graph db
Graph Databases and Graph Data Science in Neo4j
Graph Database and Why it is gaining traction
OUTCOME ANALYSIS IN ACADEMIC INSTITUTIONS USING NEO4J
Module 2.3 Document Databases in NoSQL Systems
Big dataintegration rahm-part3Scalable and privacy-preserving data integratio...
Graph database
Using Graph Databases For Insights Into Connected Data.
Graph Databases - Where Do We Do the Modeling Part?
AI, Knowledge Representation and Graph Databases -
 Key Trends in Data Science
Oslo baksia2014
Fast Focus: SQL Server Graph Database & Processing

More from Moumie Soulemane (9)

PDF
Developing a real time application on the cloud using node js , socket.io and...
PPTX
Mobile web development
PPTX
Java EE 7 introduction
PPTX
Java ee introduction
PPTX
Kids Psychology: how they learn
PDF
Performance evaluation of an app for kids learning using BPMN
PDF
Wealth creation through software
PDF
Software engineering in the context of production economic
PDF
Software engineering in the context of production economics
Developing a real time application on the cloud using node js , socket.io and...
Mobile web development
Java EE 7 introduction
Java ee introduction
Kids Psychology: how they learn
Performance evaluation of an app for kids learning using BPMN
Wealth creation through software
Software engineering in the context of production economic
Software engineering in the context of production economics

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Graph based data models

  • 2. Outline  Introduction  Graph in real world  What is a Graph ?  Data Model  Graph in RDBMS  Graph-based modeling  Graph Databases  Graph Query Languages  Demo with Neo4J and OrientDB  Conclusions
  • 3. Introduction  We live in a connected world. There are no isolated pieces of information around us but rich ,connected domains all around us.  Interconnectivity of data is an important aspect.  Early adopters of graph technology re-imagined their businesses around the value of data relationship.  These companies quickly grew up from unknown startup to large industrial corporations.  Google, LinkedIn, PayPal, Facebook, Twitter.
  • 4. Graph in real world Fraud detection: uncovering fraud ring Ref: 1
  • 5. Graph in real world Realtime recommendation engine Ref: 1
  • 6. Graph in real world Master data management solutions: employee hierarchy data Ref: 1
  • 7. Graph in real world Empowering Network and IT solutions: Troubleshooting Ref: 1
  • 8. Graph in real world Social network Ref: 1
  • 9. What is a graph ? Graph Theory is Boring … Ref: 2
  • 10. What is a graph ? : History Ref: 3
  • 11. What is a graph ? : Definition
  • 12. What is a graph ? : Definition
  • 13. What is a graph ? : Definition
  • 14. What is a graph ? : Type
  • 15. What is a graph ? : Density
  • 16. What is a graph ? : Density
  • 17. What is a graph ? : Density
  • 18. What is a graph ? : Graph storage
  • 19. Graph in RDMBS ? Ref: 6
  • 20. Data model Definition: A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to properties of the real world. Ref: 7
  • 21. Graph in RDMBS : Model Ref: 4, 5
  • 22. Graph in RDMBS : Model Ref: 4, 5
  • 23. Graph in RDMBS : Model Ref: 4, 5
  • 24. Graph in RDMBS : Model Ref: 4, 5
  • 25. Graph in RDMBS : Model Ref: 4, 5
  • 26. Graph in RDMBS : Model Ref: 4, 5
  • 27. Graph in RDMBS ?: Model Ref: 4, 5
  • 28. Graph in RDMBS ?: Model Ref: 4, 5
  • 29. Graph in RDMBS ?: Model Ref: 4, 5
  • 30. Graph in RDMBS ?: Model Ref: 4, 5
  • 31. Graph in JSON Database ? Ref: 8
  • 32. Graph in XML Database? Ref: 8
  • 33. Graph in RDMBS ?: Issues While storing a graph in a relational database is simple, querying it, particularly traversing it, can be time-inefficient due to the number of potential joins with its complex queries
  • 34. Graph Database? If any database can represent the graph, then what is the graph database ?
  • 38. Graph Database?: Definition “A graph database is any storage system that provides index-free adjacency. ” • Each vertex serves as a “mini index” of its adjacent elements •No index lookups are necessary. • The cost of the local step remains constant as the graph grows • Cheaper than global indexes Ref: 10
  • 41. Graph Database?: Definition “A database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data” Independent of the way the data is stored internally. It‟s really the model and the implemented algorithms that matter. Ref: 12
  • 42. Graph data model : Representation
  • 43. Graph data model : Representation
  • 44. Graph data model : Representation
  • 45. Graph data model : Representation
  • 46. Graph data model : Representation
  • 47. Graph data model : Building blocks  Nodes : entities  Relationships: connect entities and structure domain  Properties: attributes and meta data  Labels: group node by role
  • 48. Graph data model : Building blocks
  • 49. Graph data model : ERD example Ref: 13
  • 50. Graph data model : ERD example Ref: 13
  • 51. Graph data model : Why ?  For applications where „Interconnectivity and topology‟ matters.  It allows for a more natural modeling of connected data. Graph structures are visible to the user and they allow a natural way of handling applications data, for example, hypertext or geographic data  Queries can refer directly to graph structure. So, we can do specific graph operations like – shortest path, sub graph determining etc.  For implementation, graph databases may provide special graph storage structures, and efficient graph algorithms for realizing specific operations Ref: 14
  • 52. Graph data model : Motivation and Application  Critic on classical DB models – drawbacks + difficulty for user to see data connectivity.  For applications – where complexity exceed capabilities of relational database. e.g. Managing transport n/w.  Limited expressive power of current query language.  the appearance of on-line hypertext evidenced the need for other db-models.  In technological networks, the spatial and geographical aspects of the structure are dominant. Ref: 14
  • 53. Database model : Components
  • 54. Database model : Notions Schema: -Database schema is the skeleton of database. - It is designed when the database doesn't exist at all. - A database schema does not contain any data or information. Instance - It is a state of operational database with data at any given time. - It contains a snapshot of the database. - Database instances tend to change with time.
  • 55. Graph database model : Definition Ref: 14
  • 56. Graph database model : representation Representation of database:  flat graph: has many interconnected nodes, not expressive, extendible , difficult to present the information to the user in a clear way.  hypernode: set of nested graphs, expressive, it is a graph whose nodes can themselves be a graph. Offers the ability to represent each real-world object as a separate database entity.
  • 57. Graph database model : Data structures 1. Genealogy diagram example Ref: 14
  • 58. Graph database model : Data structures 1. Logical Data model The schema uses two basic type nodes for representing data values (N,L), and two product type nodes (NL,PP) to establish relations among data values in a relational style. The instance is a collection of tables, one for each node of the schema Ref: 14
  • 59. Graph database model : Data structures 2. Hypernode Data Model The schema defines a person as a complex object with the properties name and lastname of type string, and parent of type person (recursively defined). The instance shows the relations in the genealogy among different instances of person Ref: 14
  • 60. Graph database model : Data structures 3. Hypergraph-Based Data Model (GROOVY) GROOVY: Graphically Represented Object-Oriented data model with Values The schema level models an object PERSON as a hypergraph that relates the attributes NAME, LASTNAME and PARENTS. Ref: 14
  • 61. Graph database model : Data structures 4. Graph Data Model (GDM) Ref: 14
  • 62. Graph database model : Integrity constraints Integrity constraints are general statements and rules that define the set of consistent database states, or changes of state. In the case of graph db-models, it includes:  Schema instance integrity: Entity types and type checking  Schema instance separation: degree to which schema and instance are different objects in the database  Redundancy of data: preserve uniqueness of data  Object identity and referential integrity: Entity Integrity assures that each hypernode is a unique real world entity identified by its content; Referential Integrity requires that only existing entities be referenced. Ref: 14
  • 63. Graph database model : Comparison with other Database Models Ref: 14
  • 64. Graph Databases : Critics  Yes, graph model is more versatile than relational model, but it doesn't make it universal - in some cases, this versatility is a roadblock for optimizations. In fact, modern graph databases are a niche solutions for a narrow set of tasks - finding a route from A to B, working with friends in a social network, information technology in medicine. For most business applications relational databases continue to prevail.
  • 65. Graph Databases : Critics  Relational databases were designed to aggregate data, graph to find relations. E.g: In the financial domain, all connections are known, You only aggregate data by other data to find sums and so on.
  • 66. Graph Databases : Critics  Usually need to learn a new query language like CIPHER, Gremlin, SparcQL  You have to use an API.  Fewer vendors to choose from, and smaller user base, so harder to get support when you run into issues
  • 67. Graph Databases : Critics  Graph databases are relatively immature compared to well-established RDBMS.  Requires conceptual shift  No standardization
  • 68. Graph Databases : Trends Ref: 15
  • 69. Graph Databases : The most popular Ref: 16
  • 70. Graph Query Language:  Cypher  Extended SQL  Gremlin
  • 71. Graph Query Language: CQL Ref: 17
  • 72. Graph Query Language: Neo4j CQL Commands/Clauses
  • 73. Graph Query Language: Cypher Ref: 18
  • 74. Graph Query Language: Cypher Ref: 18
  • 75. Graph Query Language: Cypher Ref: 18
  • 76. Graph Query Language: Cypher Ref: 18
  • 77. Graph Query Language: Cypher Ref: 18
  • 78. Graph Query Language: Cypher Ref: 18
  • 79. Graph Query Language : Extended SQL &Gremlin OrientDB is a 2nd Generation Distributed Graph Database with the flexibility of Documents in one product. OrientDB is another great graph DB tool which also operates as a document DB or an Object- Oriented Database. Its query language is based on SQL to make it 'more familiar to TSQL developers'. Like Neo4J there is a community edition available and licensing for enterprise is very reasonable. Ref: 19
  • 80. Graph Query Language: Extended&SQL,&Gremlin Ref: 20
  • 81. Graph Query Language: OrientDB SQL: schema Ref: 20
  • 82. Graph Query Language: Populate orientDB
  • 84. Graph Query Language: Gremlin A lot of graph databases support their custom languages (e.g. Cipher in Neo4j). These languages are really useful, however they become useless on other databases. Gremlin is a powerful domain specific traversal language for graph databases. This language is supported by all popular graph databases. Learning Gremlin for graph databases is equivalent to learning SQL for relational databases. Ref: 21
  • 85. Graph Query Language: Gremlin Ref: 22,23
  • 86. References [1] https://neo4j.com/blog/rdbms-graphs-basics-for-relational-developer/ [2] http://images.google.de/imgres?imgurl=https%3A%2F%2Fp.rizon.top%3A443%2Fhttp%2Fcdn2.business2community.com%2Fwp- content%2Fuploads%2F2014%2F03%2Fistock_000006832296xsmall_small.jpg&imgrefurl=https%3A%2F%2Fp.rizon.top%3A443%2Fhttp%2Fwww.business2 community.com%2Fcontent-marketing%2Fbrand-boring-content-marketing-0819786&h=232&w=300&tbnid=GUe7dYIZl9- 29M%3A&docid=jRPxqmLQ1TLKWM&ei=2V1uV4-eG8yWgAad_baAAQ&tbm=isch&client=firefox- b&iact=rc&uact=3&dur=226&page=3&start=42&ndsp=27&ved=0ahUKEwjP7pz8_MLNAhVMC8AKHZ2- DRAQMwiLASgrMCs&bih=634&biw=1366 [3] http://www.slideshare.net/infinitegraph/an-introduction-to-graph-databases, slide 5 [4] Trees and Hierarchies in SQL for Smarties, Joe Celko, Morgan Kaufmann, ISBN: 1558609202 [5] http://www.slideshare.net/ehildebrandt/trees-and-hierarchies-in-sql [6] http://www.slideshare.net/navicorevn/hierarchical-data-models-in-relational-databases [7] https://en.wikipedia.org/wiki/Data_model [8] http://www.slideshare.net/slidarko/graph-windycitydb2010/25-Representing_a_Graph_in_a [9] GRAPH DATABASES AND ORIENTDB. INFO-H-415: Advanced Databases (Project). Professor: Esteban Zimányi, cs.ulb.ac.be/public/_media/teaching/infoh415/student_projects/orientdb.pdf
  • 87. References [10] http://systemg.research.ibm.com/database.html [11] https://www.youtube.com/watch?v=kpLqfFGubKM [12] https://www.arangodb.com/2016/04/index-free-adjacency-hybrid-indexes-graph-databases/ [13] https://neo4j.com/blog/rdbms-vs-graph-data-modeling/ [14] Angles, R., & Gutierrez, "Survey of graph database models", ACM Computing Surveys, Vol.40, No.1, Article 1, Feb.2008 [15] http://db-engines.com/en/ranking_trend/graph+dbms [16] R.Campbell et al., "A performance evaluation of open source graph databases",ACM ,PPAA ‟14, February 16, 2014. [17] http://www.tutorialspoint.com/neo4j/neo4j_cql_introduction.htm [18] https://neo4j.com/developer/cypher-query-language/ [19] http://orientdb.com/docs/last/index.html [20] http://pettergraff.blogspot.de/2014/01/getting-started-with-orientdb.html [21] http://www.fromdev.com/2013/09/Gremlin-Example-Query-Snippets-Graph-DB.html [22] http://sql2gremlin.com/ [23] http://gremlindocs.spmallette.documentup.com/