1
votes

I have an ontology that I need to save on file if and only if some changes occured and the reasoner (pellet in my case) is consistent with these changes. So i write:

 reasoner.flush(); //sync reasoner
 if(reasoner.isConsistent())
 manager.saveOntology(ontos[1], new RDFXMLDocumentFormat(), IRI.create((new   File(file)).toURI())); 

I would synchronize Pellet only if the ontology has been modified, than if it is consistent synchronize it and apply changes. Any idea how to proceed? Thank you

(Edit: I use manager.applyChange method in order to modify the ontology).

1

1 Answers

1
votes

Finally, I used reasoner.getPendingChanges().isEmpty() to check for new changes with a buffering reasoner (with a non bufferd one changes apply automatically).