OWLAPY: A Pythonic Framework for OWL Ontology Engineering
Alkid Baci, Luke Friedrichs, Caglar Demir, Axel-Cyrille Ngonga Ngomo
TL;DR
The paper addresses the need for a native Python framework for OWL ontology engineering to facilitate AI/ML integration. It introduces OWLAPY, a modular Python library that mirrors OWLAPI concepts, supports ontology loading/saving, reasoning with native and Java-based engines via JPype, and format conversions among Description Logic, Manchester syntax, and SPARQL, as well as SWRL parsing and LLM-driven ontology generation. Key contributions include a flexible Ontology model, a SyncReasoner umbrella for external DL reasoners, an embedding-based reasoner, an OWLAPIMapper bridge, comprehensive testing, and documentation that ease the transition from Java-based tooling. This framework enables Python practitioners to perform advanced OWL editing and reasoning, bridging language ecosystems and broadening access to OWL technologies, with public OSS availability and a growing user base (over 50,000 downloads).
Abstract
In this paper, we introduce OWLAPY, a comprehensive Python framework for OWL ontology engineering. OWLAPY streamlines the creation, modification, and serialization of OWL 2 ontologies. It uniquely integrates native Python-based reasoners with support for external Java reasoners, offering flexibility for users. OWLAPY facilitates multiple implementations of core ontology components and provides robust conversion capabilities between OWL class expressions and formats such as Description Logics, Manchester Syntax, and SPARQL. It also allows users to define custom workflows to leverage large language models (LLMs) in ontology generation from natural language text. OWLAPY serves as a well-tested software framework for users seeking a flexible Python library for advanced ontology engineering, including those transitioning from Java-based environments. The project is publicly available on GitHub at https://github.com/dice-group/owlapy and on the Python Package Index (PyPI) at https://pypi.org/project/owlapy/ , with over 50,000 downloads at the time of writing.
