5DV248 · Trustworthy Human-AI Interaction

Knowledge Representation & Reasoning Laboratories

Explore how knowledge can be represented, structured and queried using different formal languages. Start by building ontologies, then move to Description Logics, First-Order Logic and Semantic Web rules. In each laboratory, tell the knowledge base what is known, ask questions, and inspect the knowledge that can be derived.

5 interactive laboratories Browser-based activities From ontology building to logical languages

How to use the KRR laboratories

Follow the sequence below. Begin by exploring how an ontology organises classes, relationships and individuals. Then compare three ways of expressing knowledge: Description Logics, First-Order Logic and SWRL. In the Ask/Tell laboratories, try to predict the answer before submitting a query, and distinguish facts explicitly stored in the knowledge base from conclusions derived by the supported inference mechanism.

Laboratory activities

Five activities, progressing from visual modelling to formal knowledge languages.

Part I · Ontologies: from conceptual models to RDF/OWL

LAB 13AOntology foundations · Beginner

What Is an Ontology?

Build a conceptual model of a fictional district-heating plant. Create classes and subclass relationships, define relationships between classes, and add individuals that belong to those classes. An interactive graph visualises how the ontology changes as you extend it.

Explore: classes versus individuals, class hierarchies, relationships between classes, T-box versus A-box, and visual ontology structure.
LAB 13BRDF / OWL · Intermediate

Build a Plant Ontology

Use rdflib.js to construct an RDF/OWL representation of a synthetic plant. Define classes, subclass relationships, object properties with domain and range, named individuals and links between individuals; then export the ontology as Turtle.

Explore: RDF statements, OWL classes, RDFS subclass axioms, object properties, domain and range, named individuals, Turtle serialisation, and T-box/A-box.

Part II · Logical languages: asking and telling knowledge

LAB 14Description Logics · Beginner

Asking and Telling with Description Logics

Represent a small fictional-university knowledge base using concepts, roles and individuals. Add TBox axioms and ABox assertions, then ask whether statements follow from the knowledge base.

Explore: concept inclusion, instance assertions, role assertions, domain and range constraints, instance checking, instance retrieval, subsumption, and the open-world assumption.
LAB 15First-Order Logic · Intermediate

Asking and Telling with First-Order Logic

Represent facts and general rules about a fictional university using constants, predicates, variables and quantifiers. Add ground facts and Horn rules, then query the consequences using ground and existential conjunctive queries.

Explore: signatures and predicate arity, ground atoms, universal quantification, conjunction, implication, existential queries, forward chaining, and the least Herbrand model.
LAB 16SWRL · Intermediate

Asking and Telling with SWRL

Extend a fictional-university OWL ontology with Semantic Web Rule Language rules. Add class and object-property assertions, write rules using variables, apply the rules, and inspect the additional knowledge that can be inferred.

Explore: OWL vocabulary, SWRL class atoms and object-property atoms, universally quantified implications, rule application, and asserted versus rule-derived knowledge.