0

I'm new to the OWL API and I was wondering if there was a way to update an ontology with all the new relations picked up by the reasoner (HermiT). I couldn't find a tutorial or much documentation, so I assumed calling

    reasoner.classifyClasses();
    reasoner.classifyDataProperties();
    reasoner.classifyObjectProperties();
    reasoner.precomputeInferences();
    reasoner.flush();

would classify the new relations. Then, I'm not sure how to translate these new relations to create an updated ontology. I have an idea of how I could manually iterate through new relations and add them if they aren't present in the ontology, but I'm looking for an easier way to do this. Also, I'm not entirely sure if the above code reasons all the new relations for me, so let me know if I should make any corrections.

Bob Zee
  • 3
  • 4

1 Answers1

1

You can use InferredOntologyGenerator for that purpose. The class can be created with a reasoner as input and the InferredOntologyGenerator::fillOntology method to add all the axioms that can be inferred to a new ontology.

Note that axiom generation can be a very slow operation. Try with a small ontology at first, to see whether the result is what you need.

Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • thanks, I'll give it a shot! Do you think my current method calling is accurate for the reasoner to classify all relations? – Bob Zee Jul 18 '18 at 04:23
  • It's not necessary when using the inferred ontology generator, it takes care of calling the reasoner for all inferences. If you take a look at its source code, you'll also see how to select which inferences to generate. – Ignazio Jul 18 '18 at 05:46