OWL Reasoners for Type Inference and Ontology Enrichment
With OWLAPI integration, we can enjoy owlapi in python.
For instance, OWL Reasoners like 'HermiT' and 'Pellet' can be easily used to infer missing type information.
python
from owlapy.owl_ontology_manager import OntologyManager
from owlapy.owlapi_adaptor import OWLAPIAdaptor
ontology_path = "KGs/Family/family-benchmark_rich_background.owl"
Available OWL Reasoners: 'HermiT', 'Pellet', 'JFact', 'Openllet'
owlapi_adaptor = OWLAPIAdaptor(path=ontology_path, name_reasoner="Pellet")
onto = OntologyManager().load_ontology(ontology_path)
Iterate over defined owl Classes in the signature
for i in onto.classes_in_signature():
Performing type inference with Pellet
instances=owlapi_adaptor.instances(i,direct=False)
print(f"Class:{i}\t Num instances:{len(instances)}")
owlapi_adaptor.stopJVM()
What's Changed
* Merge to main v1.1.1 by alkidbaci in https://github.com/dice-group/owlapy/pull/50
* infer_save() implemented to infer different types of axioms by Demirrr in https://github.com/dice-group/owlapy/pull/52
* Owlapi adaptor changes and SyncReasoner update by alkidbaci in https://github.com/dice-group/owlapy/pull/53
* Owl to sentence by Demirrr in https://github.com/dice-group/owlapy/pull/56
* Added logo, bandages and more by alkidbaci in https://github.com/dice-group/owlapy/pull/57
* Owlapy mapper extension and infer methods of adapter by alkidbaci in https://github.com/dice-group/owlapy/pull/58
* Refactoring and Readme Update by Demirrr in https://github.com/dice-group/owlapy/pull/59
* New Release 1.2.1 by Demirrr in https://github.com/dice-group/owlapy/pull/61
**Full Changelog**: https://github.com/dice-group/owlapy/compare/1.1.1...1.2.1