← Back to list

Part 1: What Is an Ontology? Classes, Properties, and Axioms

A series of articles on semantic foundations for goal-directed intelligence: Table of Content

Yuan An, PhD · 2026-06-11 21:03 · 0 claps · 8.5 min read paywalled
#ontology #knowledge-graph #rdf-and-owl #ontology-and-agents #ontology-agent-semantics
Open on Medium ↗
Wiki topics: AGT · AI Agents PHI · Philosophy LNG · Linguistics & Language

Part 1: What Is an Ontology? Classes, Properties, and Axioms

A series of articles on semantic foundations for goal-directed intelligence: Table of Content

What you will learn

  • Define ontology in the AI and knowledge engineering sense, not the philosophical one alone
  • Distinguish the four building blocks: classes, individuals, properties, and axioms
  • Place RDF, RDFS, and OWL in a single technology stack
  • Explain the Open World Assumption and why it matters for agents reasoning under incomplete information
  • Read a basic Turtle snippet and recognize when an ontology beats a relational schema

1. From Aristotle to OWL: what “ontology” means in AI

In philosophy, ontology is the study of what exists: the categories of being and how they relate. Aristotle sorted the world into substances and their properties, and that instinct to carve reality at its joints is exactly what we borrow. In computer science we lowercase the word and make it concrete. An ontology is a formal, shared, machine readable specification of the concepts in a domain and the relationships between them. The classic one line definition, from Tom Gruber, calls it a “formal specification of a shared conceptualization.”

Pull that definition apart. Formal means written in a logic with precise semantics, so a machine can draw conclusions rather than guess. Shared means it is an agreement, a vocabulary many systems commit to, not one program’s private data model. Conceptualization means it describes the ideas in a domain, the kinds of things and how they connect, independent of any single dataset.

Why build one? Three families of use cases recur. The semantic web publishes data that other systems can interpret without a human in the loop. Knowledge bases give organizations a single, consistent vocabulary for facts that would otherwise drift apart across departments. And AI reasoning systems use ontologies so an agent can infer facts that nobody wrote down explicitly. That last case is the spine of this series. Across eighteen articles we evolve one ontology, SCIMA-OWL, for a city infrastructure agent, and watch it grow from the handful of classes in this article to a full stochastic, versioned, multi-agent system.

2. The four building blocks

Almost everything in an ontology is one of four things. Get these straight and the rest of the stack falls into place.

Classes (concepts). A class is a category, a set of things that share a kind. TrafficLight and PowerNode are classes. Classes form a hierarchy: TrafficLight is a subclass of InfrastructureEntity, which means every traffic light is, by definition, an infrastructure entity.

Individuals (instances). An individual is a specific thing in the world, a member of one or more classes. The physical signal at a particular corner is the individual sensor:A42; one stretch of road is road:Main-St-Northbound. Classes are the kinds; individuals are the actual occupants.

Properties (relationships and attributes). Properties connect things. Object properties link two individuals, for example locatedOn relating a traffic light to a road segment. Datatype properties attach a literal value to an individual, for example hasSpeedLimit relating a road segment to the integer 50. Object properties build the graph; datatype properties decorate its nodes.

Axioms (the logical rules). Axioms are the statements that give an ontology its reasoning power. A subclass axiom says one class sits under another. A domain and range axiom constrains which kinds of things a property may connect. A cardinality axiom says how many times a property may apply. A disjointness axiom says two classes can share no members, for example a node cannot be both a RoadSegment and a PowerNode. Axioms are what let a reasoner conclude things you never stated outright.

Figure 1: The four building blocks in one SCIMA fragment: classes (purple), individuals (amber ellipses), properties (green arrows), and the axioms that bind them.

Figure 1: The four building blocks in one SCIMA fragment: classes (purple), individuals (amber ellipses), properties (green arrows), and the axioms that bind them.

3. The technology stack: RDF, RDFS, OWL

These three standards stack on top of each other. Each layer adds expressive power while staying compatible with the one below it.

RDF (Resource Description Framework) is the data model. Every fact is a triple: subject, predicate, object. “Sensor A42 is located on Main Street” becomes (sensor:A42, locatedOn, road:Main-St). Subjects and predicates are identified by IRIs, globally unique names, so two systems that use the same IRI are talking about the same thing. Objects are either IRIs or literal values like numbers and strings.

RDFS (RDF Schema) adds a thin schema vocabulary on top of RDF. With RDFS you can declare classes, subclass relationships, and the domain and range of properties. It is enough to express a taxonomy and a few basic constraints.

OWL (Web Ontology Language) adds the expressive axioms that make automated reasoning useful: disjointness, cardinality, property characteristics like transitivity, equivalence, and complex class definitions. OWL comes in profiles. OWL DL stays inside a decidable description logic, so reasoning is guaranteed to terminate, which is what production knowledge systems usually target. OWL Full trades that guarantee for maximum flexibility. SCIMA-OWL stays in OWL DL throughout this series.

We write all of this in Turtle, a compact, readable RDF syntax. The snippet in Section 6 is your first taste. The key habit to build now: a prefix like scima: is shorthand for a long IRI, and every statement still reduces to triples underneath, no matter how tidy the syntax looks.

4. Open World versus Closed World

This single design choice separates ontologies from the databases most engineers grew up with, and it changes how an agent should think.

A relational database uses the Closed World Assumption. If a fact is not in the table, it is treated as false. Ask “is sensor A42 faulty?” and a database that has no such row answers a confident “no.”

OWL uses the Open World Assumption. If a fact is not stated, it is simply unknown, not false. The absence of “A42 is faulty” means we have not been told either way. A reasoner will only conclude A42 is not faulty if an axiom forces it, for example a statement that A42 is Operational and that Operational is disjoint from Faulty.

For a city agent acting on partial, lagging sensor data, the Open World Assumption is the honest default. A silent sensor does not mean the road is clear; it means we do not know. This humility about missing information threads through the entire series, from staleness and Age of Information later on to belief revision. It also shapes query semantics: a SPARQL query that finds no match is reporting absence of recorded knowledge, not proof of falsehood.

5. Why ontologies matter for AI agents

A relational schema could store much of what SCIMA-OWL stores. So why reach for an ontology? Three reasons, each one a recurring theme later in the series.

A shared vocabulary across heterogeneous agents. SCIMA runs zone agents, a dispatcher, and a coordinator, fed by twelve different data sources. When all of them commit to the IRI scima:TrafficIncident, there is no ambiguity about what that term means. The ontology is the contract.

Automated reasoning. A description logic reasoner can perform subsumption (deciding that every Ambulance is an EmergencyVehicle without you listing it) and consistency checking (flagging when your axioms contradict each other). Later in the series this becomes a planning superpower: ask for "any EmergencyVehicle" and the reasoner expands it to every matching type.

Explainability. Because every conclusion traces back to explicit axioms, you can ask the system why it believes something and get a derivation, not a shrug. For an agent dispatching crews to emergencies, that audit trail is not a luxury.

Here is the contrast made concrete for a single traffic sensor, SQL relational schema versus OWL ontology.

Modeling a “kind”

  • SQL: a sensors table with a type column
  • OWL: a class hierarchy, TrafficCamera under SensorDevice

Missing data

  • SQL: closed world, an absent row means false
  • OWL: open world, an absent fact means unknown

Adding a new subtype

  • SQL: a schema migration, often an ALTER TABLE
  • OWL: add one subclass axiom, existing queries still work

Cross system meaning

  • SQL: column names are local conventions
  • OWL: IRIs are globally shared identifiers

Inference

  • SQL: only what queries compute explicitly
  • OWL: a reasoner derives implied facts from axioms

Ontologies are not a universal replacement for databases. For high volume transactional writes a relational or document store still wins. Ontologies earn their place where meaning, inference, and integration across sources matter more than raw write throughput.

6. SCIMA-OWL v0.1: the first walkthrough

Meet SCIMA, the SmartCity Infrastructure Management Agent. SCIMA manages traffic, energy, water, emergency services, and transit across a city, and its knowledge lives in an ontology we will grow across this whole series. Version 0.1 is deliberately tiny: a core class hierarchy and the few properties that connect it. There is no data yet, only schema. The next article will populate it with tens of thousands of sensor nodes.

Here is the v0.1 schema in Turtle.

# SCIMA-OWL v0.1: core classes and properties
@prefix scima: <http://scima.city/ontology#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .

# --- Top level class ---
scima:InfrastructureEntity a owl:Class ;
    rdfs:label "Infrastructure Entity" .

# --- Subclasses (subclass axioms) ---
scima:RoadSegment a owl:Class ;
    rdfs:subClassOf scima:InfrastructureEntity ;
    rdfs:label "Road Segment" .
scima:TrafficLight a owl:Class ;
    rdfs:subClassOf scima:InfrastructureEntity ;
    rdfs:label "Traffic Light" .

# --- Disjointness axiom: a road is not a traffic light ---
scima:RoadSegment owl:disjointWith scima:TrafficLight .

# --- Object property: links two individuals ---
scima:locatedOn a owl:ObjectProperty ;
    rdfs:domain scima:TrafficLight ;
    rdfs:range  scima:RoadSegment .

# --- Datatype property: links an individual to a literal ---
scima:hasSpeedLimit a owl:DatatypeProperty ;
    rdfs:domain scima:RoadSegment ;
    rdfs:range  xsd:integer .

SCIMA-OWL v0.1. Every block is one of the four building blocks: classes, properties, and the subclass and disjointness axioms that bind them. This snippet is illustrative schema, not runnable application code.

Read the locatedOn property as a worked example of how axioms do work for free. Its domain is TrafficLight and its range is RoadSegment. If we later assert (x, locatedOn, y) for some individual x we never typed, a reasoner can infer that x is a TrafficLight, because only traffic lights can sit in the domain of locatedOn. We never stated the type. The axiom did.

Figure 2. The SCIMA-OWL v0.1 class hierarchy. Purple nodes are classes, the blue dashed line is a disjointness axiom, and the green arrows are properties.

Figure 2. The SCIMA-OWL v0.1 class hierarchy. Purple nodes are classes, the blue dashed line is a disjointness axiom, and the green arrows are properties.

Finally, the smallest unit of all: a single triple. Once SCIMA has data, a fact like “sensor A42 is located on Main Street” is exactly one edge in the graph, the atom that knowledge graphs are built from.

Figure 3. One RDF triple: subject, predicate, object. Every fact in a knowledge graph reduces to edges like this one.

Figure 3. One RDF triple: subject, predicate, object. Every fact in a knowledge graph reduces to edges like this one.

Run this yourself

This series ships a companion codebase that holds one coherent SCIMA implementation evolving alongside the articles. The v0.1 schema above lives there as a real, loadable Turtle file, and a test suite keeps it in step with the version tracker.

pip install -r requirements.txt

python -m scima.ontology
# SCIMA-OWL v0.1: 8 classes, 12 properties (6 object + 6 datatype), 5 axioms

pytest # verifies v0.1 matches the growth tracker (8 classes, 12 properties, 5 axioms)

The full v0.1 ontology in the repo carries the complete eight class core; the snippet above is a curated excerpt of it.

Key takeaways

  • An ontology is a formal, shared, machine readable vocabulary of a domain’s concepts and their relationships, built for reasoning, not just storage.
  • Everything reduces to four building blocks: classes (kinds), individuals (instances), properties (object and datatype relations), and axioms (logical rules).
  • RDF, RDFS, and OWL stack: RDF is the triple data model, RDFS adds a thin schema, OWL adds expressive axioms and decidable reasoning.
  • The Open World Assumption treats unstated facts as unknown rather than false, the honest default for agents acting on partial, lagging data.
  • Ontologies beat relational schemas when shared meaning, inference, and integration matter more than raw write throughput.
  • SCIMA-OWL v0.1 is a minimal class hierarchy with two subclasses, one disjointness axiom, and two properties. It grows to 87 classes by the end of the series.

Further reading

  • Gruber, T. (1993). “A Translation Approach to Portable Ontology Specifications.” Knowledge Acquisition, 5(2). The source of the “shared conceptualization” definition.
  • W3C (2012). OWL 2 Web Ontology Language Primer. The accessible entry point to OWL, with Turtle examples.
  • W3C (2014). RDF 1.1 Turtle. The specification for the syntax used throughout this series.
  • Allemang, D., Hendler, J., & Gandon, F. L. (2020). Semantic web for the working ontologist: Effective modeling for linked data, RDFS, and OWL (3rd ed.). Association for Computing Machinery.
  • Baader, F., Horrocks, I., Lutz, C., & Sattler, U. (2017). An introduction to description logic. Cambridge University Press.

Next in the series, Part 2: Knowledge Graphs, Triples, RDF, and Property Graphs, where we populate SCIMA-OWL with real sensor data and start querying it with SPARQL.

Table of Content

If you found this helpful, clap 👏 to help others discover it, and follow for more!


메타데이터
post_id
2dffb8ac0a6f
slug
part-1-what-is-an-ontology-classes-properties-and-axioms-2dffb8ac0a6f
url
https://medium.com/@anyuanay/part-1-what-is-an-ontology-classes-properties-and-axioms-2dffb8ac0a6f
canonical_url
https://medium.com/@anyuanay/part-1-what-is-an-ontology-classes-properties-and-axioms-2dffb8ac0a6f
author_url
https://medium.com/@anyuanay
status
ok
fetched_at
2026-06-13 07:35:29