简体   繁体   English

如果推理程序一致并且发生了更改,OWL API将保存本体

[英]OWL API save ontology if reasoner is consistent and changes occurred

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. 我有一个本体,当且仅当发生某些更改并且推理机(在我的情况下为pellet)与这些更改一致时,才需要将其保存在文件中。 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. 仅当本体已被修改时,我才会同步Pellet,而不是如果它是一致的,则同步它并应用更改。 Any idea how to proceed? 任何想法如何进行? Thank you 谢谢

(Edit: I use manager.applyChange method in order to modify the ontology). (编辑:我使用manager.applyChange方法来修改本体)。

最后,我使用了reasoner.getPendingChanges()。isEmpty()来通过缓冲推理器检查新的更改(对于非缓冲的更改将自动应用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM