Ontologies, RDF/OWL and description logics

Intelligent Systems for Robotics · Week 4

Syllabus · Home

Weeks 2 and 3 gave the robot skills. A skill moves the base or the arm towards a goal, and it does not choose its goal. This week starts the layer that holds what the robot knows about the apartment: what kinds of thing exist, which ones are where, and what follows from that. You write the facts. A reasoner adds the conclusions, and SPARQL asks questions of both.

Objectives

What the robot has to know

Ask the fetch task what it needs, and it answers in questions. Where is a drink? Which drink may I bring this person? What is this room? No sensor answers any of them. The camera returns a bottle in one frame and a sink in another, and neither detection says kitchen. The skills from weeks 2 and 3 can drive to a pose and close a gripper. They need to be told which pose and which object, and something has to work that out.

Week 1 placed that something in the stack. The world model sits above the skills and below the planner, and it answers two of the five questions from that lecture: which room is the kitchen, and what counts as a drink. It holds what was seen after it has left the frame, in terms the rest of the system can use. This week builds its first half, the types and facts. Week 5 adds the second half, the places the robot can find again and the routes between them.

Three things do the work. A knowledge graph is the representation. It is a set of statements, each linking two things by a named relation: this sink is at the counter, the counter is in the studio kitchen. An ontology is the vocabulary those statements use, with axioms that say how its terms relate. One such axiom says that a room containing a kitchen sink is a kitchen. A reasoner reads the graph and the ontology together and adds every statement that follows. You write that a kitchen sink stands at the counter. The reasoner concludes that the room is a kitchen, and nobody wrote that.

Writing the facts and deriving the conclusions keeps each piece of knowledge in one place. The kitchen axiom is written once, in the ontology, and it applies to every room in every apartment you describe, including rooms added after it was written. Code that checked each room for a sink would hold the same knowledge, but inside a function that the planner cannot read and another module cannot reuse. The ontology is also shared. The planner in week 6 will use the same terms your apartment file uses, because both come from one namespace.

Robots have been built this way. KnowRob, described by Tenorth and Beetz (2013), gives robots the knowledge they need for everyday manipulation tasks. It represents that knowledge in OWL, the language this lecture builds up to, and it computes much of it on demand, when a query asks for it. Its authors call these computed parts virtual knowledge bases. This course builds a much smaller version of the same idea, with one ontology file, one reasoner and queries you can read.

The course's ontology also records how a class meets the detector. The annotation isfr:cocoClass gives, for each class that has one, the label YOLO returns for it. isfr:Fridge carries "refrigerator" and isfr:Sink carries "sink". That is the only link to perception this week. Everything else is written by hand, and week 5 connects the symbols to what the robot sees.

The lecture runs from the bottom up. RDF is the data model, and RDFS is the first and weakest layer of meaning on it. Description logics give the semantics that OWL 2 is built on, and the OWL 2 profiles trade some of that expressive power for speed. SPARQL asks the questions. The last part turns all of it on the apartment.

RDF and Turtle

RDF states facts as triples. A triple has a subject, a predicate and an object, and reads as a short sentence: the sink is at the counter. A set of triples is a graph, with the subjects and objects as nodes and each triple as a labelled edge. The set is unordered, and writing a triple twice adds nothing.

Three kinds of term fill those positions. An IRI is a global name, such as https://isfr.tsiogkas.me/ontology/isfr#Room. Two files that use the same IRI are talking about the same thing, which is what lets your apartment file and the base ontology meet in one graph. A literal is a value: a string such as "studio kitchen", which may carry a language tag, or a typed value such as "0.8"^^xsd:decimal. A blank node is a node with no global name, for something you need to talk about but never refer to from outside. Subjects are IRIs or blank nodes, predicates are always IRIs, and only objects may be literals.

Turtle is the text syntax this course uses. Here is part of the week's example, a studio flat:

@prefix isfr: <https://isfr.tsiogkas.me/ontology/isfr#> .
@prefix :     <https://isfr.tsiogkas.me/ontology/studio#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:kitchen_corner a isfr:Room ; rdfs:label "studio kitchen" .
:counter isfr:inRoom :kitchen_corner .

:sink a isfr:KitchenSink ; isfr:objectAt :counter .
:orange_1 a :Orange ; rdfs:label "an orange" ; isfr:objectAt :counter .

A prefix abbreviates the start of an IRI, so isfr:Room stands for the full IRI above. The empty prefix : is the example's own namespace. The keyword a abbreviates rdf:type, the predicate that puts a thing in a class. A semicolon repeats the subject, and a comma repeats the subject and the predicate. The :sink line is therefore two triples:

<https://isfr.tsiogkas.me/ontology/studio#sink>
    <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
    <https://isfr.tsiogkas.me/ontology/isfr#KitchenSink> .
<https://isfr.tsiogkas.me/ontology/studio#sink>
    <https://isfr.tsiogkas.me/ontology/isfr#objectAt>
    <https://isfr.tsiogkas.me/ontology/studio#counter> .

Blank nodes are written [ ... ] in Turtle. You will meet one in the base ontology's kitchen axiom, where the class of things that contain a kitchen sink has to be described without being given a name.

Notice the shape of the studio. An object is not in a room directly. It is at a place, and the place is in a room. A place is somewhere the robot can recognise and stop, such as the counter, and week 5 gives every place an anchor the robot can perceive. The room an object is in follows from those two hops, and the next sections show how a reasoner derives it.

RDF itself attaches no meaning to any of this. To RDF, isfr:KitchenSink is a name and a is a predicate like any other. A graph that says the sink is of type isfr:Room is an equally valid graph. The meaning comes from the vocabularies built on RDF, starting with RDFS. The base ontology, data/ontology/isfr-base.ttl, is itself a set of triples. Read it now. It is short, and every term the example uses is declared there.

RDFS

RDF Schema adds a small vocabulary with a fixed meaning. Three of its terms carry most of the inference you will use.

rdfs:subClassOf says that every member of one class is a member of another. The base ontology says that a fridge is an appliance and an appliance is a physical object. If :fridge a isfr:Fridge is in the graph, a reasoner adds :fridge a isfr:Appliance and :fridge a isfr:PhysicalObject. The relation is transitive, so a chain of any length closes.

rdfs:domain says that whatever appears as the subject of a property belongs to a class. rdfs:range says the same of the object. The base ontology gives isfr:objectAt the domain isfr:PhysicalObject and the range isfr:Place. Now add one triple to the studio, with no type for the fridge at all:

:fridge isfr:objectAt :counter .

After reasoning, :fridge is an isfr:PhysicalObject and :counter is an isfr:Place. The domain typed the fridge from the one relation it takes part in. The reasoner did not conclude isfr:Fridge. The IRI's local name means nothing to it, and nothing else in the graph says what kind of physical object this is.

A domain or a range is a reason to infer a type, and it is never a check on the data. Suppose you put a lamp at a room by mistake:

:lamp isfr:objectAt :kitchen_corner .

A database schema would reject this triple, since the range says the object of isfr:objectAt is a place and :kitchen_corner is a room. RDFS reads the same range as a premise and concludes that :kitchen_corner is a place. The studio kitchen is now both an isfr:Room and an isfr:Place, nothing in the ontology says the two cannot overlap, and no RDFS reasoner reports anything. On the studio graph, owlrl adds the type and reports no error. The mistake shows up later, as a query that returns a room where you expected a place, and nothing points back at the triple that caused it.

Read the inferred types of your individuals at least once, because that is where a wrong domain or range shows itself. If two classes must not overlap, say so. The section on OWL shows how a disjointness axiom turns this silent slip into a reported clash.

RDFS has one more term worth knowing, rdfs:subPropertyOf, which says that every pair related by one property is related by another. Beyond that it stops. It cannot say that a room containing a kitchen sink is a kitchen. That axiom needs a conjunction of two conditions and a statement that some related thing exists, and RDFS has neither. It also cannot say that two classes are disjoint, so the lamp's slip can never become a contradiction. Those limits are what description logics remove.

Poole and Mackworth, section 16.2, cover class and property hierarchies in the same terms, with a section on designing classes that is worth reading before you start the micro-project.

Description logics

Description logics are a family of logics for describing classes and relations, built so that the standard questions about them stay decidable. Three kinds of name exist. Concepts denote sets of things, such as $\mathit{Room}$ or $\mathit{KitchenSink}$. Roles denote binary relations, such as $\mathit{contains}$. Individuals denote single things, such as $\mathit{sink}$. OWL calls concepts classes and roles properties.

The basic logic is ALC. From concept names $A$ and roles $r$ it builds concepts by five constructors: intersection $C \sqcap D$, union $C \sqcup D$, complement $\neg C$, the existential $\exists r.C$ and the universal $\forall r.C$, with $\top$ for everything and $\bot$ for nothing. The meaning is given by an interpretation $\mathcal{I} = (\Delta^\mathcal{I}, \cdot^\mathcal{I})$. The domain $\Delta^\mathcal{I}$ is a non-empty set of things. The function $\cdot^\mathcal{I}$ maps each concept name to a subset of the domain, each role to a set of pairs, and each individual to one element. Compound concepts are interpreted as follows.

$$\begin{aligned} (C \sqcap D)^\mathcal{I} &= C^\mathcal{I} \cap D^\mathcal{I} \\ (C \sqcup D)^\mathcal{I} &= C^\mathcal{I} \cup D^\mathcal{I} \\ (\neg C)^\mathcal{I} &= \Delta^\mathcal{I} \setminus C^\mathcal{I} \\ (\exists r.C)^\mathcal{I} &= \{x \mid \exists y.\,(x,y) \in r^\mathcal{I} \wedge y \in C^\mathcal{I}\} \\ (\forall r.C)^\mathcal{I} &= \{x \mid \forall y.\,(x,y) \in r^\mathcal{I} \rightarrow y \in C^\mathcal{I}\} \end{aligned}$$

The existential is the set of things related to at least one member of $C$. The universal is the set of things related only to members of $C$, which includes every thing related to nothing at all. With these, the base ontology's kitchen axiom reads

$$\mathit{Room} \sqcap \exists \mathit{contains}.\mathit{KitchenSink} \sqsubseteq \mathit{Kitchen}$$

An ontology has two parts. The TBox holds axioms about concepts, written $C \sqsubseteq D$ and true in $\mathcal{I}$ when $C^\mathcal{I} \subseteq D^\mathcal{I}$. The kitchen axiom is in the TBox, and so is every rdfs:subClassOf. RDFS fits inside this picture. A domain $C$ for $r$ is the axiom $\exists r.\top \sqsubseteq C$, and a range $C$ is $\top \sqsubseteq \forall r.C$. The ABox holds facts about individuals, a concept assertion $a : C$, true when $a^\mathcal{I} \in C^\mathcal{I}$, and a role assertion $r(a, b)$, true when $(a^\mathcal{I}, b^\mathcal{I}) \in r^\mathcal{I}$. The studio's facts are an ABox. An interpretation in which every axiom holds is a model of the ontology, and an axiom is entailed when it holds in every model.

You can compute an entailment by hand on the studio. Take an ABox with $\mathit{kitchen\_corner} : \mathit{Room}$, $\mathit{sink} : \mathit{KitchenSink}$ and $\mathit{contains}(\mathit{kitchen\_corner}, \mathit{sink})$. In every model, the corner is related by $\mathit{contains}$ to a member of $\mathit{KitchenSink}$, so it belongs to $\exists \mathit{contains}.\mathit{KitchenSink}$. It also belongs to $\mathit{Room}$, so it is in the intersection, and the TBox puts the intersection inside $\mathit{Kitchen}$. The ontology entails $\mathit{kitchen\_corner} : \mathit{Kitchen}$.

Four reasoning tasks are standard. Subsumption asks whether $C \sqsubseteq D$ is entailed. Instance checking asks whether $a : C$ is entailed. Consistency asks whether the ontology has any model at all. Concept satisfiability asks whether some model gives $C$ a member. The four reduce to one another. $C \sqsubseteq D$ is entailed exactly when $C \sqcap \neg D$ is unsatisfiable. $a : C$ is entailed exactly when adding $a : \neg C$ makes the ontology inconsistent. $C$ is satisfiable exactly when adding $b : C$, for a fresh individual $b$, leaves it consistent. A reasoner that decides consistency therefore decides all four. The usual method is the tableau: try to build a model by breaking assertions into simpler ones, branch at each union, and conclude inconsistency when every branch contains a clash such as $x : A$ and $x : \neg A$. You will not run one by hand in this course.

The semantics assume an open world. A model may contain anything the axioms do not rule out. Is the sleeping corner a kitchen? The studio does not entail it. It does not entail the opposite either, because there are models in which the sleeping corner contains a kitchen sink nobody recorded. The answer is unknown, and a query reports an unknown as no row. The absence of a fact is not its negation.

Names are not unique either. Two IRIs may denote one thing unless the ontology says otherwise. The base ontology declares isfr:inRoom functional, so a place is in at most one room. Write :counter isfr:inRoom :cooking_area alongside the studio's :counter isfr:inRoom :kitchen_corner, and the reasoner concludes :kitchen_corner owl:sameAs :cooking_area, and :cooking_area becomes a kitchen too. That is a valid conclusion, and usually not the one you meant. Stating owl:differentFrom between the two rooms is one way to turn it into a contradiction.

OWL 2 and its profiles

OWL 2 DL is a description logic, and its ontologies are usually written in RDF. Under its Direct Semantics, OWL 2 DL is for the most part a syntactic variant of SROIQ, a description logic that extends ALC with transitive roles, role hierarchies and chains, inverse roles, nominals and number restrictions. Each constructor has an RDF form. Intersection is owl:intersectionOf, union owl:unionOf, complement owl:complementOf. A restriction on owl:onProperty with owl:someValuesFrom is an existential, and with owl:allValuesFrom a universal. Concept inclusion is rdfs:subClassOf. The kitchen axiom in the base ontology is the DL axiom of the previous section, with two blank nodes for the two unnamed concepts.

[ owl:intersectionOf ( isfr:Room
                       [ a owl:Restriction ;
                         owl:onProperty isfr:contains ;
                         owl:someValuesFrom isfr:KitchenSink ] ) ]
    rdfs:subClassOf isfr:Kitchen .

The same file defines isfr:contains with a property chain, a SROIQ feature. In DL notation it is $\mathit{inRoom}^- \circ \mathit{objectAt}^- \sqsubseteq \mathit{contains}$, so a room contains whatever is at one of its places. That chain is what takes the studio from :sink isfr:objectAt :counter to the room containing the sink.

OWL 2 DL as a whole is expensive. The OWL 2 Profiles recommendation, section 5, puts ontology consistency, class satisfiability, subsumption and instance checking at N2EXPTIME-complete for OWL 2 DL. It then defines three profiles, each a restricted language in which ontology consistency, and instance checking against a named class, take polynomial time. OWL 2 EL is for ontologies with very large numbers of classes and properties. OWL 2 QL is for very large volumes of instance data, where queries are rewritten to run on a relational database. OWL 2 RL is for scalable reasoning that rule-based engines can implement, and it is the one this course uses.

RL reasoning is forward chaining. Section 4.3 of the Profiles document gives the OWL 2 RL rules as implications over triples. Two of them are RDFS's subclass and domain inferences:

cax-sco:  T(?c1, rdfs:subClassOf, ?c2)  T(?x, rdf:type, ?c1)  =>  T(?x, rdf:type, ?c2)
prp-dom:  T(?p, rdfs:domain, ?c)        T(?x, ?p, ?y)         =>  T(?x, rdf:type, ?c)

A reasoner applies every rule to the graph, adds what the rules conclude, and repeats until a pass adds nothing. The result is the closure. It holds the asserted triples together with every triple that follows from them under the rules. The studio's kitchen takes five rules. prp-inv2 adds the inverses of the two asserted triples, and prp-spo2 applies the property chain to them and adds :kitchen_corner isfr:contains :sink. cls-svf1 puts the corner in the existential restriction, cls-int1 puts it in the intersection, and cax-sco makes it an isfr:Kitchen. A rule whose conclusion is false signals an inconsistency. cax-dw concludes false when one individual belongs to two classes declared owl:disjointWith.

owlrl is a Python implementation of these rules over an rdflib graph. It reports an inconsistency as triples it adds to the graph, of type ErrorMessage in the namespace http://www.daml.org/2002/03/agents/agent-ont#, and never by raising an exception. Add isfr:Room owl:disjointWith isfr:Place . to the studio with the lamp from the RDFS section, and the closure carries the message "Disjoint classes https://isfr.tsiogkas.me/ontology/isfr#Room and https://isfr.tsiogkas.me/ontology/isfr#Place have a common individual https://isfr.tsiogkas.me/ontology/studio#kitchen_corner". If your code does not look for those triples, an inconsistent graph looks like any other. The micro-project's runner looks for them.

A toy graph of 41 asserted triples closed to 212 in 35 ms. The base ontology alone closes in about 0.05 s, and the micro-project's reference apartment, 649 inferred triples, in about 0.15 s. All three were measured on 2026-10-04 on the instructor's laptop (Apple M4 Max, rdflib 7.6.0, owlrl 7.6.2). A slower machine takes longer.

Section 4.2.3 of the Profiles document says what RL gives up. Its grammar admits an existential, ObjectSomeValuesFrom, only on the subclass side of an axiom. On the superclass side it is not allowed. Section 4.1 gives the reason: RL is designed to avoid inferring the existence of individuals not explicitly present. The axiom below needs one.

$$\mathit{BeerBottle} \sqsubseteq \exists \mathit{holds}.\mathit{Beer}$$

In OWL 2 DL this says that every beer bottle holds some beer. That beer has no name, and a forward-chaining rule can only add triples between nodes the graph already has. Given this axiom and one beer bottle, owlrl produced no holds triple at all. The base ontology is shaped by that result. A drink is one individual with two types, its container class and its content class, as in :beer1 a isfr:Bottle, :Beer, and no relation from a container to its content exists.

The Description Logic Primer, section 5, covers the profiles from the description logic side.

SPARQL

SPARQL is the query language for RDF. Its core is the basic graph pattern: a set of triple patterns in which any position may be a variable, written with a leading ?. A solution binds each variable to a term so that every pattern becomes a triple in the graph. This is the example's third question:

SELECT ?thing WHERE {
    ?room a isfr:Kitchen ; isfr:contains ?thing .
    ?thing a :Fruit .
}

Turtle's semicolon works inside a pattern. The query asks for anything that some kitchen contains and that is a fruit. The example runs its three questions twice, once on the asserted graph and once on the closure, and marks with + each row the reasoner made possible:

asserted: 131 triples
closure: 423 triples inferred in 0.087 s

Which rooms are kitchens?
  before reasoning: 0 rows; after: 1 rows
  + studio kitchen

Which things are fruit?
  before reasoning: 0 rows; after: 2 rows
  + an apple
  + an orange

Which fruit is in a kitchen?
  before reasoning: 0 rows; after: 1 rows
  + an orange

Every question returns nothing before reasoning. The studio states no kitchen, no member of :Fruit and no isfr:contains triple. Each answer is a conclusion, so query the closure whenever you want an answer and the asserted graph whenever you want to see what was written.

FILTER keeps the solutions for which a condition holds. Which objects share a place?

SELECT ?a ?b WHERE {
    ?a isfr:objectAt ?place .
    ?b isfr:objectAt ?place .
    FILTER (?a != ?b)
}

Without the filter, every object pairs with itself. With it, the studio returns the orange with the sink and the apple with the bed, each pair once in each order. OPTIONAL keeps a solution when part of the pattern does not match, and leaves that part's variables unbound. Add OPTIONAL { ?thing rdfs:label ?label } to the pattern ?thing isfr:objectAt ?place, and the query returns every object at a place, with a label for the orange and the apple and none for the sink and the bed.

FILTER NOT EXISTS removes a solution when a pattern does match. Which room holds no citrus?

SELECT ?room WHERE {
    ?room a isfr:Room .
    FILTER NOT EXISTS { ?room isfr:contains ?fruit . ?fruit a :Citrus . }
}

On the closure, this returns the sleeping corner. On the asserted graph it returns both rooms, because nothing there says that any room contains anything. The query was right, and the graph it ran on was missing conclusions. Ask a negative question of the closure, never of the asserted graph.

Even on the closure, NOT EXISTS works under a different assumption from the reasoner. It reads a fact nobody recorded as false. That is negation as failure, and it makes the answer depend on what was written down. The reasoner works in the open world and never concludes anything from absence. The studio's graph records one person, Sam. Suppose it gains two guests, Kim and Lee, each recorded as an isfr:Person. Nothing more is recorded about Kim. Lee is allergic to citrus, written :lee :allergicTo :Citrus with a property invented for this example:

SELECT ?person WHERE {
    ?person a isfr:Person .
    FILTER NOT EXISTS { ?person :allergicTo ?anything . }
}

This returns Sam and Kim. Perhaps Sam was asked and has no allergies. Nobody asked Kim. The two rows look the same, and the query cannot tell them apart, because the graph does not record the difference. If the difference matters, write it down as a fact of its own, such as a class for the people who were asked, and query for that. A person with no recorded preference raises the same question, and question 6 of the micro-project asks you to work out what it means for the robot.

Poole and Mackworth, section 15.9, treat this assumption under the name complete knowledge, and SPARQL 1.1 Query, section 8.1.1, defines FILTER NOT EXISTS.

Modelling the apartment

An ontology is finished when it answers the questions it was built for. Grüninger and Fox (1995) made that the method. Write the competency questions first, in plain language. They are the specification. Each one names the terms the ontology needs and the conclusions it has to support. Once the ontology exists, each question becomes a query, and the queries are its tests. The questions in the first section of these notes are competency questions for the fetch task. The micro-project gives you six.

The first design decision for each term is whether it is a class or an individual. A class is a kind that many things share and that you will ask about as a kind: fridges, rooms, places. An individual is one particular thing, and for this robot that usually means something it could drive to or pick up: this fridge, the studio kitchen, the orange on the counter. When in doubt, ask whether the term could have two members. If it could, it is a class.

Some facts need a class in the object position. Sam prefers citrus, and Sam does not prefer one particular orange:

:sam a isfr:Person ; rdfs:label "Sam" ; isfr:prefers :Citrus .

Here :Citrus is used as an individual, the value of isfr:prefers, while it is also a class with :Orange beneath it. OWL 2 admits the same IRI as a class and an individual. The OWL 2 Primer, section 9, calls it punning. The price is that the two uses are separate as far as the semantics goes. The reasoner draws nothing from the preference. It does not conclude that Sam prefers oranges, or that the orange on the counter would suit him. In the studio's closure, Sam prefers :Citrus and nothing else. Connecting a preference to an item is a query's job. The query has to match the item against the preferred class through the types the reasoner inferred for the item. The alternative was a defined class per person, such as a class of the things Sam accepts, and it was rejected because every new person would need a new axiom.

Room types are inferred, never asserted. The robot is not told which room is the kitchen. It sees a sink, a fridge or a bed, and the room type follows from what the room contains. Assert every room as an isfr:Room and nothing more. An asserted isfr:Kitchen would be a second record of the same fact, and it could disagree with the room's contents with nothing to flag it. An inferred type always agrees with the contents, because the contents produce it.

Inference from contents has to respect what the robot can tell apart. COCO has one class, sink, for every sink, and a kitchen sink and a bathroom sink look the same to the detector. The apartment has sinks in the bathroom and the WC as well as the kitchen. With an axiom over isfr:Sink, both would be inferred kitchens. The base ontology therefore splits isfr:Sink into isfr:KitchenSink and isfr:BathroomSink, keeps cocoClass "sink" on the parent, and writes the kitchen axiom over isfr:KitchenSink. The ontology now distinguishes what the detector cannot. Which kind of sink a detection is has to come from somewhere else, from the authored description this week and from grounding in week 5.

The graph holds no world-frame poses. It records which place an object is at and which room a place is in, and no coordinates. The micro-project's inventory lists coordinates read from the world file, to help you find objects on the floor plan, and they stay out of your graph. Week 1 showed that wheel odometry alone cannot tell the robot where it is, so a world-frame pose in the graph would be a number the robot cannot check. Week 5 gives every place an anchor the robot can perceive, and every edge between places a coarse relative hint.

Poole and Mackworth, section 16.2.2, discuss designing classes, and section 16.1.2 the choice of identifiers for individuals.

The micro-project and week 5

The micro-project is the apartment the fetch robot works in. You extend the base ontology with a taxonomy of drinks, room types for bathrooms and bedrooms, the nine rooms on the floor plan, the furniture the questions need, seven drinks and a household of five people. Then you answer six competency questions with SPARQL, run once on what you wrote and once on the closure. Every room is asserted as an isfr:Room and nothing more, so the reasoner has to work out which is which. One question has two readings that differ in how they treat a preference nobody recorded, and you write two sentences on which reading the robot should act on. Nothing in it needs Webots, and it runs from the files it provides.

Week 5 extends the same graph. The base ontology gains places with anchors, a doorway as a gap in the lidar scan or an object the detector names. Edges between places carry hints, coarse relative poses the robot can drive towards until the next anchor is in view. A route becomes a search over those edges. The rooms and objects you model this week are what those places sit in.

One thing carries over unchanged. Every term this week uses comes from the base namespace, https://isfr.tsiogkas.me/ontology/isfr#, and that namespace is fixed for the rest of the course. Week 5 adds terms to the same file and changes none of the ones you used. The other choices, such as how you name individuals, which file holds what, and how your code finds the graph, are yours, and the final project is where you reconcile them.

Before next week, read the Description Logic Primer's sections on the basic building blocks and on semantics, and run the example. Then start the micro-project with the competency questions, and write the ontology to answer them.

Slides

Deck for this week

Example

Run from the repository root:

PYTHONPATH=. python3 examples/04-ontologies/main.py

It loads the base ontology and studio.ttl, computes the closure, and asks three questions of each graph. The output above, in the SPARQL section, is what it prints. Nothing in it needs Webots. Read studio.ttl next to the base ontology. The example shows how the parts of isfr.knowledge fit together, and it is not a model of good ontology design.

Micro-project

This week's exercise is exercises/04-ontologies/. Its README.md states the task and ends in a Self Check list you can verify unaided. The instructor's model is published in data/reference/week-04/ after the deadline.

The micro-project runs from the inputs it provides. It does not need any earlier week's output.

Reading

Further, optional, and not examined:

More background, optional: further reading.


Intelligent Systems for Robotics · course materials