Skip to content
Knowlayer

Knowledge representation

Ontology Engineering

An ontology is an explicit, machine-readable model of what exists in your domain and how those things relate. It is the contract that lets content, graphs, and agents agree on meaning.

The building blocks

Each standard solves a different part of the problem. Using the lightest one that answers your questions keeps the model maintainable.

RDF
Represents facts as subject–predicate–object triples with globally unique IRIs, so data from different systems can be merged without renaming.
OWL
Defines classes, properties, and constraints on top of RDF, and supports inference. It follows an open-world assumption: missing facts are unknown, not false.
SKOS
A lightweight model for thesauri and taxonomies: preferred and alternative labels and broader, narrower, and related links between concepts. Often enough when you need vocabulary, not logic.
Controlled vocabularies
Agreed term lists with owners and change processes. They turn free-text tags into values that retrieval can filter on reliably.
Ontology modeling
Deciding which classes and relations exist. Good scope comes from competency questions: the concrete questions the model must be able to answer.
Reasoning and validation
A reasoner infers new facts from OWL axioms (for example, that every Api is also an Interface). SHACL does the complementary job: it checks that data conforms to the shapes you require.

A small ontology with a validation shape (Turtle)

A small ontology with a validation shape (Turtle)turtle
@prefix kl:   <https://example.org/kl#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh:   <http://www.w3.org/ns/shacl#> .

kl:Product a owl:Class .
kl:Api     a owl:Class .

kl:exposes a owl:ObjectProperty ;
    rdfs:domain kl:Product ;
    rdfs:range  kl:Api .

# SHACL: every API must be documented by at least one document
kl:ApiShape a sh:NodeShape ;
    sh:targetClass kl:Api ;
    sh:property [
        sh:path kl:documentedBy ;
        sh:minCount 1 ;
        sh:message "Every API must be documented by at least one document." ;
    ] .

The namespace is a placeholder. The ontology says what exists; the shape says what must be true of the data.

How an ontology is engineered

  1. 01

    Write competency questions

    For example: which documents describe this API, and which concepts must a reader know first?

  2. 02

    Reuse before inventing

    Start from existing vocabularies such as SKOS, Dublin Core, or schema.org and extend only where the domain demands it.

  3. 03

    Model classes and properties

    Keep the first version small: the entities and relations needed to answer the competency questions.

  4. 04

    Add constraints as shapes

    Express rules such as “every API has at least one document” in SHACL so violations are caught automatically.

  5. 05

    Validate real instance data

    Load actual content metadata and fix the model or the data until the shapes pass.

  6. 06

    Version and govern

    Assign an owner, record changes, and publish versions so downstream tools can depend on the model.

When it earns its cost

Reach for it when

  • Several entity types relate to each other in ways that matter for answers
  • Multiple teams or tools must share one vocabulary
  • You need data checked automatically before it reaches retrieval or agents

Hold off when

  • A flat, governed tag list already answers your questions
  • Nobody will own and maintain the model
  • The domain is small and unlikely to grow