Competency Questions — Your Spec, Test Suite and Scope Guard

Write the natural-language questions the ontology must answer. Turn each one into a SPARQL test. Stop scope creep dead.

0/3 done

The cheapest artefact you'll ever write

Without CQs, your ontology has no scope

A competency question (CQ) is a natural-language question the ontology must be able to answer once populated. CQs are the cheapest, most powerful artefact in ontology engineering — they serve three roles at once:

  1. Specification — they bound what's in scope.
  2. Test suite — every CQ becomes a SPARQL ASK or SELECT.
  3. Scope guard — anything the CQs don't justify, you don't build.

Anatomy of a good CQ

  • Domain-language, not OWL-language. "Which orders did Alice place last quarter?" not "Find all :Order with :placedBy = :alice ⊓ :placedAt ∈ Q".
  • Answerable by data, not by chat. "What's a good loyalty strategy?" is a CQ for a consultant, not an ontology.
  • Numbered, traceable to one or more classes / properties in the model.

Aim for 20–50 CQs for a domain ontology. Less = under-spec. More = scope creep.

Acceptance tests for ontologies

CQs are the acceptance tests of an ontology project.

In software, no one ships a feature without acceptance criteria; in ontology projects people routinely ship without competency questions and then wonder why the model doesn't do what stakeholders expected. Same disease, same cure: write the test first.

Reading in progress · 0 of 3 activities done