Skip to content

Step 8: Review

13 min · step 8 of 8

Introduction#

Check the ontology against the questions you wrote in step 1, add rules, and run every check.

An ontology is only good if it does its job. This step is where you find out, and where you decide what to change. You can read the full guide to this step in Method.

What you’ll make#

Five of the six competency questions linked to the classes and slots that answer them. You’ll also have two rules from a house guide, one that narrows the other, a clean validate --all with no errors, and one warning you decide about.

Run okb cq link with the question’s number, then the parts of the model that answer it. Link the first five. Leave question 6, the price question, alone:

okb cq link 1 Drink contains Milk
okb cq link 2 Cortado Latte espressoToMilkRatio texture
okb cq link 3 Cappuccino contains
okb cq link 4 variationOf Breve
okb cq link 5 contains Chocolate Mocha
Linked cq.1 → Drink (Class).
Linked cq.1 → contains (Slot).
Linked cq.1 → Milk (Class).
  Tip: cq.1 is one example of a family of questions. Would you also ask the same question about EspressoDrink, or more about Drink (pourOrder, origin, variationOf); the same question about Coffee, Water, Foam, Chocolate, or more about Milk (fatPercent, usedIn)? Add the ones you want (okb cq add "..."), note the rest as out of scope (okb scope --out-of-scope "..."), or keep it narrow.

Linked cq.2 → Cortado (Class).
Linked cq.2 → Latte (Class).
Linked cq.2 → espressoToMilkRatio (Slot).
Linked cq.2 → texture (Slot).
  Tip: cq.2 is one example of a family of questions. Would you also ask the same question about Macchiato, FlatWhite, Cappuccino, or more about Cortado (pullVolumeMl, pourOrder, origin, variationOf); the same question about Breve? Add the ones you want (okb cq add "..."), note the rest as out of scope (okb scope --out-of-scope "..."), or keep it narrow.

Linked cq.3 → Cappuccino (Class).
Linked cq.3 → contains (Slot).
  Tip: cq.3 is one example of a family of questions. Would you also ask the same question about Macchiato, FlatWhite, Breve, or more about Cappuccino (pullVolumeMl, pourOrder, origin, variationOf)? Add the ones you want (okb cq add "..."), note the rest as out of scope (okb scope --out-of-scope "..."), or keep it narrow.

Linked cq.4 → variationOf (Slot).
Linked cq.4 → Breve (Class).
  Tip: cq.4 is one example of a family of questions. Would you also ask more about Drink (pourOrder, origin); more about Breve (pullVolumeMl)? Add the ones you want (okb cq add "..."), note the rest as out of scope (okb scope --out-of-scope "..."), or keep it narrow.

Linked cq.5 → contains (Slot).
Linked cq.5 → Chocolate (Class).
Linked cq.5 → Mocha (Class).
  Tip: cq.5 is one example of a family of questions. Would you also ask more about Drink (pourOrder, origin); the same question about Coffee, Water, Foam, WhippedCream, or more about Chocolate (usedIn)? Add the ones you want (okb cq add "..."), note the rest as out of scope (okb scope --out-of-scope "..."), or keep it narrow.

Add rules#

A fact describes what something is. A rule says what anything of that kind must, should or may do. The strength is its modality: MUST, MUST NOT, SHOULD, SHOULD NOT or MAY. Rules come from a document, so they cite the exact words. Register the café’s house guide, quote two sentences from it, and write a rule for each. Both use MUST, because the guide says “must”. Both are authored rules: you wrote the wording, and the guide backs it up.

okb source add tutorial-src/sources/house-guide.md --id house-guide --title "Vertex Coffee house guide"
okb quote add house-guide "Every milk drink must contain milk or cream."
okb quote add house-guide "A breve must use half-and-half, never whole milk."
Registered source house-guide: Vertex Coffee house guide
Read 2 blocks (2 quotable) under 3 headings.
  Tip: add --repo-url <GitHub URL of this file> so quotes get links to the exact lines.
Next: okb source outline house-guide   (the list of quotable blocks to work through)

Added loc.vertex-coffee-house-guide.1 at Vertex Coffee house guide > Milk drinks, line 5.

Added loc.vertex-coffee-house-guide.2 at Vertex Coffee house guide > Breve, line 9.

The second rule narrows the first. Every milk drink needs milk, and a breve needs one particular milk. That’s a refinement:

okb rule add --authored --name "Milk drinks have milk" --statement "A MilkDrink MUST contain a milk ingredient." --modality MUST --governs MilkDrink --cites loc.vertex-coffee-house-guide.1
okb rule add --authored --name "Breve uses half-and-half" --statement "A Breve MUST be made with HalfAndHalf." --modality MUST --governs Breve --cites loc.vertex-coffee-house-guide.2 --refines "Milk drinks have milk" --adds "The milk must be half-and-half."
okb rule list
Added authored rule rule.milk-drinks-have-milk (MUST): A MilkDrink MUST contain a milk ingredient.
Next: verify it in a fresh context, then okb verify rule.milk-drinks-have-milk --status SUPPORTED|OVERREACH|UNSUPPORTED

Added authored rule rule.breve-uses-half-and-half (MUST): A Breve MUST be made with HalfAndHalf.
rule.breve-uses-half-and-half refines rule.milk-drinks-have-milk (adds: The milk must be half-and-half.).
Next: verify it in a fresh context, then okb verify rule.breve-uses-half-and-half --status SUPPORTED|OVERREACH|UNSUPPORTED

rule.milk-drinks-have-milk [MUST · authored · unverified]
   A MilkDrink MUST contain a milk ingredient.
   governs: MilkDrink · cites: loc.vertex-coffee-house-guide.1
rule.breve-uses-half-and-half [MUST · authored · unverified]
   A Breve MUST be made with HalfAndHalf.
   governs: Breve · cites: loc.vertex-coffee-house-guide.2

A rule starts unverified. Check that each quote supports its rule, then approve them:

okb verify "Milk drinks have milk" --status SUPPORTED
okb verify "Breve uses half-and-half" --status SUPPORTED
okb verify "Milk drinks have milk" --approve
okb verify "Breve uses half-and-half" --approve
rule.milk-drinks-have-milk: SUPPORTED.

rule.breve-uses-half-and-half: SUPPORTED.

rule.milk-drinks-have-milk: approved by a person (was SUPPORTED).

rule.breve-uses-half-and-half: approved by a person (was SUPPORTED).

Last, say which menu items follow which rule. A fact that meets a rule fulfills it:

okb fulfills "Vertex breve" "Breve uses half-and-half"
okb fulfills "Vertex cortado" "Milk drinks have milk"
Vertex breve fulfills rule.breve-uses-half-and-half.

Vertex cortado fulfills rule.milk-drinks-have-milk.

Validate and review#

Run every check, including the ones hidden until now, then ask okb what only a person can judge:

okb validate --all
okb review
✗ 0 error(s)   ! 1 warning(s)   i 6 hint(s)   · all checks

WARNINGS: fix, or record a design decision explaining why not
  ! Competency question cq.6 ("How much does each drink cost?") isn't linked to anything that answers it. [scope-cq-coverage]
      Fix: `okb cq link <cq> <Class|slot>...`, or add what's missing.

HINTS: worth a look
  i 'Drink' has only one direct subclass ('EspressoDrink'). Is a sibling missing, or is the subclass really the same as its parent? [hier-single-child]
      Fix: Add the missing sibling(s), or remove the child and fold it into the parent. If
      neither applies, record a design decision.
  i 'Cappuccino' has only one direct subclass ('Breve'). Is a sibling missing, or is the subclass really the same as its parent? [hier-single-child]
      Fix: Add the missing sibling(s), or remove the child and fold it into the parent. If
      neither applies, record a design decision.
  i 'Latte' has only one direct subclass ('Breve'). Is a sibling missing, or is the subclass really the same as its parent? [hier-single-child]
      Fix: Add the missing sibling(s), or remove the child and fold it into the parent. If
      neither applies, record a design decision.
  i The subclasses of 'MilkDrink' ('Macchiato', 'Cortado', 'FlatWhite', 'Cappuccino', 'Latte') have no disjointness declared. Can anything be more than one of them? [disjoint-consider-siblings]
      Fix: `okb class disjoint A B C`, or ignore it if the siblings can overlap (Dessert Wine
      and White Wine can).
  i No competency question needs these classes (or their parent/child): 'Espresso', 'Ristretto', 'Lungo', 'Americano', 'LongBlack'. [scope-no-unneeded]
      Fix: Link it to (or add) the question that needs it, or remove it.
  i No competency question needs these slots: 'pullVolumeMl', 'pourOrder', 'fatPercent', 'origin'. [scope-no-unneeded]
      Fix: Link it to (or add) the question that needs it, or remove it.

EXPLAINED by design decisions (3)
  · Subclasses of 'EspressoDrink' are named inconsistently: 'MilkDrink', 'SweetenedDrink' include 'drink' but 'PureEspresso' doesn't. [naming-subclass-names-consistent] → d.2
  · Subclasses of 'PureEspresso' are named inconsistently: 'Espresso' includes 'espresso' but 'Ristretto', 'Lungo', 'Americano', 'LongBlack' don't. [naming-subclass-names-consistent] → d.2
  · Subclasses of 'Milk' are named inconsistently: 'WholeMilk', 'CondensedMilk' include 'milk' but 'HalfAndHalf' doesn't. [naming-subclass-names-consistent] → d.4

Learn about any rule: okb explain <rule-id>   ·   add --why for reasons and sources

Review: what only a person can judge (step 8 and anything already visible)

? hier-is-a-means-kind-of (MUST)  For each IS_A edge, say out loud: 'Every <child> is, by definition, a <parent>.' If you hesitate, or the honest word is 'part of' / 'has' / 'usually', it is not an is-a.
   · Every EspressoDrink is, by definition, a Drink?
   · Every PureEspresso is, by definition, an EspressoDrink?
   · Every MilkDrink is, by definition, an EspressoDrink?
   · Every SweetenedDrink is, by definition, an EspressoDrink?
   · Every Espresso is, by definition, a PureEspresso?
   · Every Ristretto is, by definition, a PureEspresso?
   · Every Lungo is, by definition, a PureEspresso?
   · Every Americano is, by definition, a PureEspresso?
   · Every LongBlack is, by definition, a PureEspresso?
   · Every Macchiato is, by definition, a MilkDrink?
   · Every Cortado is, by definition, a MilkDrink?
   · Every FlatWhite is, by definition, a MilkDrink?
   · ...and 18 more (okb review --json)
   Ontology 101 §4.1 Ensuring that the class hierarchy is correct, p.12

? hier-siblings-same-generality (MUST)  For each parent with 2+ children, ask: 'Is any of these a kind of another one?' and 'Would an expert put these on the same level?'
   · EspressoDrink → PureEspresso, MilkDrink, SweetenedDrink: equally general? Is any one a kind of another?
   · PureEspresso → Espresso, Ristretto, Lungo, Americano, LongBlack: equally general? Is any one a kind of another?
   · MilkDrink → Macchiato, Cortado, FlatWhite, Cappuccino, Latte: equally general? Is any one a kind of another?
   · SweetenedDrink → Mocha, ConPanna, Affogato, CafeBombon: equally general? Is any one a kind of another?
   · Ingredient → Coffee, Water, Milk, Foam, Chocolate, WhippedCream, Gelato: equally general? Is any one a kind of another?
   · Milk → WholeMilk, HalfAndHalf, CondensedMilk: equally general? Is any one a kind of another?
   Ontology 101 §4.2 Analyzing siblings in a class hierarchy, p.14

? hier-no-subclass-per-restriction (SHOULD NOT)  For each class created mainly to hold one value of one slot, ask whether it's really just that slot's value.
   · Espresso differs from its parent only by pullVolumeMl = 30. Is it a real kind of thing experts distinguish, or just that value?
   · Macchiato differs from its parent only by origin = "Italy". Is it a real kind of thing experts distinguish, or just that value?
   · Mocha differs from its parent only by origin = "USA". Is it a real kind of thing experts distinguish, or just that value?
   · ConPanna differs from its parent only by origin = "Italy". Is it a real kind of thing experts distinguish, or just that value?
   · Affogato differs from its parent only by origin = "Italy". Is it a real kind of thing experts distinguish, or just that value?
   · CafeBombon differs from its parent only by origin = "Spain". Is it a real kind of thing experts distinguish, or just that value?
   · WholeMilk differs from its parent only by fatPercent = 3. Is it a real kind of thing experts distinguish, or just that value?
   · HalfAndHalf differs from its parent only by fatPercent = 12. Is it a real kind of thing experts distinguish, or just that value?
   · CondensedMilk differs from its parent only by fatPercent = 8. Is it a real kind of thing experts distinguish, or just that value?
   Ontology 101 §4.4 When to introduce a new class (or not), p.16

? hier-class-or-value (SHOULD)  Use decision guide decision.class-or-value on each suspicious class/value.
   · Walk decision.class-or-value on any class that feels like 'just a value', and on any enumerated value that feels like 'a different kind of thing'.
   Ontology 101 §4.5 A new class or a property value?, p.17

? hier-stable-membership (SHOULD)  Could a given instance leave this class and come back tomorrow?
   · For each class: could one particular instance leave it and come back later?
   Ontology 101 §4.5 A new class or a property value?, p.17

? inst-natural-hierarchy-as-classes (SHOULD)  Are any instances 'inside' other instances in the domain (regions, org units, categories)?
   · Slot variationOf links Drink instances to each other. If it expresses 'inside of' / 'kind of', those things may be a hierarchy and should be classes.
   · Are any instances 'inside' other instances in the domain (regions, org units, categories)?
   Ontology 101 §4.6 An instance or a class?, p.18

? inst-granularity (SHOULD)  What are the most specific things that appear in answers to your competency questions? Those should be instances.
   · Instances currently live under: Espresso, Macchiato, Cortado, FlatWhite, Cappuccino, Breve, Mocha, Affogato, Coffee, Water, WholeMilk, HalfAndHalf, Foam, Chocolate, WhippedCream, Gelato. Are these the things your competency questions ask about?
   Ontology 101 §4.6 An instance or a class?, p.18

? slot-domain-fits-all (MUST)  For each slot, check every class it's inherited by. Does each one really have this property?
   · pullVolumeMl applies to EspressoDrink, SweetenedDrink, CafeBombon, Affogato, ConPanna, Mocha, MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato, PureEspresso, LongBlack, Americano, Lungo, Ristretto, Espresso. Does every one of these really have it?
   · espressoToMilkRatio applies to MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato. Does every one of these really have it?
   · texture applies to MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato. Does every one of these really have it?
   · pourOrder applies to Drink, EspressoDrink, SweetenedDrink, CafeBombon, Affogato, ConPanna, Mocha, MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato, PureEspresso, LongBlack, Americano, Lungo, Ristretto, Espresso. Does every one of these really have it?
   · fatPercent applies to Milk, CondensedMilk, HalfAndHalf, WholeMilk. Does every one of these really have it?
   · origin applies to Drink, EspressoDrink, SweetenedDrink, CafeBombon, Affogato, ConPanna, Mocha, MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato, PureEspresso, LongBlack, Americano, Lungo, Ristretto, Espresso. Does every one of these really have it?
   · contains applies to Drink, EspressoDrink, SweetenedDrink, CafeBombon, Affogato, ConPanna, Mocha, MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato, PureEspresso, LongBlack, Americano, Lungo, Ristretto, Espresso. Does every one of these really have it?
   · variationOf applies to Drink, EspressoDrink, SweetenedDrink, CafeBombon, Affogato, ConPanna, Mocha, MilkDrink, Latte, Breve, Cappuccino, FlatWhite, Cortado, Macchiato, PureEspresso, LongBlack, Americano, Lungo, Ristretto, Espresso. Does every one of these really have it?
   · usedIn applies to Ingredient, Gelato, WhippedCream, Chocolate, Foam, Milk, CondensedMilk, HalfAndHalf, WholeMilk, Water, Coffee. Does every one of these really have it?
   Ontology 101 §3 Step 6, Domain and range of a slot, p.11

? scope-cq-families (SHOULD)  For each answered competency question: what's its family (the same question about sibling classes or other instances, and the questions next to it about the same subject)? Would the ontology answer them? Is each one you don't want recorded as out of scope?
   · cq.1 "Which drinks have no milk?": would you also ask the same question about EspressoDrink, or more about Drink: pourOrder, origin?
   · cq.1 "Which drinks have no milk?": would you also ask the same question about Coffee, Water, Foam, WhippedCream, or more about Milk: fatPercent, usedIn?
   · cq.2 "What's the difference between a cortado and a latte?": would you also ask the same question about Macchiato, FlatWhite, or more about Cortado: pullVolumeMl, pourOrder, origin?
   · cq.3 "What goes into a cappuccino?": would you also ask the same question about Macchiato, FlatWhite, or more about Cappuccino: pullVolumeMl, pourOrder, origin?
   · cq.4 "Which drinks are a variation of another drink?": would you also ask more about Drink: pourOrder, origin?
   · cq.4 "Which drinks are a variation of another drink?": would you also ask more about Breve: pullVolumeMl?
   · cq.5 "Which drinks on the menu come with chocolate?": would you also ask more about Drink: pourOrder, origin?
   · cq.5 "Which drinks on the menu come with chocolate?": would you also ask the same question about Coffee, Water, Foam, WhippedCream, or more about Chocolate: usedIn?
   · cq.5 "Which drinks on the menu come with chocolate?": would you also ask the same question about ConPanna, Affogato, CafeBombon, or more about Mocha: pullVolumeMl?
   · For each family you don't want: record it as out of scope (out of scope so far: brewing equipment, coffee beans and roasting).
   Ontology 101 §3 Step 1, Competency questions, p.5

? doc-record-decisions (SHOULD)  Look for multiple inheritance, terminological classes, class-vs-value choices, things deliberately left out, and flagged findings you decided to keep. Does each have a DesignDecision?
   ! Multiple inheritance without a recorded reason: Breve.
   ! Terms left out of scope with no note: tip jar.
   · What would surprise someone reusing this ontology for a different purpose? Is each of those choices recorded?
   Ontology 101 §4.7 Limiting the scope, p.20

? reuse-considered (SHOULD)  Did you look for an industry standard, internal glossary, spreadsheet or schema that already names these things? Is there a system you must interoperate with?
   Ontology 101 §3 Step 2. Consider reusing existing ontologies, p.5

Record answers that needed thought (or that someone might question later): okb decision add ...

Read the output#

  • No errors. An error means something is wrong. How do I read and fix a finding? covers errors, warnings and hints. okb found none.
  • One warning, left on purpose. Question 6 asks “How much does each drink cost?”, but nothing in the model answers it. Either add a price slot, or take the question out. In a real project, you’d decide now. Here it shows what a finding looks like.
  • Hints. Breve is the only child of Latte and of Cappuccino, so okb asks if a sibling is missing. Nothing needs the five pure espresso drinks. Those are prompts to think, not faults.
  • The review list. okb review asks questions no program can answer, like “Is every cortado, by definition, a milk drink?”

Check your work#

Run okb status. Steps 1 to 7 have a tick. Step 8 doesn’t yet, because the price warning is still open and two items need a person to judge them:

okb status
Espresso drinks  · 31 classes · 9 slots · 16 instances · 6 questions

✓ 1. Determine the domain and scope
✓ 2. Consider reusing existing ontologies
✓ 3. Enumerate important terms
✓ 4. Define the classes and the class hierarchy
✓ 5. Define the properties of classes (slots)
✓ 6. Define the facets of the slots
✓ 7. Create instances
▶ 8. Review against your questions, and iterate ◀ you are here
     ○ Every competency question is linked to what answers it
     ? Each question's family has been considered: wanted questions added, the rest recorded as out of scope
     ✓ The whole ontology has no known mistakes
     ○ Every remaining issue is fixed or explained in a design decision
     ? Someone who knows the domain has looked at it

Validator (steps 1–8): ✗ 0  ! 1  i 6   okb validate for details

See the guide for this step: okb step

Common mistakes

  • Treating hints as errors. A hint is a prompt to think. You can accept it and move on.
  • Linking a question to everything. Link only what’s needed to answer it.
  • Writing a rule with no source. okb asks for a quote, so the rule always points back to the words behind it.

Next step#

You linked the questions, wrote two rules and ran every check. For your own subject, repeat these steps with your own scope, questions and terms.

View page source