Ontologies vs Semantic Layers


Ontologies vs Semantic Layers

Hope
So Corey, I asked my data team what 'revenue' means and got three different answers — finance said GAAP-recognized, sales said booked, and the product team said usage-based billing. And they're all right in their own context.

Corey
That's exactly the problem we're tackling. Enterprises have been trying to get a single shared meaning for decades, and two approaches keep coming up: ontologies and semantic layers. But they solve different versions of the 'what does this mean' question.

Hope
Right — an ontology defines what things are and how they relate. A semantic layer defines how things are measured and calculated. One gives you structure, the other gives you numbers. And yes, you need both.

Corey
Let's start with ontology. In data, it's a formal specification of what exists in a domain and how things relate. Think conceptual model: 'customer has accounts', 'account belongs to legal entity'. That's ontology — it defines the possibility space.

Hope
And it's a spectrum. On one end you have a flat glossary — just definitions. Then hierarchical terms like 'customer is a type of party'. Further along, concept models with typed relationships. And at the far end, formal languages like OWL that let machines reason.

Corey
Most teams don't need the far end. They need something in the middle — enough structure to capture relationships, light enough to maintain. A well-organized business glossary with hierarchy and explicit connections. That's the practical takeaway.

Hope
Now semantic layer — that's different. It's an abstraction between raw data and consumers. Its job is to define metrics and dimensions consistently. 'Revenue = sum of completed order amounts excluding tax, converted to reporting currency.' That's a calculation, not a definition of what revenue is.

Corey
And modern semantic layers are more than just BI views. They're declarative, version-controlled, API-accessible. Tools like dbt metrics, Looker ML, Cube — define the metric once, use it everywhere. No more arguing which dashboard has the right number.

Hope
But notice what the semantic layer doesn't cover: it doesn't tell you that GAAP revenue, booked ARR, and usage-based billing are subtypes of a broader revenue concept with different treatments. That structural knowledge lives in the ontology.

Corey
Exactly. Let's lay them side by side. Ontology defines entities, properties, relationships — the nouns and verbs. Semantic layer defines metrics, dimensions, calculation logic — the measurements and aggregations. Ontology answers 'what is X and how does it relate to Y?' Semantic answers 'how do we measure X?'

Hope
And who owns each? Ontology tends to be data architects and governance teams — people thinking about conceptual structure. Semantic layer tends to be analytics engineers and BI teams — people focused on computation and consumption. Different skills, different tools.

Corey
Change propagation is also very different. If the ontology changes — say 'customer' now includes free-tier users — every metric referencing customer is potentially affected. High stakes, deliberate governance. If a semantic layer metric changes — say revenue excludes refunds within 30 days — the impact is specific and traceable through lineage.

Hope
Make it concrete with that SaaS revenue example. The ontology defines three subtypes: GAAP recognized, booked ARR, and bill. Each has distinct properties — recognition schedule, contract term, invoice date. The semantic layer then gives the formulas: recognized revenue = sum of recognized amounts per ASC 606 rules, booked ARR = annualized contract value of active subscriptions, bill revenue = invoiced amounts.

Corey
Without the ontology, the semantic layer might pick one definition of revenue and hide the others — or different teams build their own metrics all labeled 'revenue'. Without the semantic layer, the ontology tells you there are three types but gives no consistent way to calculate them. Structure without logic is taxonomy; logic without structure is metric sprawl.

Hope
So some problems are ontology-first. Example: a healthcare network acquires three regional systems, each defining 'patient encounter' differently — one counts ER visits, another only admitted patients, a third includes telehealth. Before any dashboard, you need to define 'encounter' as a concept with subtypes. That's ontology.

Corey
Other problems are semantic-layer-first. E-commerce company, marketing and finance calculate conversion rate differently. Marketing counts any session with cart addition; finance counts only completed purchases divided by unique visitors. Everyone agrees on what a session, visitor, and purchase are — the measurement logic is the conflict. So unify the metric definitions in the semantic layer.

Hope
And then there's the both case. Financial services firm reporting to multiple regulators — Fed, OCC, CFPB — each wants slightly different definitions of 'exposure' and 'counterparty'. Internally they have a semantic layer for risk dashboards. But regulators want definitions traceable to regulatory ontologies like FIBO. The semantic layer gives internal consistency; the ontology aligns with external standards. And you need a layer that connects both — when a regulator asks 'how do you define counterparty exposure?' the answer traces from regulatory definition through ontology to metric formula to data assets.

Corey
And AI is reshaping this entirely. When an LLM answers 'What was our customer retention rate in Q3?', it needs more than a metric formula. It needs to understand what 'customer' means, what 'retention' means in this business, how customers relate to accounts — that's ontological knowledge. The semantic layer provides the calculation once the LLM knows what to calculate.

Hope
All this points to a practical question: where does this stuff live? Ontological definitions in one system, semantic layer formulas in another, data assets in a third — no connection. That's why the meaning problem persists. The answer is a context layer.

Corey
A context layer is not an ontology tool or a semantic layer — it's the platform where both become discoverable, linked to data assets, and governed consistently. It provides a business glossary with structural capability to capture definitions and relationships — a lightweight ontology. It integrates with dbt, Looker, Tableau to surface metrics and automates linking to the glossary.

Hope
It also maps lineage from raw data through transformations to consumption, showing how meaning flows. And it applies governance — classification, access policy, ownership — consistently across both ontological definitions and semantic layer metrics. That's the integration point.

Corey
Let's talk failure modes. First, starting with a full formal ontology. Teams spend 18 months modeling everything, produce a technically correct artifact disconnected from any tool anyone uses. By the time it's done, the landscape has shifted. Start lighter — a well-structured glossary connected to actual data assets delivers 80% of the value at 20% of the effort.

Hope
Second failure mode: deploying a semantic layer without ontological clarity. Team defines 200 metrics in dbt but without agreement on what underlying entities mean. 'Customer count' in one metric includes free-tier users, in another only paying accounts. The semantic layer faithfully calculates both, and the numbers disagree. Define core entities first — even just 10 terms with clear boundaries.

Corey
Third: building either in isolation from where practitioners work. Definitions in a wiki die; metrics in code invisible to business users only serve engineers. The context layer is what makes both investments usable — a data analyst can search 'revenue', find the glossary definition, see the metric formula, trace lineage, and check who owns it all in one place.

Hope
So the sequence: start with a glossary capturing core entities and their relationships inside the context layer. Connect semantic layer tools so metric definitions surface alongside those entities. Let lineage show how meaning flows from definition to data to dashboard. And govern proportionally — ontological changes get broader review, metric changes get targeted impact analysis.

Corey
We've covered what ontologies and semantic layers each do, where the boundary falls, and how a context layer connects both. Next question most teams face is where to start — specifically how to structure a business glossary that captures enough ontological richness without becoming a two-year modeling project. We'll cover that in the next guide.

Hope
Sounds like a practical next step. For now, the key takeaway: ontologies give you structure, semantic layers give you numbers, and a context layer brings them together so your data governance actually works.

Ask anything
We've read this whole study set, so questions about it get the best answers.