Introduction to Ontology

Dec 28, 2024

thumbnail

What's an Ontology?

An ontology enables knowledge sharing at scale by creating a shared knowledge representation layer. Simply put, it's a way to model people's understanding of certain domains or the world.

For a formal definition, Uschold and Gruninger defined an ontology as "the shared understanding of some domain of interest which may be used as a unifying framework" (Uschold and Gruninger, 1996).

Use Cases

Ontology can be applied to building digital twins, enhancing web portals, managing multimedia collections, corporate knowledge management, streamlining design documentation, building intelligent agents, and enabling ubiquitous computing. More details can be found in OWL Web Ontology Language Use Cases and Requirements and the Uschold and Gruninger paper.

One particularly exciting use case that I see is to create an ontology for unifying different research fields mentioned in the Uschold and Gruninger paper, which had originated from an invited talk by Michael Georgeff titled "Agents and Their Plans" given at IJCAI-95 in Montreal. The first and most important step in research is often identifying an important problem (with a reasonable attack) to solve. Having a unifying conceptual framework enables the consolidation of equivalent or similar research problems/ideas across different fields. Later, the research results in one field can be applied to the other fields. I haven't seen any literature related to this use case yet so please reach out if you have an example!

Web Ontology Language (OWL)

Overview

OWL provides a set of expressive vocabularies for defining ontologies, which allow for more structured and expressive representations of knowledge on the web. With it, we can define a "shared understanding of the domain" via three primitives: class (aka concept), relationship (aka property) and instance (aka individual).

How we define an ontology using OWL is similar to how RDF triples work (subject-predicate-object).

XML is used to encode OWL documents and namespaces, which prevent naming conflicts in vocabularies.

Intro

  • Purpose: OWL extends RDF to support ontology modeling with richer semantics for reasoning.
  • Key Features:
    • Allows the specification of classes, properties, hierarchies, and logical axioms.
    • Supports inference, enabling systems to derive new facts from existing data.
    • Example: If DogAnimalDog\subseteq \text{Animal} and RexDog\text{Rex} \in \text{Dog}, an ontology reasoner (e.g. HermiT, Pellet, or FaCT++) can infer RexAnimal\text{Rex} \in \text{Animal}
  • Role in Semantic Technology: OWL adds a logical reasoning layer on top of RDF, making systems capable of complex knowledge representation and automated reasoning.

Basic Types

Classes (Concepts)

  • We can define the hierarchy between different classes using rdfs:subClassOf RDF Schema property
<owl:Class rdf:about="#Person"/>
<owl:Class rdf:about="#Child">
    <rdfs:subClassOf rdf:resource="#Person"/>
</owl:Class>

Relationships (Properties)

OWL supports:

  • Object Properties: Relationships between instances.
    • e.g. related_to, topic, prior
  • Data Properties: Attributes with literal values akin to key-value pairs.
    • e.g. summary, title, author

Domain and Range:

  • Specify the class that a property applies to (domain) and the class of its values (range).
<owl:ObjectProperty rdf:about="#hasParent">
    <rdfs:domain rdf:resource="#Person"/>
    <rdfs:range rdf:resource="#Person"/>
</owl:ObjectProperty>

Complex Relationships

  1. Inverse Properties
    • Define a reciprocal relationship.
    • If hasParent links Child to Parent, then hasChild links Parent to Child.
    • Example: prior and next
  2. Transitive Properties
    • If A is related to B, and B is related to C, then A is related to C.
    • Example: isAncestorOf.
  3. Symmetric Properties
    • The relationship applies in both directions.
    • Example: isMarriedTo, related_to
  4. Functional Properties
    • An individual can have at most one value for this property.
    • Example: hasSocialSecurityNumber.
  5. Cardinality Constraints
    • Limit the number of relationships an individual can have.
    • Example: A person can have at most one biological mother and father.

Instances (Individuals)

The term instance is often used interchangeably with individual.

  • An individual represents a specific entity or object in the domain of discourse.
  • It is the basic unit of data in an ontology and is often used to represent concrete things like people, objects, or concepts.
  • Individuals are members (or instances) of a class.
<!-- Define the Class -->
<owl:Class rdf:about="#Person"/>

<!-- Define an Individual -->
<rdf:Description rdf:about="#John">
    <rdf:type rdf:resource="#Person"/>
</rdf:Description>