본문으로 건너뛰기
5 min

Semantic Layer

Explains what the semantic layer translates between a natural-language question and the underlying data.

People ask about "last month's contract value" while the data holds columns such as amt_krw and ctr_dt. The Semantic Layer is where that reading is written down in advance. Once you fix which expression points to which column and metric, the same question stops being interpreted differently each time.

The Semantic Layer is not one file but three resources. Tables decide which columns of a physical table are exposed to queries and what they mean, dictionaries connect the words people use to stored values, and query templates predefine question shapes that come up often. When the layer is empty the model guesses at column names and values, and the same question yields different answers.

The cost of guessing

Without this layer a model infers column names and values from context. Guesses are often right, and the problem is that a wrong one is hard to notice.

When the model chooses between amt_krw and amt_total for contract value, the answer arrives as a plausible number. That it picked the wrong column does not surface until someone verifies the figure. Ask again and it may pick differently, and yesterday's answer no longer matches today's. The Semantic Layer is not a device for nudging accuracy upward but one for pinning the reading in a single place so answers stop drifting.

Three resources, three translations

Each resource closes a different gap.

ResourceGap it closesExample
TablesBetween a physical column and its meaningExpose amt_krw to queries and record it as the contract value
DictionariesBetween the words people use and stored valuesThe phrase Data Platform team points to the code T-01
Query templatesBetween a recurring question shape and the actual lookupPredefine a common shape such as contract value aggregated by client

Tables without dictionaries pick the right column and miss on the condition value. Dictionaries alone leave open which table to read. A question is only translated end to end when all three are in place.

How it differs from the ontology

Both layers attach meaning to data, but they face in different directions.

An ontology settles what the data is and how it connects, and it holds regardless of the words people use. The Semantic Layer settles the translation between human phrasing and the data. When two organisations call the same concept by different names, only the Semantic Layer differs while the ontology stays as it is.

The two are therefore not alternatives. A tidy ontology gives the Semantic Layer a clear target, and the Semantic Layer makes that structure reachable in natural language.

What to include and what to leave out

Start with the expressions that recur in questions. Contract value, team, headcount — whatever the organisation says daily comes first. Filling the layer with one-off phrasings adds maintenance without improving consistency.

Expressions whose definitions differ need agreement before they are added. If contract value including early terminations and contract value excluding them vary by team, publishing one of them without settling the difference produces a wrong answer consistently. The Semantic Layer records an agreement; it does not substitute for reaching one.