Skip to main content
Concept
A semantic layer is a set of shared definitions, such as “active customer” or “monthly revenue”, that sits between raw tables and the tools that query them. Think of it as a company recipe book: everyone who bakes “monthly revenue” follows the same recipe, so every dashboard, spreadsheet, and AI assistant gets the same number. It translates business terms into the joins, filters, and sums the tables need.

Learning objectives

After reading this article you will be able to:
  • Describe what a semantic layer defines: entities, dimensions, and metrics
  • Explain the problem it solves for reports and AI tools
  • Compare a semantic layer with an ontology
  • Decide when you need one, the other, or both

What does a semantic layer define?

It defines the business entities the tables describe, the attributes you group and filter by, and the metrics you compute, each as a reusable, named definition. A query tool asks for “monthly recurring revenue by plan for last quarter”, and the semantic layer turns that into the SQL that joins, filters, and aggregates the right tables.

Why do companies use a semantic layer?

Because without one, every team writes its own version of each metric. Finance counts revenue when an invoice is paid, sales when a contract is signed, and two dashboards disagree in the board meeting. A semantic layer defines the metric once, so every tool computes it the same way. It also helps AI. A language model asked to write SQL against raw tables has to guess what “active customer” means and how tables join. Giving it named metrics and join paths instead makes its answers consistent with the company’s own reports, a form of grounding similar in spirit to retrieval-augmented generation (RAG).

Try Helix Foundry

Connect your company’s data into one ontology in HelixDB, and ask it questions with cited answers.

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

A semantic layer is about numbers: how to compute metrics consistently from tables. An ontology is about things and how they connect: which entities exist across every system, how they link, and the rules they follow. One answers “what was revenue last quarter?”; the other answers “which customers with an open complaint have a contract renewing soon, and where does each fact come from?” They overlap. Both name business entities and hide table details from the people and tools that ask questions. Some ontologies define metrics, and some semantic layers model entity relationships. The difference is emphasis: aggregation over clean tables versus connection across messy sources.

When do you need a semantic layer, an ontology, or both?

Choose by the questions you ask most.
  • A semantic layer suits teams whose data already sits in one warehouse with clean keys, and whose main questions are metrics: revenue, retention, usage over time.
  • An ontology suits data spread across many systems and documents, where the hard part is knowing that records refer to the same customer, following connections, and citing sources. It is also the shape that GraphRAG and AI agent memory build on.
  • Both suit companies that need consistent reporting and connected, cited answers. The ontology resolves who is who and what links to what; metrics are then computed over its entities.

How does Helix Foundry relate to a semantic layer?

Helix Foundry builds an ontology, not a semantic layer, but covers some of the same ground:
  • One shape across sources. An ontology’s types, links, and rules span the databases, apps, and documents you connect, and its loads write them into a HelixDB database, with every value naming the row or quote it came from.
  • Questions in plain words. Founder answers questions about a load step by step and cites each record, table row, quote, and rule it used.
  • Saved queries. A dashboard is a page of tiles, each one saved query over an ontology’s load, read live by whoever opens it, so it never shows anyone more than they may read.

Frequently asked questions

Is a semantic layer the same as a data model?

Not quite. A data model describes how tables are structured. A semantic layer adds business meaning on top: named metrics, dimensions, and the joins between them.

Is a semantic layer the same as a metrics layer?

A metrics layer is the part of a semantic layer that defines metrics. The terms are often used interchangeably, though a semantic layer usually also covers entities and dimensions.

Does a semantic layer store data?

Usually not. It stores definitions and compiles queries that run where the data lives. Some add caching or pre-aggregated tables for speed.

Can an ontology replace a semantic layer?

For connected questions and cited answers, often yes. For heavy metric reporting over a warehouse, a semantic layer is usually the better fit, and the two can work together.

What is an ontology?

Shared types, links, and rules for data from many systems.

What is entity resolution?

Deciding when records from different systems are the same thing.

What is a knowledge graph?

Connected facts organized by an ontology, with their sources.

Graph vs relational database

When connected questions outgrow joins.

What is data provenance?

Recording where every value came from, so answers can be checked.

What is GraphRAG?

Retrieval that follows relationships, compared with vector RAG.