Introduction#
Write down what the ontology is for, and the questions it must answer.
The scope is the part of the world your ontology covers. Without it, you can’t tell when you’re done. A coffee ontology could cover beans, roasting and farms forever. A competency question is a question the finished ontology must be able to answer, like “Which drinks have no milk?” You can read the full guide to this step in Method.
What you’ll make#
A scope with a domain, a purpose, users and two things left out, plus six competency questions.
Set the scope#
Run the okb scope command. The out-of-scope list matters as much as the rest:
okb scope --domain "Espresso-based coffee drinks and what goes in them" --purpose "Help baristas and customers compare drinks on a café menu" --users baristas,customers --maintainers "head barista" --out-of-scope "brewing equipment" --out-of-scope "coffee beans and roasting"
Espresso drinks
domain Espresso-based coffee drinks and what goes in them
purpose Help baristas and customers compare drinks on a café menu
users baristas, customers
maintainers head barista
out of scope brewing equipment, coffee beans and roasting
kind application
Add questions#
Add each question the way a barista or customer would ask it. The last one asks about price, which you won’t model. You’ll see what okb says about that in step 8:
okb cq add "Which drinks have no milk?"
okb cq add "What's the difference between a cortado and a latte?"
okb cq add "What goes into a cappuccino?"
okb cq add "Which drinks are a variation of another drink?"
okb cq add "Which drinks on the menu come with chocolate?"
okb cq add "How much does each drink cost?"
Added cq.1.
Added cq.2.
Added cq.3.
Added cq.4.
Added cq.5.
Added cq.6.
Read the output#
- okb numbers each question (
cq.1,cq.2and so on). You’ll use the numbers in step 8. - The questions mix kinds (see Why start with questions?): one filters (“no milk”), one compares, one lists ingredients. Good questions pull different parts out of the model.
Check your work#
Run the okb status command. Step 1 should have a tick. Then move on:
okb status
Espresso drinks · 0 classes · 0 slots · 0 instances · 6 questions
✓ 1. Determine the domain and scope ◀ you are here
✓ Domain and purpose are written down
✓ Users (and ideally maintainers) are named
✓ At least three competency questions
✓ At least one thing is explicitly out of 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
Validator (steps 1–1): ✗ 0 ! 0 i 0 okb validate for details
Step 1 looks done. When you're happy with it: okb step next
okb step next
Now on step 2. (To read a step's guide without moving: okb explain 2)
Step 2 of 8: Consider reusing existing ontologies
Goal: Check whether someone has already modeled part of your domain, and decide whether to
borrow, adapt, just reference it, or skip it.
Why it matters: Reuse saves time and makes your ontology compatible with others. If you have
to talk to systems that already use a vocabulary, reuse may not be optional.
Questions to answer
• Is there an industry standard, taxonomy or controlled vocabulary for this domain?
• Does any system you must integrate with already use a particular vocabulary?
• Is there an internal list, spreadsheet, glossary or schema that already names these things?
You're done when
○ Reuse has been considered and recorded
Tips
• Even a glossary page or an existing database schema counts as a source of terms.
• Don't let this step stall you. 30 minutes of looking is usually enough for a first version.
• Where to look: Linked Open Vocabularies (https://lov.linkeddata.es) searches hundreds of
reusable vocabularies by term. schema.org (https://schema.org) covers everyday things: people,
organizations, products, places, events and creative works.
• W3C vocabularies cover common needs: SKOS for taxonomies and thesauri, Dublin Core for
document metadata, PROV-O for provenance, ORG for organizations and OWL-Time for dates and
times.
• For design systems: WAI-ARIA roles (https://www.w3.org/TR/wai-aria/) are a standard taxonomy
of UI components (button, checkbox, switch, tab...). The W3C Design Tokens format
(https://www.designtokens.org) is the standard for tokens. DSDS, the Design System
Documentation Spec (https://designsystemdocspec.org), is a draft schema for documenting
components, tokens and themes.
• You rarely need to import a whole vocabulary. Borrowing its terms and definitions is usually
enough.
In Ontology 101's wine example
Ontology 101 notes a French-wine knowledge base or a wine retailer's list of wine properties
could be imported, but chooses to build from scratch for teaching purposes.
Commands
okb reuse add okb reuse none
Common mistakes
- Fewer than three questions. okb asks for at least three.
- Questions that are really tasks. “Build a menu” isn’t a question the ontology can answer.
- No out-of-scope list. Without it, every idea seems to belong.
Next step#
You wrote down what the ontology is for and six questions it must answer. Next, you’ll check whether someone has already modeled coffee.