Introduction#
Decide what your ontology is for, and write down the questions it must answer.
Without this, you can’t tell when you’re done. An ontology about “wine” can grow forever. An ontology that must answer six specific questions has an end. What it covers, and what it leaves out, is its scope. You can read the full guide to this step in Method.
What you’ll make#
A written scope (domain, purpose, users, what’s left out) and six competency questions. A competency question is a question your ontology should be able to answer. You’ll use them to test your work in step 8.
Run the commands#
Set the scope first. The Ontology 101 example covers wines, foods and which pairings are good. Winery inventory and restaurant staff are out:
okb scope --domain "Wines, foods, and which wines go well with which foods" --purpose "Suggest good wine and food combinations for a restaurant menu and answer diners' questions" --users diners,waiters --maintainers sommelier --out-of-scope "winery inventory" --out-of-scope "restaurant staff"
Wine and Food
domain Wines, foods, and which wines go well with which foods
purpose Suggest good wine and food combinations for a restaurant menu and answer diners' questions
users diners, waiters
maintainers sommelier
out of scope winery inventory, restaurant staff
kind application
Now add the questions. Write each one the way a diner or a waiter would ask it:
okb cq add "Which wine characteristics should I consider when choosing a wine?"
okb cq add "Is Bordeaux a red or white wine?"
okb cq add "Does Cabernet Sauvignon go well with seafood?"
okb cq add "What is the best choice of wine for grilled meat?"
okb cq add "Which characteristics of a wine affect its appropriateness for a dish?"
okb cq add "Which wines does a given winery produce?"
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 those numbers in step 8 to link each question to the parts of the ontology that answer it. - The out-of-scope list matters as much as the scope. When someone asks “is the vintage year in scope?” later, you can point at the list.
- Look at what the questions ask for. They’re competency questions, and each one names a part the ontology needs. “Is Bordeaux a red or white wine?” needs a class called Bordeaux. “Which wines does a winery produce?” needs a link between wines and wineries. The questions already hint at the model.
Check your work#
okb status shows each step and what it still needs:
okb status
Wine and Food · 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
Step 1 has four checks, and all of them have a tick. When you see “Step 1 looks done”, move on. This prints the guide for step 2:
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, because one or two don’t test much.
- Questions that are really tasks. “Build a menu” isn’t a competency question. “Which wine goes with this dish?” is.
- 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 anyone has already modeled wine, so you don’t start from scratch.