Level 1: Model the data
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.
On this page
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 mapping from what you already have is mostly vocabulary:
| in the model | in an ontology | in the example |
|---|---|---|
| Dimension | Entity, a thing | Customer, Product |
| Fact row | Event or record | Revenue entry, Contract term |
| Relationship | A sentence | A revenue entry is for one customer |
| Measure | Metric with a definition | Net Revenue (reporting date) |
| (nothing) | Rule | A 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
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
- Is each dimension written down as an entity, with a one-line meaning?
- Is each fact written down as an event or record, with its dates?
- Is every relationship a sentence, including the links that aren't allowed?
- Does every rule have a check?
Draw the star. Then write down what it means.