dice-group / owlapy

OWLAPY is a Python Framework for creating and manipulating OWL Ontologies.
MIT License
16 stars 1 forks source link

using owlapy from terminal #66

Closed Demirrr closed 3 weeks ago

Demirrr commented 4 weeks ago

We should be using owlapy from terminal.

owlapy --path_ontology "KGs/Family/family-benchmark_rich_background.owl"
--inference_types "InferredClassAssertionAxiomGenerator" "InferredSubClassAxiomGenerator"
--out_ontology "KGs/Family/inferred_family-benchmark_rich_background.owl"
from owlapy.owl_reasoner import SyncReasoner
from owlapy.static_funcs import stopJVM

sync_reasoner = SyncReasoner(ontology="KGs/Family/family-benchmark_rich_background.owl", reasoner="Pellet")
# Infer missing class assertions
sync_reasoner.infer_axioms_and_save(output_path="KGs/Family/inferred_family-benchmark_rich_background.ttl",
                       output_format="ttl",
                       inference_types=[
                           "InferredClassAssertionAxiomGenerator",
                           "InferredEquivalentClassAxiomGenerator",
                           "InferredDisjointClassesAxiomGenerator",
                                        "InferredSubClassAxiomGenerator",
                                        "InferredInverseObjectPropertiesAxiomGenerator",
                                        "InferredEquivalentClassAxiomGenerator"])
stopJVM()
Demirrr commented 3 weeks ago

owlapy --path_ontology "KGs/Family/family-benchmark_rich_background.owl" --inference_types 'all' generates emty ouput

owlapy --path_ontology "KGs/Family/family-benchmark_rich_background.owl" does it well

alkidbaci commented 3 weeks ago

Did you try to call using 'all' without the apostrophe 'all' ==> all

Demirrr commented 3 weeks ago

doesn't really matter. With "all" or all, empty ontology created

alkidbaci commented 3 weeks ago

Seems like the problem was in the way the argument is passed. Default is "all" but when giving it as a value to the argument it will be inside a list ["all"] , because that argument can take multiple values. Basically the equal condition was not passed because it comparing a string with a list. Should I make a new PR or update this to develop directly?

Demirrr commented 3 weeks ago

please update the develop directly