Introduction to Graph Databases
Knowledge bases course
Master program of AI
Sofia University, Bulgaria
From previous semester
• What is an ontology?
• What is OWL?
• What is RDF?
Agenda
• Trends in Data
• NOSQL
• What is a Graph?
• What is a Graph Database?
• What is GraphDB?
Data is more Semi-Structured:
• If you tried to collect all the data of every
movie ever made, how would you model it?
• Actors, Characters, Locations, Dates, Costs,
Ratings, Showings, Ticket Sales, etc.
NOSQL
Not Only SQL
NoSQL
Graph Databases
• Data Model:
– Nodes and Relationships
• Examples:
– Neo4j, OrientDB, GraphDB
Graph Databases: Pros and Cons
• Pros:
– Powerful data model
– Connected data locally indexed
– Easy to query
• Cons
– Requires rewiring your brain
Living in a NOSQL World
GRraDpBhMS
Databases
Complexity
Document
Databases
BigTable
Clones
Key-Value
Relational Store
Databases
90% of
Use Cases
Size
What is a Graph?
What is a Graph?
• An abstract representation of a set of objects
where some pairs are connected by links.
Object (Vertex, Node)
Link (Edge, Arc, Relationship)
Different Kinds of Graphs
• Undirected Graph
• Directed Graph
• Pseudo Graph
• Multi Graph
More Kinds of Graphs
• Weighted Graph
• Labeled Graph
• Property Graph
What is a Graph Database?
• A database with an explicit graph structure
• Each node knows its adjacent nodes
• As the number of nodes increases, the cost of
a local step (or hop) remains the same
Compared to Relational Databases
Optimized for aggregation Optimized for connections
What is GraphDB?
What is GraphDB?
• Semantic graph Database, created by the
Bulgarian company Ontotext
• Supports RDF and SPARQL
• Suitable for loading and working with data,
exploring relationships, data integration
and scaling
• In this course, we will use GraphDB Free
Good for
• Semantically rich data
• Highly connected data (social networks)
• Recommendations (e-commerce)
Social Networks
Used for:
• Recommendation
of friends
• Analysis of
influence
• Implicit user
clusters
Recommendations
Used for:
• Recommendation
of products,
services and
content
Example: The art ontology
Example: The art ontology
Questions?
?
Thank you!