Guide · AI data modeling

Semantic layer vs ontology: governed metrics, or a model of the domain.

A semantic layer defines how business numbers are computed from tables. An ontology defines what the business’s things are and how they relate. AI agents increasingly need both.

This guide takes each apart — entities, dimensions and metrics on one side; classes, relations, rules and actions on the other — shows a real dbt semantic model, places both in the data stack, and explains which one an AI agent should consult for which kind of question.

Updated · 8 sources

Answers “how much?”Answers “what is it, and how does it relate?”
123456
  1. SQL viewOne query, saved. Its logic is copied wherever someone needs it again.
  2. BI tool modelMeasures and joins defined inside one dashboard tool.
  3. Semantic layerMetrics, dimensions and joins defined once, served to every tool and agent.
  4. Business glossaryAgreed definitions in words, linked to tables and owners.
  5. Operational ontologyBusiness objects, their links and the actions that change them.
  6. Formal ontologyClasses, relations and axioms with logical meaning; reasoners infer from it.

What is the difference between a semantic layer and an ontology?

A semantic layer sits between the data warehouse and the tools that use it, defining business metrics, dimensions and joins once so every dashboard, notebook and AI agent computes “revenue” the same way. An ontology models the domain itself — the classes of things, their properties, the relationships between them and the rules they obey. In semantic layer vs ontology, the semantic layer governs calculations over tables; the ontology governs meaning across entities.

Side by side

Semantic layer vs ontology, compared dimension by dimension.

Both promise “define it once, use it everywhere”. They define different things, for different questions.

metrics over tables

Semantic layer

A governed model over analytical tables: which columns join, how each metric aggregates, which dimensions it can be sliced by.

  • Entities as join keys
  • Dimensions and metrics
  • Compiles to SQL
  • Serves BI tools, notebooks and agents
meaning of the domain

Ontology

A model of the business’s things — customers, policies, claims — their relations and the rules or actions that apply to them.

  • Classes and instances
  • Typed relations
  • Constraints and inference
  • Serves integration, apps and agents
A metric: claims paid, loss ratioUnit of definitionA class: Claim, Policy, Vehicle
Joins between tables via keysRelationshipsNamed relations with meaning: filedUnder, covers
“Loss ratio by region last quarter?”Typical question“Which claims involve a vehicle on a lapsed policy?”
Numbers, sliced and aggregatedOutputEntities, links, inferred facts, actions
Analytics engineersBuilt byDomain experts and knowledge engineers
Vendor formats; an open spec under wayStandardsW3C OWL 2, RDF, SHACL
Semantic layer anatomy

What a semantic layer defines: entities, dimensions and metrics.

dbt’s semantic models, Cube’s data model and AtScale’s universal semantic layer use different words for the same parts. AtScale’s definition is the shortest: a layer between your data warehouse and the tools that access it.

A semantic layerbusiness logic defined once, compiled to SQL for every consumer
Entitiesjoin keys — primary, foreign, unique, natural
Dimensionstime and categorical ways to slice
Metricssimple, ratio, cumulative, derived, conversion
Joinsworked out from entities, not hand-written per report
Viewsthe curated facade consumers query
Access ruleswho may see which rows and metrics
Cachingpre-computed results for common queries
APIsSQL, REST, GraphQL — and MCP for AI tools
A dbt semantic model (YAML, abridged)
models:
  - name: fact_claims
    semantic_model:
      enabled: true
    agg_time_dimension: paid_date
    columns:
      - name: claim_id
        entity: { type: primary, name: claim }
      - name: policy_id
        entity: { type: foreign, name: policy }
      - name: paid_date
        granularity: day
        dimension: { type: time }
      - name: line_of_business
        dimension: { type: categorical }
    metrics:
      - name: claims_paid
        type: simple
        agg: sum
        expr: paid_amount

dbt’s five metric types

  • SimpleAn aggregation over one column: sum of paid amount.
  • RatioA numerator metric over a denominator metric: loss ratio.
  • CumulativeA simple metric accumulated over a window: claims paid, rolling 7 days.
  • DerivedA calculation over other metrics: net of recoveries.
  • ConversionA base event followed by a conversion event for the same entity within a period.
Ontology anatomy

What an enterprise ontology adds: objects, links and actions.

A formal ontology (OWL 2) gives classes and relations logical meaning. Operational ontologies, such as the one in Palantir Foundry, add the other half: the actions that change those objects, so decisions write back to the model.

An operational ontology at work
  1. Objectsclaims, policies and vehicles, mapped from source tables
  2. Linksclaim filed under policy; policy covers vehicle
  3. Decisiona person or an agent reads the linked objects and decides
  4. Actiona governed change: approve the claim, flag the policy
  5. Write-backthe change lands on the objects, with who and why

the changed objects are what the next decision sees

what exists

Semantic elements

Objects, properties and links — Palantir’s term for the part that describes the business’s entities and relations.

what changes

Kinetic elements

Actions and functions — the governed operations people and applications use to change those entities.

How they fit

Where a semantic layer and an ontology sit in the data stack.

They are not rivals for the same slot. A mature stack often has both: the ontology names the entities, the semantic layer computes over the tables those entities live in.

From the question down to the source
01
People and AI agentsdashboards, notebooks, assistants, workflows
consumers
02
Semantic layergoverned metrics and dimensions, compiled to SQL
how much
03
Ontology or knowledge graphentities, relations, rules and actions
what it is
04
Warehouse or lakehousemodelled tables
storage
05
Source systems and documentsapplications, files, messages
origin

The two meet at the entity. A semantic layer’s customer entity and an ontology’s Customer class should name the same thing, with the same identifier. When they do, an agent can find the right customers through the ontology and compute their numbers through the semantic layer. The Open Semantic Interchange, an open-source initiative Snowflake announced with partners in September 2025, is working on a vendor-neutral semantic model specification so those definitions can move between tools.

Semantic layer vs ontology for AI

Semantic layer vs ontology for AI agents: which to consult for which question.

An agent that writes SQL against raw tables guesses at joins and definitions. dbt’s documentation describes connecting AI tools through its MCP server so answers use governed metrics instead of guessing at raw tables. The same logic applies to entities and an ontology.

What is the agent asked?

A number over time or by segmentQuery the semantic layer: the metric and its dimensions are defined, joined and secured already.
Which things meet a condition across relationsQuery the ontology or knowledge graph: follow typed links between entities.
To change somethingUse the ontology’s governed actions — or the system’s own API — with an approval where the change matters.Read more →
What a document saysNeither alone: retrieve and cite the passage, or extract the value into a typed field first.Read more →

The symptom, and which one fixes it

  • Two dashboards disagree on one metricA semantic layer: define the metric once.
  • Agents write wrong joinsA semantic layer, exposed to the agent as tools.
  • Teams use one word for different thingsA glossary first, then an ontology if the relations matter.
  • Questions cross many systemsAn ontology that maps each system’s records to shared entities.
  • Decisions must write backAn operational ontology with governed actions.
On Botminds

How Botminds gives people, agents and systems one set of names.

On Botminds the labels and fields of a collection serve as the semantic layer for data read from documents: the names reviewers see, the fields agents return, the columns of every view and the parameters of every API call are the same words.

01

Views

Saved grids — columns, filters, sort and who may see them — plus summary and score views.

02

Datasheets

Reference tables agents look things up in: databases, spreadsheets, APIs, views and forms.

03

Agents

An intake agent receives the collection’s fields as its output schema.

04

APIs and pages

Your systems read the same fields through the API; pages show them on cards.

Relations, too. Link fields join one register to another — vendors to payments — and parent and child collections keep invoices and their lines connected. Read AI data modeling and the Academy lesson on collections and schema.

Questions people ask

Semantic layer vs ontology: common questions.

The technology behind itAI data modelingFrom documents to typed, searchable records
Is a semantic layer the same as an ontology?

No. In semantic layer vs ontology, a semantic layer defines how metrics are computed from analytical tables — joins, aggregations, dimensions — while an ontology defines the domain’s entities, relations and rules. They overlap at entities and work best when they share identifiers.

What is a semantic layer?

A layer between the data warehouse and the tools that use it, where metrics, dimensions and joins are defined once. Every dashboard, notebook and AI agent then queries the same definitions instead of re-deriving them.

What is the difference between a semantic layer and a knowledge graph?

A knowledge graph stores entities and their relationships as connected data, usually organised by an ontology. A semantic layer stores no data of its own; it translates metric requests into SQL over existing tables.

What is the difference between a semantic model and an ontology?

In dbt, a semantic model describes one table’s entities, dimensions and metrics for computation. An ontology describes classes of things and their relations across the whole domain, with formal meaning.

Why do AI agents need a semantic layer?

Without one, an agent writes SQL against raw tables and guesses joins and definitions. With one, it asks for a governed metric by name and gets the number every other tool would give.

Do I need both a semantic layer and an ontology?

If your questions are mostly metrics over a warehouse, a semantic layer is enough. If they cross many systems, depend on relations between entities or must trigger actions, an ontology earns its place too.

What is the Open Semantic Interchange?

An open-source initiative Snowflake announced on 23 September 2025 with partners including Salesforce, dbt Labs and RelationalAI. Its aim is a vendor-neutral specification for semantic models, so metric definitions can move between tools.

See it on
your own work.

Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.