1

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?

3
  • You may want to explore rdflib or pyRDFa although I'm uncertain they do exactly what you want. Also this may be of some use. Commented Oct 11, 2013 at 16:41
  • This is a useful question, but it's off topic of Stack Overflow, since "Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." Commented Oct 11, 2013 at 16:56
  • 1
    That said, you might have better luck at answers.semanticweb.com. It seems to be slow at the moment, but a Google search for site:answers.semanticweb.com owl python makes it look like there are some relevant questions and answers for you. Commented Oct 11, 2013 at 16:57

2 Answers 2

1

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
Sign up to request clarification or add additional context in comments.

Comments

0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.