Ontology vs taxonomy vs knowledge graph: what each one is and when you need it
A taxonomy names and groups things, an ontology defines how they relate, and a knowledge graph stores the real data in that shape. A plain comparison with examples.
The three terms are often used as if they meant the same thing. They are layers, each built on the one before, and knowing which layer you are missing saves a lot of wasted work.
The short version
| Taxonomy | Ontology | Knowledge graph | |
|---|---|---|---|
| What it is | A hierarchy of categories | A model of entity types, relationships and rules | Real data stored as connected entities |
| Question it answers | What is this called and where does it belong? | What kinds of things exist and how can they relate? | What is connected to this specific thing? |
| Example | Footwear › Running › Trail shoes | A Supplier provides a Material; a Material is used in a Product | Supplier 118 provides recycled mesh, used in 14 products on 320 open orders |
| Typical form | A tree or a controlled vocabulary | A schema with classes, properties and constraints | Nodes and edges in a graph or relational store |
| Who builds it | Domain experts and content teams | Domain experts with a data architect | Data engineers, from live systems |
Taxonomy: agreeing on the words
A taxonomy is a classification. It organises concepts into categories and subcategories and settles which terms are synonyms. It answers where something belongs and what it is called, and nothing more. A taxonomy cannot tell you that a supplier provides a material, because it has no notion of relationships other than “is a kind of”.
Even so, a taxonomy removes a surprising amount of confusion. When the warehouse, the finance system and the website use three names for one item, an agreed vocabulary is the first fix.
Ontology: defining how things relate
An ontology is a formal model of a domain. It defines the types of entities, their properties, the relationships allowed between them and the constraints those relationships obey. Where a taxonomy has one kind of link, an ontology has as many as the business needs: provides, contains, is certified for, replaces, was ordered by.
Designing an ontology is mostly a conversation with the people who run the business. It forces decisions that were previously left vague, such as whether a product and its colour variant are one thing or two.
Knowledge graph: the model filled with data
A knowledge graph is what you get when the ontology is populated. Each real product, customer and order becomes a node, and each real relationship becomes an edge. The ontology is the blueprint and the graph is the building.
A graph needs pipelines that load it from production systems and resolve entities, so that one real-world thing is one node. Without that it goes stale or fills with duplicates.
Which one do you need?
- Inconsistent naming and categories across systems: start with a taxonomy.
- AI answers that miss related facts, or questions that span several records: you need an ontology and a graph.
- A requirement to explain how an answer was reached: a knowledge graph gives you the path.
- Simple lookups in a small set of documents: none of these. Hybrid search is enough.
How they fit into AI systems
In retrieval-augmented generation the graph is linked to vector search. A query enters through semantic search, lands on the right entities and follows relationships outward. The model then answers from connected, sourced facts. This is ontology-grounded RAG, and it is the approach I used for the AI knowledge layer at Metis Labs.