Foundations of Ontology Template Language OTTR (Extended Abstract)

Erik Snilsberg, Leif Harald Karlsen, Egor V. Kostylev, Martin G. SkjævelandDescription Logics 2024

Introduction

The Resource Description Framework (RDF) and the Web Ontology Language (OWL) are the standard languages for representing knowledge on the Semantic Web. However, engineering and maintaining these knowledge bases is notoriously difficult because they lack native support for user-defined abstractions. Developers are often forced to write low-level RDF triples or OWL axioms, a process akin to writing a massive software program without the ability to use functions or APIs.

Reasonable Ontology Templates (OTTR) solves this by allowing users to define and instantiate parameterized modeling patterns. While OTTR is gaining popularity in both academia and industry—supported by tools like the Lutra reference implementation—its development has historically outpaced its theoretical grounding. This research introduces a mathematical formalization of OTTR's core features to establish its theoretical properties and computational complexity.

Formalizing Core OTTR Features

To bridge the theoretical gap, the authors mathematically model the most advanced and computationally demanding features of the OTTR language:

  • Optional Parameters and Default Values: Handling missing arguments gracefully within template definitions.
  • List Expansion Modes: This is the most complex feature, dictating how lists of arguments are unpacked into base triples. The model includes three modes:
  • cross: The Cartesian product of lists.
  • zipMin: Combining elements by position up to the shortest list.
  • zipMax: Padding shorter lists with null values up to the longest list.

Complexity Analysis

The authors focus on the EXPANSION decision problem: determining whether a specific instance occurs in the fully expanded version of an OTTR dataset. This is analyzed under two conditions:

  1. Combined Complexity: Where both the templates and the instances are treated as inputs.
  2. Data Complexity: Where templates are fixed, and only the instances vary (reflecting practical scaling scenarios).

Key Insights and Results

Conciseness and Expansion Bounds

OTTR is highly concise; a very small dataset can expand into a massive RDF graph due to nested templates and multiple arguments. The size of a fully expanded OTTR dataset is bounded exponentially by two factors: template nesting depth and maximal template arity (the number of parameters).

  • If list expansion is disabled, size is exponential only relative to nesting.
  • If all lists are ground (no variables), size is exponential only relative to arity.

Complexity Classes

The research identifies a fine-grained complexity border based on syntactic features:

  • Combined Complexity: For the full core OTTR language, the problem is NP-complete. For the simplest fragments, it drops to NL-complete.
  • Data Complexity: In practical settings with fixed templates, complexity is much lower, falling into TC⁰-complete or AC⁰. The transition to TC⁰ is driven by the presence of lists combined with zipMin or zipMax expansion modes.

Limitations and Future Work

This initial formalization intentionally omits OTTR's type system and non-blank parameters for brevity. Future work will expand the model to cover these features, investigate the specific Description Logic (DL) ontologies produced by OTTR, and apply these theoretical algorithms to optimize real-world implementations like Lutra.

Summary updated

BibTeX
@inproceedings{snilsberg2024foundations,
  author = {Erik Snilsberg and Leif Harald Karlsen and Egor V. Kostylev and Martin G. Skjæveland},
  title = {{Foundations of Ontology Template Language OTTR (Extended Abstract)}},
  booktitle = {Description Logics},
  year = {2024},
  url = {https://openreview.net/forum?id=dpwXDUWcac},
}

Loading related content...

Figure