Data ManagementDatapane.ai

Semantic Layer vs. Ontology: Why Your Data Warehouse Isn't Enough

Data ManagementBack to blog
Read on Medium
Semantic Layer vs. Ontology: Why Your Data Warehouse Isn't Enough

Every enterprise data stack today looks broadly the same. At the bottom there’s a warehouse or lakehouse – Snowflake, Databricks, Redshift, BigQuery – you pick your flavor. Then there’s a modeling layer on top, and now increasingly a “semantic layer” to make all this stuff accessible to humans and, increasingly, to AI agents. Sounds good! In reality, it usually isn’t and the gap between the data stack as designed and the data stack as utilized by actual AI in production is where enterprise AI initiatives typically founder.

The source of the problem stems from an apparent ambiguity between the terms semantic layers and ontologies which are used interchangeably by vendors offering these products to the public, although the two address different issues. The importance of distinguishing between the two will become evident, since the difference turns out to be fundamental for solving the initial task.

What a Semantic Layer Actually Does

A semantic layer is fundamentally a business glossary embedded in your warehouse that maps data to what business users actually care about - it’s how analysts (and AI agents) can query fct_orders_v3 by “revenue” and get an answer in terms of active subscribers by region.

That translation is more important than ever. Recent benchmarking on semantic layers showed that prompting a language model to use a semantic layer resulted in answers that were three times more likely to be correct than answers generated without it (54% correct vs 16% correct). By providing context about the meaning of the columns and how they relate to each other, the semantic layer helps the language model avoid the kinds of mistakes a new analyst might make on her first day

That's indeed valuable and useful, but the problem is that a semantic layer does not tell me which revenue stream to count for a particular revenue and which user cohort to consider active customers for a given period. You define some glossary terms for a particular business process, but that only gives me a single canonical value.

What an Ontology Adds

An ontology goes one step further. The semantic layer is concerned with mapping terms to columns; an ontology is concerned with mapping relationships and constraints - with formalizing how a Customer bears to an Account, how the latter is related to a Contract, what are possible and impossible values for the Contract’s status, and how the meaning of these relationships and terms change with context and point of view. This distinction is actually grounded in academic research on knowledge representation - while a glossary or taxonomy would specify categories and subcategories, an ontology is intended to define a domain of discourse in full, specifying the logical relationships that bind its concepts together.

That completeness is precisely what enterprise AI lacks today. Marketing's "active customer" is someone who has engaged in the last 30 days. Sales says 90, and Finance says 180. All are correct, in the context of their domain. A semantic layer, by design, can capture at most one of them. An ontology is required to frame these views in their proper contexts, understand their interrelationships, and reason about these nuances accordingly - not guess which one was intended.

This is also what causes many well-constructed semantic layers to give rise to AI systems that are confidently wrong: The model isn’t hallucinating, as such; it’s just using a legitimate if inappropriate definition for the question in the context, because nothing in the stack suggested that this was wrong for this particular query.

Why the Warehouse Was Never Going to Solve This

None of this is a knock on Snowflake, Databricks, or Redshift – they’re engineered to do what they do, and do it well. A warehouse’s job is storage, processing, and (increasingly) governance and cataloging – its semantic layer is a translation layer. But neither is engineered to encode organizational context: which definitions take priority where, how concepts relate to one another across domains, and how that context might change over time.

That's the level above the warehouse and semantic layers of your AI system, not replacing them but putting them into context, enabling the kind of reasoning you want from your cognitive systems - rather than simply finding your data for you, telling you what "active customer" means by providing which "active customer" you might be talking about.

The Practical Takeaway

If your company has invested significantly into a semantic layer and it's still producing useless, albeit consistent, results from your AI applications, you're probably thinking about dismissing the semantic layer as ineffective or not comprehensive enough. In truth, the semantic layer was probably performed perfectly, but in all likelihood, there was no ontology layer above it that would've indicated to your AI software what definitions took priority over the others, when they took priority and which definitions had priority over which, in a system where there was never going to be one agreed-upon glossary.

This is the space Datapane.ai has carved out for itself by working with your existing warehouse rather than as an alternative to it.