Level 1: Model the data

Meaning and rules

You've already built half an ontology. It's your star schema.

Dimensions are the things, facts are the events, relationships are how they connect. An ontology writes down the meaning and the rules on top.

Updated November 2026Example data, not from a client.
On this page
  1. Start from the star you have
  2. Write relationships as sentences
  3. Add the rules
  4. Turn sentences into checks
  5. Where the tools are going
  6. What I check

Ontology sounds like a word for somebody else's job. It isn't. If you've built a star schema, you've already done half of it.

Your dimensions are the things the business talks about: customers, products. Your facts are the events and records: a revenue entry, a contract term. Your relationships say how they connect. What a star schema doesn't hold is the meaning and the rules. Which date counts. Which amounts are revenue. Which connections aren't allowed. An ontology writes those down, in words a person can read and a tool can use.

Start from the star you have

Here's the model from guide 1, labeled the way an ontology would label it.

Figure 1 · Your star schema, relabeled

The guide 1 star schema, labeled as things and events The star schema from guide 1. Customer (PK customer) and Product (PK product) are labeled things, the dimensions. Revenue (PK id, FK customer, FK product, reporting_date, accounting_date, amount) and Terms (PK id, FK customer, FK product, term_start, term_end, amount) are the facts: an event and a record. Each dimension relates one-to-many (exactly one to zero or many) to both facts. The structure is there, but not the meaning. Fact tables have dark headers tagged FACT and dimension tables have green headers tagged DIM. A legend shows the line-end marks: exactly one and zero or many. THING (DIMENSION) Customer DIM PK customer Revenue FACT PK id FK customer FK product reporting_date accounting_date amount Terms FACT PK id FK customer FK product term_start term_end amount Product DIM PK product THING (DIMENSION) The structure is already there. The meaning isn't. exactly one zero or many
Customer and Product are things. Revenue and Terms are events and records about those things. Open full size

The mapping from what you already have is mostly vocabulary:

Star schema to ontology
in the modelin an ontologyin the example
DimensionEntity, a thingCustomer, Product
Fact rowEvent or recordRevenue entry, Contract term
RelationshipA sentenceA revenue entry is for one customer
MeasureMetric with a definitionNet Revenue (reporting date)
(nothing)RuleA term amount is never revenue

The last row is new. A star schema has nowhere to put a rule.

Why bother, if the model already works? Because the model only works for the people who know it. A tool that reads the model sees tables, keys and lines. It doesn't see that Terms holds contract records rather than revenue, or that reporting date is the default. The ontology is where you write down what the people who know it already know.

Write every relationship as a sentence

A line on a diagram says two tables connect. A sentence says what the connection means. For the example:

  • A revenue entry is for exactly one customer and one product.
  • A contract term covers exactly one customer and one product, from a start date (term_start) to an end date (term_end).
  • A customer can have many revenue entries and many contract terms.
  • A revenue entry has a reporting date and an accounting date, and they can differ.
  • Nothing links a revenue entry to a contract term. They only meet through the customer and the product.

The last sentence is the one guide 1 was about. In a star schema it's an absence: there's no line between the facts. In an ontology it's written down, so nobody has to infer it from a missing line.

Figure 2 · The same model as an ontology

The same model as an ontology map: entities, events, sentences and rules Customer (top) and Product (bottom) are entities, drawn as dimensions with green headers tagged DIM. Revenue entry (left) is an event and Contract term (right) is a record, drawn as facts with dark headers tagged FACT. The lines read as sentences: a revenue entry is for exactly one customer and exactly one product; a contract term covers exactly one customer and exactly one product. Each line ends in exactly one at the entity and zero or many at the event or record, as the legend shows, and no lines cross. A crossed dashed line between the two events shows nothing links a revenue entry to a contract term. A rules box lists: revenue uses reporting date unless asked; a term amount is never revenue; no rows, a zero and an unknown date are three different answers. is for covers is for covers Customer DIM entity Product DIM entity Revenue entry FACT event Contract term FACT record Nothing links a revenue entry to a contract term. exactly one zero or many RULES · Revenue uses reporting date unless asked. · A term amount is never revenue. · No rows, zero, unknown date: three answers.
Same four boxes as Figure 1. Now the arrows read as sentences, and the rules have a place to live. Open full size

Add the rules

Rules are the part people carry in their heads. Writing them down is most of the value:

  • Revenue is reported by reporting date unless the question asks for accounting date.
  • A term amount is a recorded contract value. It is never summed as revenue.
  • No rows, a zero and an unknown date are three different answers.

Here's the plain-language map I keep for each entity and event. It's not a formal format. It's the part I'd want written down before anyone picks a tool.

entity: Customer
means: A business that buys from us.
  One row in Customer.
identified_by: customer

event: Revenue entry
means: One recognized revenue entry.
  One row in Revenue.
relationships:
  is for exactly one Customer
  is for exactly one Product
dates: reporting date (default),
  accounting date
rules: Never linked to a Contract term
  directly
check: April 2025, C-001, P-01 = 100.00

Turn sentences into checks

Every sentence is also a test. If it's true, a query looking for rows that break it comes back with zero.

-- "A revenue entry is for exactly one
-- customer and one product."
SELECT COUNT(*) AS broken_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 a start date
-- (term_start) to an end date (term_end)."
SELECT COUNT(*) AS broken_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 doesn't, either the data broke the rule or the sentence was wrong. Either way, you want to know before a report or a tool repeats it.

Where the tools are going Preview

Microsoft Fabric IQ includes an ontology item, in preview as I write this. It can start from an existing Power BI semantic model, keeping its tables, relationships and measures, and lets you add entities, relationships and rules in business terms on top. If you're on Fabric, it's worth a look.

Whatever tool you use, the work is the same. The sentences and the rules come from people who know the business. The star schema you already have is where they start.

What I check before any tool answers from a model

  1. Is each dimension written down as an entity, with a one-line meaning?
  2. Is each fact written down as an event or record, with its dates?
  3. Is every relationship a sentence, including the links that aren't allowed?
  4. Does every rule have a check?

Draw the star. Then write down what it means.

Building this in Power BI?

The Professional Harness gives your coding agent working PBIP examples and checks it reruns until they pass.

See the Professional Harness

Privacy

Related