Level 2: AI layer
Meaning before the model: build the ontology from evidence.
Most teams draw their business concepts from memory in a workshop. Start instead from what the systems already say, draft short cards, and have an owner sign each one.
On this page
Every semantic model, metric layer and AI route in this series rests on one thing: an agreed meaning for the data. What is a revenue entry? What is a contract term? Which date counts? If nobody has written that down, every tool will guess, and each one will guess a little differently.
The written-down meaning has a name: an ontology. It lists the things the business talks about, the events and records about them, how they relate, and the rules that hold. It sounds academic. In practice it's a short stack of cards.
Why a whiteboard isn't enough
The usual way to build one is a workshop. People draw boxes from memory, argue about names and leave with a diagram. The diagram is tidy and often wrong, because memory is the least reliable source in the room.
The real definitions are already written down, just not in one place. They live in the SQL that builds the tables, in the measure formulas and workbook calculations, in the reports people actually open, and in the tickets where someone asked why two numbers didn't match. That pile is the evidence. Read it first.
Diagram · Meaning before the model: build the ontology from evidence
Read the evidence first
Start with the five business nouns people argue about most. For our example that's revenue, contract term, customer, product and “the date.” For each one, collect what you can point to: the view or query that builds it, every formula that totals it, the reports where it shows up, and any incident where it was disputed.
This is the part where tools help. An AI coding assistant is good at searching a repository for every place a column is used, tracing a view back to its sources, and listing the calculations that touch it. It can draft a first summary in minutes. What it can't do is decide what the business means. It can only report what the systems do.
Reading the evidence turns up things nobody mentions in a workshop. In the example, the revenue view carries two dates. This query shows the row where they disagree:
-- One revenue row, two different months, -- depending on which date you read. SELECT id, reporting_date, accounting_date, amount FROM revenue WHERE substr(reporting_date, 1, 7) <> substr(accounting_date, 1, 7);
| id | reporting_date | accounting_date | amount |
|---|---|---|---|
| R-001 | 2025-04-01 | 2025-05-01 | 120.00 |
Result on the example. Example data, not from a client.
R-001 belongs to April on one date and May on the other. That's why April revenue can be 100.00 or -20.00, as guide 1 showed. A workshop would have written “revenue has a date.” The evidence says it has two, and the card has to say which one each report uses.
Draft concept cards
Write one card per concept. Keep it short enough to review in a minute:
| Field | Entry |
|---|---|
| Means | One recognized revenue occurrence for one customer and one product. |
| Is not | A contract term. A term amount is never revenue. |
| Identifier | id (one row per entry) |
| Dates | reporting_date for the revenue report; accounting_date for the books |
| Evidence | the view that builds revenue; the monthly revenue report; the ticket where April was argued over |
| Owner | the person who signs off on the revenue number |
Example data, not from a client. The evidence names are placeholders for your own files and reports.
Two lines do most of the work. The is not line names the thing people confuse it with. The evidence line points to a source. If you can't fill in the evidence line, you don't have a definition yet, only an opinion. Leave that card out.
Notice what the cards separate. Customer and product are the things. A revenue entry is an event that happened to them. A contract term is a record about them. That split is the same one a star schema makes between dimensions and facts, which is why guide 6 called the star schema half an ontology. The cards add the meaning and the rules.
Owner review
Every card goes to a named person who owns that meaning, usually whoever answers for the number in a meeting. They do one of two things: sign it, or send it back. A card with no evidence goes back to draft, however obvious it seems. A signed card is the definition everything later in this series builds on: the keys and joins in part 2, the metric contract in part 3, the catalog an AI tool reads in part 4.
I keep the signed cards next to the model, in the same repository, and change them the same way: on purpose, with a reason and the owner's sign-off.
Diagram · Signed ontology: what the owner approves
Turn sentences into checks
A card is only useful if the data obeys it. The relationship and rule sentences translate directly into queries that should return nothing:
-- "Each revenue entry is for one known -- customer and one known product." SELECT COUNT(*) AS orphan_revenue_rows FROM revenue r LEFT JOIN customer c ON c.customer = r.customer LEFT JOIN product p ON p.product = r.product WHERE c.customer IS NULL OR p.product IS NULL; -- "A contract term runs from term_start to -- term_end, and starts first." SELECT COUNT(*) AS bad_term_rows FROM terms WHERE term_start IS NULL OR term_end IS NULL OR term_end < term_start;
Both return 0 on the example. When one stops returning 0, either the data broke the rule or the rule was wrong. Both are worth knowing before anyone builds on the card. Guide 7 shows how to run checks like these every time the model changes.
Some rules can't be checked this way. “A term amount is never revenue” is a rule about how numbers may be used, not about the rows. That one gets enforced later, in the metric definition and the tool, which is where parts 3 and 6 pick it up.
What I check before anyone models a concept
- Does each card have a one-line meaning and an “is not” line?
- Does each card point to evidence: a file, a view, a report or a ticket?
- Does each card name its identifier and, for events, which date it uses?
- Has a named owner signed it, and do its sentences pass as checks?
Meaning first. Then the model.
Related
- Keep the evidence and decisions between agent sessionsProject Wiki
- All 8 parts of this seriesSeries overview
- All the diagrams in one placeDiagrams
- Level 1: Model the data (7 guides)Read level 1
- The 4-question checklistChecklist