Data governance
8 min

How to Build a Semantic Layer: Platform-Neutral Steps and What Each Native Layer Leaves Out

Key takeaways

  • Build a semantic layer in seven steps: scope the disputed concepts and metrics, model the concepts, attach the metrics to them, map both to physical columns as approved data, assign an owner and a SHACL shape to each definition, serve one record over SQL, API, SPARQL, and MCP, then sync the catalog and the BI models.
  • Concepts come before metrics. The vendor guides start with the metrics file, and a metrics file holds a customer as a join key. Every metric is a calculation over a concept someone has to define first.
  • Scope to one domain, three to five concepts, five metrics with competing formulas, and one consumer that will switch. Reconciling whose number is right is the work, so scope to the arguments.
  • A mapping is data with a status. Automation proposes each one with a score, an owner approves it, and nothing is authoritative until then.
  • Snowflake semantic views, Databricks metric views, dbt MetricFlow, and Power BI semantic models each document a good metrics layer with agent access. The concept definition, the approved mapping, and the test of the data against the definition are the steps you still build.
In this article
Share

An analytics platform lead at an insurer has until the end of the quarter to build a semantic layer. The warehouse is live. The BI tool has a model. The vendor pages on how to build a semantic layer treat it as a platform task: define the metrics, write the YAML, deploy. This article gives the platform-neutral steps, then reads the documentation for four native layers and says what each gives you and what you still build.

The order matters more than the platform. A build that starts with the metrics file automates the disagreements that already exist. A build that starts with the concepts gives every metric something to be a calculation of.

Build the concepts first, with an owner on each. Attach the metrics to the concepts. Map both to the physical estate as data an owner approves. Validate on every load. Serve one record to every consumer, and let the catalog and the BI models sync from it.

What are the steps to build a semantic layer?

In our post What Is a Semantic Layer? we set out seven steps and the four things the layer has to hold. This article walks each step with the artefact it produces, who signs it off, and the test that says it is done.

The seven steps and their artefacts

StepArtefactWho signs offDone when
1. Pick the disputed concepts and metricsA scoped list: one domain, three to five concepts, five metricsThe domain leadEvery item on the list has a name beside it
2. Model the conceptsClasses, properties, and relationships in OWL and SKOSThe domain expert, with a modeller"Customer" resolves to a class with a definition
3. Attach the metricsEach calculation defined on the concept it measuresThe function that reports itEvery metric names its concept, aggregation, and dimensions
4. Map to the physical estateConcept-to-column mappings held as data, each scored and approvedThe concept ownerNo mapping is authoritative without an approval
5. Assign owners and validationA steward, a version, a review date, and a SHACL shape per definitionThe stewardThe shape runs on every load and the result is visible
6. Serve itOne record over SQL, an API, SPARQL, and MCPThe platform teamEvery answer carries its definition, version, and entitlement
7. Sync the catalog and the BI modelsCatalog entries and BI models that read the approved definitionThe catalog and BI ownersNo rival definition is minted in a description field

Which concepts and metrics do you start with?

Start with one domain and the arguments it already has. The scoping question is which numbers cause meetings. At the insurer that is customer, policy, and claim, plus the five metrics computed three ways: written premium, loss ratio, retention, active customers, and claims frequency. Knowi's how-to page on the same query (undated, read 2026-11-22) puts the cost in one line: "Authoring ten metrics takes days, while reconciling whose numbers are right takes weeks." The reconciliation is the work. Scope to it.

The scoping test

  • One domain. Underwriting, or claims, or finance. A layer scoped to the enterprise ships in no quarter.
  • Three to five concepts. The nouns the five metrics are about.
  • Five metrics. The ones with competing formulas today. A number every team agrees on can wait.
  • One committed consumer. A dashboard, a notebook, or an agent that will read the layer the day it exists.

How do you model the concepts before the metrics?

The concept model is the step the platform guides skip. dbt's own guide to building a semantic layer (published 2024-11-18) lists five steps, and the first is "Define the metrics you need" (dbt Labs). Our step 2 comes before that. Express each concept as a class with a definition, its properties, its relationships, and the rule that says which records qualify. Write it in OWL and SKOS, the W3C standards, so any tool can read it and no tool owns it. Start from a published model where one exists. Our post What Is an Ontology? defines the model itself.

Then attach the metrics. A metrics layer can define a calculation. It cannot define a concept. In a metrics file, a concept is a join key on a table. In the model, it is a class with a rule, and the calculation points at it.

One concept, then one metric on it

  • Concept. Customer: a party that holds at least one policy that has been in force. Owner: a named underwriter.
  • Relationship. A Customer holds a Policy. A Claim is made against a Policy. These are the only joins an agent may take.
  • Metric. Active customers: the count of Customer with a Policy in force at period end. Defined on Customer, so it inherits the rule.
  • Dimensions. Region and segment, drawn from the properties of Customer. A dimension the concept lacks cannot be used.

Our post Semantic Layer vs Ontology: Which One Says What a Customer Is argues why this order holds, from the warehouse side.

How do you map the concepts to the physical estate?

A mapping says where a concept lives. Customer resolves to crm.account and to dw.cust_dim. Active customers computes from dw.fct_policy. Hold each mapping as data with a status, so it can be queried, audited, and refused. Automation proposes most of them: a model reads column names, sample values, and lineage, and scores each candidate. The owner approves it. Until then it is a proposal, and a consumer that reads it should see that. Knowi's page says the same in its own words: AI "cannot decide whether revenue is gross or net or certify that historical SQL reflects approved policy". Our post Ground Truth: SME-Approved vs Inferred Metadata covers what the approval adds.

A mapping record

  • Subject. The concept or metric being mapped.
  • Target. Schema, table, and column, one row per target.
  • Proposed by. The model that proposed it, with its score.
  • Status. Proposed, approved, or retired, with the approver and the date.

Who owns each definition, and what tests it?

Step 5 is where most builds stop short. Three fields turn a definition into something a consumer can cite or refuse, and the third is a test. Write the qualifying rule as a SHACL shape, the W3C Shapes Constraint Language, and run it against the data on every load. The shape for the Customer rule above fits on one line: ex:CustomerShape sh:targetClass ex:Customer ; sh:property [ sh:path ex:holdsPolicy ; sh:minCount 1 ] . A record that fails is reported against the definition it failed. Our post What Is Data Governance for AI? covers who may be an owner when the consumer is a model. Our post What Is Ontology Management? covers keeping the model current after it ships.

Three fields that make a definition refusable

  • Owner. A person, with a successor on file. A team name is a thread.
  • Version and dates. Approved on, review due, version number. An agent can decline an expired one.
  • Shape. The rule, as a test the data runs. A failed test names the definition and the owner.

How do you serve the layer and sync the catalog?

Serve one record over every interface the consumers use: SQL for the BI tool, an API for applications, SPARQL for graph queries, and MCP for agents. Each answer carries the definition it resolved, the version, and the entitlement applied. Our post Semantic Layer and MCP: What the Agent Actually Receives shows what travels with an answer.

Then sync. Our post Metadata Management vs Data Catalog: Keep the Catalog, Govern the Meaning says which product holds what.

Two sync rules

  • The catalog displays, and never defines. Its entry shows the approved definition, the owner, and the version.
  • The BI model consumes, and adds presentation. Its measures read from the layer, so a tooltip and an agent cite the same sentence.

What does each native layer give you, and what do you still build?

Four native layers appear in the searches around this query: Snowflake semantic views, Databricks metric views, dbt MetricFlow, and Power BI semantic models. Each is a good step 3 and step 6 for its own platform. The table reads what their documentation describes, in their own words, and names the steps it leaves to you.

Four native layers, as their own documentation describes them

Native layerWhat it defines, in its own wordsOwner, approval, and validation, as documentedWhat steps 2, 4, and 5 still add
Snowflake semantic views (docs read 2026-11-22)"logical tables that typically correspond to business entities", with relationships, facts, dimensions, and metrics; "Semantic views are considered metadata"OWNERSHIP is a privilege on the view object. Snowflake "verifies that a semantic view complies with a set of validation rules when you define it"; "Relationships work like foreign key constraints"A definition of the entity behind each logical table, with a named owner; mappings held as data; a test of the rows against the definition
Databricks metric views (updated 2026-10-29)"separating measure definitions from the fields (also called dimensions) used to group, filter, and aggregate them"; a YAML with source, joins, filter, fields, and measures"Control access, enable collaborative editing, and manage the metric view lifecycle"; "built-in YAML validation"The concept behind the source, an approval on each mapping, and a rule run on the data
dbt MetricFlow (updated 2026-11-19)"YAML files, where a semantic graph links language to data"; entities are "The join keys of your semantic model"A required owner on a group; elsewhere owner is a meta key that "accepts any key-value pairs"; CI "executes an explain query in the data warehouse" to confirm the SQL runsThe same three, plus an owner the API returns with the definition
Power BI semantic models (updated 2026-04-28)"a source of data that's ready for reporting and visualization": tables, relationships, measures, and row-level securityChanges depend on "ownership of the semantic model"; a certified badge means "an organization-authorized reviewer has certified that the item meets the organization's quality standards"A definition the model reads from, so the certified item and the approved meaning are one thing

Sources: Snowflake's overview and validation rules, the Databricks metric views page, dbt's MetricFlow page, and Microsoft's semantic models and endorsement pages.

The pattern is the same in all four. The native layer holds the metric well. Snowflake says "add it as a tool on an agent"; Databricks lists "Genie Agents" among its consumers. The concept is a logical table, a source, an entity, or a model. The owner is a privilege, a lifecycle setting, a group, or a meta key. Validation checks that the structure is well formed and the SQL runs. Steps 2, 4, and 5 are yours on every platform. Our post Metrics Layer vs Semantic Layer: The Difference Is a Noun takes the metrics file apart row by row.

Where does TopQuadrant fit?

TQ Data Foundation is the record the seven steps produce. Every metric carries its business definition, its owner, its calculation, and its mapping to physical columns. Mappings from governed concepts to physical schemas are explicit, inspectable assets. AI proposes the models and the mappings; your experts confirm them. Each definition is validated with SHACL, a standard TopQuadrant helped author, alongside RDF. We maintain 300 reusable standards-based models, so step 2 starts from governed structure. Queries resolve to Snowflake, Databricks, or Postgres without moving the data. Agents receive concepts, permitted relationships, and metric logic over API, SPARQL, and MCP, and every served answer records the definitions resolved, their versions, and the entitlements applied. Your catalog stays, and it syncs. Our agent-ready semantic layer page shows the record an agent reads.

Start with the five metrics that cause the most meetings. Put a name on each concept before you write a formula. TopQuadrant built TQ Data Foundation to hold that record and serve it. The native layer you already run becomes one of its consumers.

Give your AI the context it's been missing

See how the TQ Data Foundation turns your enterprise knowledge into trusted, Al-ready context.