Skip to content

owlapy 1.2.1

Compare
Choose a tag to compare
@Demirrr Demirrr released this 22 Aug 10:34
· 120 commits to main since this release
3f6f75e

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.

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

Full Changelog: 1.1.1...1.2.1