Papers
Topics
Authors
Recent
Search
2000 character limit reached

Ontolearn: OWL Class Expression Learner

Updated 4 July 2026
  • Ontolearn is a Python-based open-source framework for learning OWL class expressions on large knowledge graphs, integrating symbolic and neuro-symbolic approaches.
  • It features a modular architecture built on OWLAPY, enabling efficient ontology engineering, reasoning integration, and remote triplestore support.
  • Its suite of learners, including EvoLearner and DRILL, optimizes quality metrics like F1 score and provides LLM-based verbalizations for human-interpretable outcomes.

Ontolearn is an open-source Python framework for learning OWL class expressions over large knowledge graphs. It unifies symbolic and neuro-symbolic class expression learners, operates over in-memory ontologies and remote triplestores, and includes an LLM-based verbalization module for translating learned OWL class expressions into natural language. In its core formulation, Ontolearn addresses concept induction: given an OWL/RDF knowledge base and sets of positive and negative example individuals, it searches for an OWL class expression that covers the positives and excludes the negatives (Demir et al., 13 Oct 2025).

1. Formal task and scope

Ontolearn targets OWL class expression learning, also called concept induction. The standard setup uses a knowledge base K=(T,A)\mathcal{K} = (\mathcal{T}, \mathcal{A}), with T\mathcal{T} as the TBox and A\mathcal{A} as the ABox, together with positive examples E+Ind(K)E^+ \subseteq \mathrm{Ind}(\mathcal{K}), negative examples EInd(K)E^- \subseteq \mathrm{Ind}(\mathcal{K}), and a hypothesis space H\mathcal{H} of allowed class expressions. The task is to find a concept CHC^* \in \mathcal{H} maximizing a quality measure over the examples and the knowledge base:

Find CH such that C maximizes some quality measure q(C;E+,E,K).\text{Find } C^* \in \mathcal{H} \text{ such that } C^* \text{ maximizes some quality measure } q(C; E^+, E^-, \mathcal{K}).

A standard instantiation is:

C=argmaxCHq(C;E+,E,K).C^* = \arg\max_{C \in \mathcal{H}} q(C; E^+, E^-, \mathcal{K}).

The quality function may be F1(C)F_1(C), T\mathcal{T}0, or another scoring metric (Demir et al., 13 Oct 2025).

The framework works with Description Logic class expressions such as conjunction, disjunction, negation, existential restriction, universal restriction, and the constants T\mathcal{T}1 and T\mathcal{T}2. A canonical example in the framework uses the Family knowledge base, where the target concept “married female” is represented as:

T\mathcal{T}3

and verbalized as “A female who is married.” This formulation reflects Ontolearn’s emphasis on interpretable symbolic classifiers rather than opaque decision boundaries (Demir et al., 13 Oct 2025).

A common ambiguity arises because “ontology learning” is a broader field than Ontolearn itself. In the broader literature, ontology learning also includes term extraction, term typing, taxonomy discovery, non-taxonomic relation extraction, and axiom identification. Ontolearn, by contrast, is specifically centered on OWL class expression learning over knowledge graphs, with positive and negative examples as the primary supervision signal (Beliaeva et al., 26 Aug 2025).

2. System architecture and OWLAPY foundation

Ontolearn’s architecture is organized around a Knowledge Base, a Reasoner layer, a Learning Problem abstraction, a set of learning algorithms, a verbalization module, and SPARQL/triplestore integration. The Knowledge Base supports loading OWL/RDF data in RDF/XML, OWL/XML, and N-Triples. For very large knowledge graphs, Ontolearn supports loading the data into a triplestore such as Tentris and retrieving instances of class expressions via SPARQL queries automatically generated from the OWL class expressions (Demir et al., 13 Oct 2025).

The Reasoner layer is provided via Owlapy. External OWL reasoners such as HermiT and Pellet are integrated through Owlapy and used during learning to infer new knowledge and determine all instances of a candidate class expression. The Learning Problem encapsulates the supervised setup: knowledge base or reasoner, positive examples, negative examples, and constraints such as allowed DL constructors and time limits. Learners operate over this abstraction and can therefore share evaluation, search, and scoring infrastructure (Demir et al., 13 Oct 2025).

OWLAPY is the ontology engineering layer that Ontolearn builds on. It is introduced as a comprehensive Python framework for OWL ontology engineering, streamlining the creation, modification, and serialization of OWL 2 ontologies. It provides native Python classes for OWL entities, native Python-based reasoners together with support for external Java reasoners, and conversion capabilities between OWL class expressions and Description Logics syntax, Manchester Syntax, and SPARQL. The framework also supports custom workflows that leverage LLMs in ontology generation from natural language text (Baci et al., 11 Nov 2025).

This dependency is structural rather than incidental. OWLAPY is the core ontology engineering layer that Ontolearn uses as its foundational library, and it is the component that exposes ontology access, axiom manipulation, reasoner integration, and syntax transformation inside Python. A plausible implication is that Ontolearn’s learning algorithms can remain focused on hypothesis generation and scoring because ontology engineering and reasoning services are delegated to OWLAPY (Baci et al., 11 Nov 2025).

3. Learning algorithms and objective functions

Ontolearn contains efficient implementations of recent state-of-the-art symbolic and neuro-symbolic class expression learners including EvoLearner and DRILL. The paper lists nine algorithms and groups them into symbolic, evolutionary, heuristic, neural, and neuro-symbolic families. These include CELOE, OCEL, EvoLearner, CLIP, ROCES, Nero, DRILL, NCES, and NCES2 (Demir et al., 13 Oct 2025).

EvoLearner is described as an evolutionary search method in which individuals in the population are OWL class expressions. Mutation may add or remove conjuncts or disjuncts, replace a class with a super- or subclass, or add existential and universal restrictions; crossover combines parts of two parent expressions. For a candidate expression T\mathcal{T}4, the usual confusion counts are:

T\mathcal{T}5

T\mathcal{T}6

From these,

T\mathcal{T}7

T\mathcal{T}8

T\mathcal{T}9

Some learners also incorporate concept length A\mathcal{A}0 and optimize criteria of the form A\mathcal{A}1 (Demir et al., 13 Oct 2025).

DRILL represents the neuro-symbolic side of the framework. Its core idea is to use neural embeddings of entities and logical constructs to guide symbolic search for class expressions, while the symbolic component evaluates exact logical quality on the labeled examples. The neural part minimizes a loss such as cross-entropy over positive and negative examples, and the symbolic part optimizes logical quality measures such as A\mathcal{A}2. This division of labor is characteristic of Ontolearn’s design: neural models guide search, but the learned output remains an OWL class expression (Demir et al., 13 Oct 2025).

Because all learners share the same Learning Problem and Knowledge Base interfaces, Ontolearn also functions as a research platform. Helper functions and base classes handle access to the KB and reasoner, evaluation of candidate class expressions, generic search-loop functionality, and scoring. This suggests that extending the framework with new concept learners is intended to be a first-class use case rather than an afterthought (Demir et al., 13 Oct 2025).

4. Scalability, reasoning, and query execution

Ontolearn is explicitly designed to handle large knowledge graphs. For graphs with more than A\mathcal{A}3 triples, full in-memory loading is described as impractical. The framework therefore supports remote triplestores and maps OWL class expressions into SPARQL queries so that instance retrieval can be offloaded to the triplestore’s query engine. For example, a named class A\mathcal{A}4 maps to a query of the form: A\mathcal{A}7 and an existential restriction A\mathcal{A}5 maps to: A\mathcal{A}8 (Demir et al., 13 Oct 2025)

The SPARQL layer is complemented by several optimization strategies. Ontolearn supports sampling techniques through OntoSample, and it incorporates improvements for scalable negation evaluation based on multi-way joins. The design focus is not on asymptotic formulas but on reducing the number of expensive instance-retrieval calls, caching and reusing query results where possible, and exploiting efficient backends such as triplestores and external reasoners (Demir et al., 13 Oct 2025).

OWLAPY contributes the underlying reasoning and syntax infrastructure. It supports Java-based DL reasoners via SyncReasoner, using JPype to bridge Python and Java and to access Java OWL reasoners such as HermiT and Pellet. It also provides native Python-based reasoners, including a close-world reasoner and an Embedding-Based Reasoner that approximates reasoning tasks via a scoring function over knowledge graph embeddings. Alongside this, OWLAPY supplies transformations between internal OWL class expression objects, DL syntax, Manchester Syntax, and SPARQL queries (Baci et al., 11 Nov 2025).

This combination of symbolic reasoners, SPARQL execution, and embedding-based approximation gives Ontolearn several operating modes. Exact reasoning is available when open-world DL services are feasible; SPARQL-based evaluation supports remote and distributed storage; embedding-based reasoning offers a scalable approximation on large, noisy graphs. The framework’s scalability strategy is therefore plural rather than tied to a single execution model (Baci et al., 11 Nov 2025).

5. LLM verbalization and text-to-ontology interfaces

Ontolearn includes an LLM-based verbalization module that translates learned OWL class expressions into natural language. The pipeline serializes the OWL class expression in a canonical textual form, prompts an LLM such as LLaMA or Mistral, and outputs a sentence intended to remain faithful to the formal semantics. The standard example is:

A\mathcal{A}6

verbalized as “A female who is married.” The OWL expression remains the single source of truth; the LLM is used as a verbalizer rather than as the semantic authority (Demir et al., 13 Oct 2025).

OWLAPY extends the text-facing side of the stack further by offering experimental support for ontology generation from natural language text. In this workflow, an LLM extracts entities and their interrelations from text, types entities either from a predefined set of classes or from classes generated by the LLM, and represents the extracted information as RDF triples, including triples involving numeric values. The system is described as inspired by graph-RAG style workflows (Baci et al., 11 Nov 2025).

This suggests a broader neuro-symbolic pipeline around Ontolearn. One plausible implication is a two-stage architecture in which OWLAPY turns unstructured text into an ontology-shaped substrate, while Ontolearn then learns class expressions over the resulting knowledge graph and verbalizes the output back into natural language. The papers stop short of presenting this as a single unified algorithm, but the interface compatibility is explicit (Baci et al., 11 Nov 2025).

The LLM components are not limited to generation. Because learned class expressions can be verbalized into readable descriptions, Ontolearn also supports human-in-the-loop interpretation of hypotheses that remain formally executable as OWL expressions or SPARQL queries. This is one of the framework’s distinctive design choices: natural language is attached to formal semantics, not substituted for it (Demir et al., 13 Oct 2025).

6. Research context, distinctions, and limitations

Ontolearn is positioned as a modern Python counterpart to DL-Learner, but with explicit support for recent neuro-symbolic methods, triplestore-native evaluation, and LLM verbalization. Its role is narrower than the whole ontology learning field. Contemporary work on ontology learning with LLMs also includes end-to-end taxonomic backbone generation, term extraction and typing pipelines, and axiom identification benchmarks, whereas Ontolearn remains focused on OWL class expression learning over knowledge graphs (Lo et al., 2024, Beliaeva et al., 26 Aug 2025, Bakker et al., 5 Dec 2025).

A related but distinct system is OntoLearner, a modular Python library for ontology learning with LLMs that releases 180 machine-readable ontologies spanning 22 domains and benchmark datasets for term typing, taxonomy discovery, and non-taxonomic relation extraction. OntoLearner explicitly notes that it is distinct from Ontolearn. This distinction is important because the two systems address different task formulations and infrastructure layers, even though both operate in ontology learning research (Giglou et al., 2 Jul 2026).

Ontolearn’s limitations are also clearly stated. Exact OWL reasoning and instance retrieval remain expensive on very large knowledge graphs. The learning problem depends on labeled positive and negative examples, and obtaining those labels can be non-trivial. Constructor coverage and expressivity differ across learners, especially for more expressive DL fragments. LLM verbalization may produce slightly imprecise descriptions, and the framework does not yet describe automatic correctness checks for those verbalizations. These constraints place Ontolearn in the category of semi-automatic knowledge engineering tools rather than fully autonomous ontology construction systems (Demir et al., 13 Oct 2025).

At the same time, the framework is presented as mature software infrastructure: about 20k lines of code, 156 unit and regression tests, 95% test coverage, 26 example scripts, PyPI distribution, and the ability to run as a web service are all reported. It is also described as used in industrial projects and as a backend in systems such as EDGE, AutoCL, OntoSample, and Tab2Onto. In that sense, Ontolearn occupies a specific position in the ontology engineering ecosystem: it is both a practical toolkit for interpretable OWL-based classifiers and a research platform for symbolic and neuro-symbolic concept induction in Python (Demir et al., 13 Oct 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Ontolearn.