© Lamy Jean-Baptiste 2021
L. Jean-BaptisteOntologies with Pythonhttps://doi.org/10.1007/978-1-4842-6552-9_7

7. Automatic reasoning

Lamy Jean-Baptiste1  
(1)
Université Sorbonne Paris Nord, LIMICS, Sorbonne Université INSERM, UMR 1142, Bobigny, France
 

In this chapter, we will see how to use the HermiT and Pellet reasoners in Python, in order to check the consistency of an ontology and to perform automatic deductions and classification, on the basis of the logical constructors.

7.1 Disjoints

Owlready allows creating disjoints between classes with the class AllDisjoint. For example, we can declare the classes Isolated, InPair, InCluster, and InChain as pairwise disjoint, as follows:
>>> from owlready2 import *
>>> onto = get_ontology("bacteria.owl").load() ...

Get Ontologies with Python: Programming OWL 2.0 Ontologies with Python and Owlready2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.