A knowledge graph is a data model that represents facts as typed, named relationships between entities. Its atomic unit is the triple (subject, predicate, object) — and these triples collectively form a directed, labeled graph. Unlike relational databases or document stores, the schema is not fixed; new predicate types can be added without migration, and the graph can be queried by traversing paths.
| Storage | Atom of data | Query paradigm | Strength | Weakness |
|---|
| Relational DB | Row in a table | Set operations (JOIN, GROUP) | Aggregations on structured schemas | Heavy joins for graph-like queries |
| Document store | JSON document | Key–value + nested paths | Flexible, schema‑less records | Weak cross‑document relationships |
| Property graph | Node + edge + props | Graph traversal (Cypher) | Path‑based queries, schema‑flex | Aggregations less optimized |
| RDF graph | Triple (URI/Literal) | SPARQL pattern matching | Formal semantics, reasoning | Overhead for simple lookups |
A KG shines when queries involve indirection: “Find suppliers whose CEOs previously worked for our competitors” is a few hops in a graph, but a combinatorial join in SQL.
Four unique properties of KGs (not all available in any single other system):
- Uniform addressability: every fact, including meta‑facts about the schema, is a triple — no “second‑class” data.
- Schema‑last evolution: new relationship types can be added at runtime without breaking existing queries.
- Mergeability: two KGs with same IRIs merge by set union (schema and instance triples alike).
- Reasoning support: explicit semantics (e.g. subClassOf, domain/range) enable inference of new triples.
The rule of thumb: if your hardest questions involve connections or chains of relationships, a KG is likely the right fit — but it’s not a replacement for column‑stores when you need billion‑row aggregates.