Owlready2 is a module for ontology-oriented programming in Python 3.

• Import OWL 2.0 ontologies in NTriples, RDF/XML or OWL/XML format.
• Export OWL 2.0 ontologies to NTriples or RDF/XML.
• Manipulates ontology classes, instances and properties transparently, as if they were normal Python objects.
• Add Python methods to ontology classes.
• Perform automatic classification of classes and instances, using the HermiT reasoner.
• Tested up to 100 millions of RDF triples (but can potentially support more).
• In addition, the quadstore is compatible with the RDFlib Pyton module, which can be used to perform SPARQL queries.

Owlready2 has been created by Jean-Baptiste Lamy (my email is on the left) at the LIMICS reseach lab, University Paris 13, Sorbonne Paris Cité, INSERM UMRS 1142, Paris 6 University. It is available under the GNU LGPL licence v3.

Lamy JB. Owlready: Ontology-oriented programming in Python with automatic classification and high level constructs for biomedical ontologies. Artificial Intelligence In Medicine 2017;80:11-28

## Owlready2 0.12 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This new major version uses a new quadstore, with better performances, and has been tested up to 200 millions of RDF triplets (can load DBpedia!). PostgresQL support has been dropped because its interest was very limited (performances were poor compared to Sqlite3).

Here are the changes in version 0.12:

• Numerical search (NumS, e.g. all patients with age > 65)
• Nested searches
• Drop PostgresQL support (little interest: more complex and slower than Sqlite3)
• Bugfixes: - Fix call to _get_by_storid2 - Fix rdfs_subclassof in doc - Fix FTS triggers - Fix boolean in RDFlib / SPARQL - Fix bug when destroying an AnnotationProperty

## Owlready2 0.11 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This new version brings two major new features: the support for Pellet reasoner and the optimized full-text search.

Here are the changes in version 0.11:

• Optimized Full-Text Search
• Support Pellet reasoner in addition to HermiT
• Use Class.property.indirect() for indirect Class property (instead of Class.property)
• search() is now much faster on properties that have inverse
• Add shortcut for SOME ConstrainedDatatype: e.g. age >= 65
• Bugfixes: - Fix creation of an individual that already exists in the quadstore - Fix missing import of EntityClass in class_construct.py - Fix World.save() with RDF/XML format - Fix Thing.subclasses() and Thing.descendants() - Fix ontology’s update time for ontologies created de novo in Python with Owlready - Fix reasoning when asserting new parents with equivalent classes

## Owlready2 0.10 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This new version fixes many bugs and adds the support of ontology metadata. It also introduces the use of Cython, for improving performances when reading RDF/XML and OWL/XML files. Owlready2 is now able to read these files as fast as Java !

Here are the changes in version 0.10:

• Allows multiple individual creations with the same name/IRI, now returning the same individuals
• Implement RDF/XML and OWL/XML parsing in Cython (25% speed boost for parsing)
• Small optimization
• Extend individual.prop.indirect() to include relations asserted at the class level
• Bugfixes: - Fix reasoning when obtaining classes equivalent to nothing - Fix World creation with backend parameters - Fix error when adding property at the class definition level - Fix loading of ontology files with no extension from onto_path - Fix properties defined with type ‘RDF Property’ and subproperty of ‘OWL Data/Object/Annotation Property’ - Support old SQLite3 versions that do not accept WITHOUT ROWID - Fix reference to undeclared entities (they were replaced by None, now by their IRI) - Fix loading and saving ontologies whose base IRI ends with / - Fix RDF query using string

## Owlready2 0.9 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This new version allows the use of PostgresQL instead of SQLite3 (however, performances are usually lower). It also facilitate the access to SOME restrictions on classes, using the dotted notation “class.property”.

Here are the changes in version 0.9:

• PostgresQL backend (in addition to SQLite3)
• Add ‘exclusive = False’ option for SQLite3 backend (slower, but allows multiple uses)
• Use unique index in sqlite3 quadstore on resources table
• Optimize sqlite3 quadstore by caching IRI dict (5% faster)
• Add == support for class construct
• Add get_namespace() support on World
• Add ‘existential restrictions as class properties’ feature
• Bugfixes: - Fix imported ontologies - Fix saving ontologies in onto_path - Fix clear() on CallbackList - Fix bug in Class IRI in ontologies whose base IRI ends with a / - Fix imported ontologies in ontologies whose base IRI ends with a /

## The great table of ontologies

This big table summarize 5 notations used with formal ontologies in OWL: description logics, the syntax of the Protégé editor, the syntax of Owlready2 in Python, and the semantics in first-order logic and in set formula. Keep on hand when working on formal ontologies!

You can download the great table of ontologies.

## Owlready2 0.8 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

Here are the changes in versions 0.6, 0.7 and 0.8 (the first two have lasted only a few hours):

• Add set_datatype_iri() global function for associating a Python datatype to an IRI
• Add support for dir() on individuals
• Add support for ontology using https: protocol (thanks Samourkasidis Argyrios)
• Add observe module (for registering callback when the ontology is modified)
• Improve docs
• Bugfixes: - Align Python floats with xsd:decimal rather than xsd:double, finally, because decimal accepts int too - Fix Class.instances() so as it returns instances of subclasses (as indicated in the doc) - Fix direct assignation to Ontology.imported_ontologies - Fix a bug in reasoning, when adding deduced facts between one loaded and one non-loaded entity - Fix search(prop = “value”) when value is a string and the ontology uses localized string

## Owlready2 0.5 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

This new version is mostly a bugfix release.

## Owlready2 0.4 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

The main new features of version 2 - 0.4 are:

• the defined relations can be queried for a given individual (using the .get_properties(), .get_inverse_properties() and .get_relations() methods)
• improvement of the .search() method, which now takes into account inheritance and inverse relations
• optimisation of recursive request in SQL
• several bug fixes

## Owlready2 0.3 has been released!

Owlready is a Python module for ontology-oriented programming. It can load OWL 2.0 ontologies and manipulate them transparently in Python.

The 2 - 0.3 version of Owlready is mostly a bugfix release. It also add the ability to destroy entities from ontologies.