Graph Models
Summary: Data models optimized for highly interconnected data with common many-to-many relationships, where anything can potentially be related to everything.
Sources: raw/chapter2
Last updated: 2026-04-15
While the relational-model can handle simple many-to-many relationships, graph models become more natural as connections between data become more complex and interconnected (source: chapter2, p. 49).
A graph consists of two kinds of objects: vertices (also known as nodes or entities) and edges (also known as relationships or arcs) (source: chapter2, p. 49).
Common Models
Property Graph Model
Implemented by databases like Neo4j and Titan. Each vertex and edge can have a set of properties (key-value pairs) and labels (source: chapter2, p. 50).
- cypher is the dominant declarative query language for this model.
Triple-Store Model
Stores information in the form of three-part statements: (subject, predicate, object) (source: chapter2, p. 55). This model is closely linked to the Semantic Web and the Resource Description Framework (RDF) (source: chapter2, p. 57).
- sparql is the standard query language for triple-stores.
Key Concept: Datalog
datalog is a foundational, rule-based query language for graphs that dates back to the 1980s. It provides the basis for many modern graph query languages (source: chapter2, p. 60).