Harkin
Harkin

Reputation: 542

Using OWL with Python

I'm looking for a way to create/edit an ontology in python and perform some reasoning with it. From what I've read OWL seems to be the tool best suited for my project. At the moment I'm using python 2.7.5 and all of the libraries I've seen aren't maintained or supported anymore. Is there one out there that is still active?

Upvotes: 1

Views: 1734

Answers (2)

Eric
Eric

Reputation: 111

I came across the [owlready2] package recently, and it seems to be pretty usable. Latest version was released April 5, 2024.

Owlready2 can:

  • Import ontologies in RDF/XML, OWL/XML or NTriples format.
  • Manipulate ontology classes, instances and annotations as if they were Python objects.
  • Add Python methods to ontology classes.
  • Re-classify instances automatically, using the HermiT reasoner.

Docs and tutorials available at Owlready2

You can install it using pip

pip install owlready2

Upvotes: 1

There
There

Reputation: 516

kglab may be worth exploring, although it's using rdflib under the hood.

There are a few write-ups on inference and reasoning with kglab, including this one, as well as notebooks (this one and this one).

Upvotes: 0

Related Questions