Knowledge Graphs
A network of interconnected concepts where items are represented as nodes and the relationships between them are represented as edges --- encoding not just data, but meaning.
What is it?
A knowledge graph is a way of organising information as a network of connected things. Each thing (a person, a place, a concept, a product) is a node. Each connection between two things (works-at, is-part-of, requires, is-located-in) is an edge. Together, the nodes and edges form a web of meaning that captures not just facts, but how those facts relate to each other.1
This is fundamentally different from a flat list or a simple table. A spreadsheet can tell you that “Marie Curie” is in the “Scientists” column and “Physics” is in the “Field” column. A knowledge graph can tell you that Marie Curie won the Nobel Prize, which is awarded by the Royal Swedish Academy, which is located in Stockholm --- and that she won it twice, in two different fields, which are both branches of natural science.2 The relationships carry as much information as the entities themselves.
Knowledge graphs sit at the intersection of databases (which store data) and ontologies (which define meaning). The parent discipline --- knowledge-engineering --- is about capturing human knowledge and making it machine-readable. A knowledge graph is one of the primary outputs of that process: the structure that makes stored knowledge navigable, queryable, and useful for reasoning.3
The concept is not new, but the term gained mainstream traction in 2012 when Google launched its Knowledge Graph to power richer search results --- the information panels you see when you search for a famous person, a city, or a film.4 Today, knowledge graphs underpin recommendation engines, virtual assistants, fraud detection systems, and increasingly, the grounding layer that makes large language models more reliable.
In plain terms
A knowledge graph is like a corkboard covered in index cards with strings connecting them. Each card is a thing. Each string is a relationship. Unlike a filing cabinet (where things sit in isolated folders), the corkboard lets you follow connections: pull one string and see everything related to it.
At a glance
How a knowledge graph differs from other structures (click to expand)
graph TD subgraph FlatList[Flat List] L1[Item A] L2[Item B] L3[Item C] end subgraph TreeHierarchy[Tree or Hierarchy] T1[Root] --> T2[Branch A] T1 --> T3[Branch B] T2 --> T4[Leaf] end subgraph KnowledgeGraph[Knowledge Graph] G1[Concept A] -->|related to| G2[Concept B] G2 -->|part of| G3[Concept C] G3 -->|requires| G1 G1 -->|used by| G4[Concept D] G4 -->|related to| G2 endKey: A flat list has no connections. A tree has parent-child connections only (one path between any two items). A knowledge graph has many-to-many connections --- any node can relate to any other node, through any type of relationship. This flexibility is what makes it powerful.
How does it work?
A knowledge graph has four essential components. Understanding each one explains why the structure captures meaning that simpler formats cannot.
1. Nodes (entities)
Every distinct thing in the graph is a node: a person, a city, a concept, a document, an event. Nodes carry properties --- a person node might have a name, a birth date, and a nationality. The node is the “what.”1
Think of it like...
A node is a Wikipedia article. It describes one thing in detail. On its own, it is useful but isolated.
Concept to explore
See nodes-and-edges for a deeper dive into how nodes and edges work as data structures, including directed vs undirected graphs and weighted edges.
2. Edges (relationships)
An edge connects two nodes and describes how they are related. The edge is the “how” --- it carries a label that gives the connection meaning. “Marie Curie” —[won]⇒ “Nobel Prize” is very different from “Marie Curie” —[rejected]⇒ “Nobel Prize”, even though the same two nodes are involved.2
Edges can be directed (one-way: A teaches B does not mean B teaches A) or undirected (two-way: A is a colleague of B implies B is a colleague of A). Most knowledge graphs use directed, labelled edges because direction and labels carry semantic meaning.1
Think of it like...
An edge is a hyperlink in a Wikipedia article. It connects one article to another and tells you why you might want to follow it (“born in”, “discovered by”, “capital of”). The links are what turn isolated articles into a navigable web.
3. Schema (the rules)
A schema (sometimes called an ontology) defines what types of nodes and edges are allowed in the graph. It is the blueprint: “A Person can have a birthDate. A Person can [won] an Award. An Award belongs to a Field.”3
Without a schema, a knowledge graph is a free-for-all --- anyone can connect anything to anything with any label. With a schema, the graph becomes consistent and queryable. You can ask “show me all Persons who won an Award in the Field of Physics” because the schema guarantees those types and relationships exist.
Example: a simple schema (click to expand)
Consider a knowledge graph about films:
Node type Properties Film title, year, genre Person name, birthYear Studio name, country
Edge type From To directed_by Film Person acted_in Person Film produced_by Film Studio This schema means you can query: “Which Person acted_in a Film that was produced_by Studio X and directed_by Person Y?” The schema makes such questions possible.
4. Triples (the statements)
The atomic unit of a knowledge graph is the triple: subject — predicate ⇒ object. For example: Marie Curie — won ⇒ Nobel Prize in Physics. Every fact in the graph is stored as a triple, and the entire graph is a collection of these small, composable statements.2
Triples are powerful because they are additive. You never have to redesign a table or add a column. To add a new fact, you simply add a new triple. This makes knowledge graphs flexible and extensible in ways that relational databases are not.
Think of it like...
A triple is a sentence with a subject, verb, and object. “Paris [is the capital of] France.” “France [is in] Europe.” “Europe [contains] 44 countries.” Each sentence is simple, but together they build a rich description of the world.
Why do we use it?
Key reasons
1. Capturing relationships, not just data. A database stores facts in isolated rows and columns. A knowledge graph stores facts and the connections between them. This makes it possible to answer questions that require traversing multiple relationships --- questions a flat table cannot answer without complex joins.1
2. Flexible and extensible. Adding new types of entities or relationships does not require restructuring the entire system. You add new triples. This makes knowledge graphs ideal for domains where the data model evolves over time.3
3. Powering intelligent search and discovery. When Google shows you a panel about a person alongside their birthplace, achievements, and related people, that is a knowledge graph at work. It connects entities so that a search engine can answer “who”, “what”, and “how are these related” --- not just match keywords.4
4. Grounding AI systems. Large language models generate fluent text but can hallucinate. Connecting an LLM to a knowledge graph gives it a structured, verifiable source of truth to reason over, reducing errors and improving trustworthiness.5
When do we use it?
- When your data has rich, many-to-many relationships that a simple table cannot capture cleanly
- When you need to discover connections between entities that were not explicitly queried (e.g., fraud detection, recommendation engines)
- When building a search or Q&A system that needs to answer relational questions, not just keyword matches
- When integrating data from multiple sources with different schemas into a unified view
- When creating a learning or documentation system where concepts depend on and relate to each other
Rule of thumb
If you find yourself needing lots of JOIN operations in a relational database to answer a single question, or if the question is “how is X connected to Y?”, a knowledge graph is likely the better structure.
How can I think about it?
The city map
A knowledge graph is like a detailed city map.
- Each building (museum, restaurant, school) is a node
- Each road or path between buildings is an edge
- The type of road (highway, footpath, one-way street) is the edge label
- The map legend is the schema --- it defines what symbols mean
- A flat list of addresses is like a phone book: you can look up one building, but you cannot see how to get from one to another
- A tree (like a postal hierarchy: country > city > district > street) tells you where a building sits in a hierarchy, but not which buildings are connected by roads
- The map shows all of it: location, hierarchy, and connections
The detective's evidence board
A knowledge graph is like a detective’s evidence board in a crime drama.
- Each photo, document, or name pinned to the board is a node
- Each piece of string connecting two items is an edge
- The colour or label on the string tells you the relationship: “called on March 5th”, “employed by”, “lives at”
- The detective does not just have a list of suspects --- they have a web of connections that reveals patterns invisible in a simple list
- Adding new evidence is easy: pin a new item and connect it with strings
- The board lets you follow connections: start at one person and trace paths to see who they know, where they went, and what links them to the crime
Concepts to explore next
| Concept | What it covers | Status |
|---|---|---|
| nodes-and-edges | The two building blocks of any graph: things and their connections | complete |
| taxonomies | Hierarchical classification systems --- a specific type of graph structure | stub |
| topological-sort | Ordering nodes so that dependencies come before dependents | stub |
Some cards don't exist yet
A broken link is a placeholder for future learning, not an error.
Check your understanding
Test yourself (click to expand)
- Explain what a knowledge graph is to someone who only knows spreadsheets. Why would they want one?
- Name the four essential components of a knowledge graph and describe the role of each.
- Distinguish between a knowledge graph and a relational database. What can a knowledge graph express that a table cannot?
- Interpret this triple:
Python --[is a]--> Programming Language --[used in]--> Data Science. What two facts does it encode, and what question could you answer by traversing both edges?- Connect knowledge graphs to the concept of search engines: how does Google’s Knowledge Graph improve search results compared to keyword matching alone?
Where this concept fits
Position in the knowledge graph
graph TD KE[Knowledge Engineering] --> KG[Knowledge Graphs] KE --> MRF[Machine-Readable Formats] KG --> NE[Nodes and Edges] KG --> TAX[Taxonomies] KG --> TS[Topological Sort] style KG fill:#4a9ede,color:#fffRelated concepts:
- databases --- knowledge graphs are a specialised form of database optimised for relationships rather than rows and columns
- machine-readable-formats --- the standards (JSON-LD, RDF, OWL) used to store and exchange knowledge graph data
- apis --- the interfaces through which applications query and update knowledge graphs
Sources
Further reading
Resources
- What Are Knowledge Graphs? (ML Digest) --- Comprehensive guide covering core concepts, applications, and how to build one from scratch
- What Is a Knowledge Graph? (Ontotext) --- Authoritative primer from a leading knowledge graph company, strong on ontology and semantic web
- Knowledge Graphs: What They Are and Why They Matter (Splunk) --- Practical overview with real-world applications in enterprise and security
- Knowledge Graph vs Ontology (PuppyGraph) --- Clear comparison of related concepts that are often confused
- Is a Knowledge Graph a Graph Database? (Neo4j) --- Explains the distinction between the data model and the storage engine
Footnotes
-
Happy, S L. (2025). What Are Knowledge Graphs? A Comprehensive Guide to Connected Data. ML Digest. ↩ ↩2 ↩3 ↩4
-
Ontotext. (n.d.). What Is a Knowledge Graph?. Ontotext Fundamentals. ↩ ↩2 ↩3
-
Knowledge Systems Authority. (2026). Knowledge Graphs: Structure, Use Cases, and Benefits. Knowledge Systems Authority. ↩ ↩2 ↩3
-
Chia, A. (2025). Knowledge Graphs: What They Are and Why They Matter. Splunk. ↩ ↩2
-
Knight, M. (2025). What Is a Knowledge Graph?. Dataversity. ↩