2017-02-21 36 views
0

我正在使用HermiT v1.3.8.4和OWLAPI v3.5.6並且遇到reasoner.isSatisfiable(clazz)永遠運行的問題。OWL HermiT調試可滿足性檢查

有沒有辦法檢查HermiT正在做什麼,即獲取調試信息的方法?

我目前的設置是大致是這樣的

OWLReasonerFactory reasonerFactory = new Reasoner.ReasonerFactory(); 
OWLReasonerConfiguration config; 
if (this.verbose_output) { 
    ConsoleProgressMonitor progressMonitor = new ConsoleProgressMonitor(); 
    config = new SimpleConfiguration(
     progressMonitor 
    ); 
} else { 
    config = new SimpleConfiguration(); 
} 
OWLReasoner reasoner = reasonerFactory.createReasoner(this.ontology, config); 

... 

for (OWLClass c: this.ontology.getClassesInSignature(this.include_import_closure)) { 
    if (!reasoner.isSatisfiable(c)) { // This step takes forever 
     continue; 
    } 

    ... 
} 

回答

3

不知道這是否會有所幫助,但也有一些相關的調試課,雖然我從來沒有使用過的。您可以嘗試使用以下配置選項

Configuration config=new Configuration(); 
// Lets make HermiT open a debugger window from which we can control the 
// further actions that HermiT performs. 
// DEBUGGER_HISTORY_ON will cause HermiT to save the deriviation tree for 
// each derived conclusion. 
// DEBUGGER_NO_HISTORY will not save the derivation tree, so no causes for a 
// clash can be given, but the memory requirement is smaller. 
config.tableauMonitorType=TableauMonitorType.DEBUGGER_HISTORY_ON; 
// Now we can start and create the reasoner with the above created configuration. 
Reasoner hermit = new Reasoner(config,ontology); 
// This will open the debugger window at runtime and it should say: 
// Good morning Dr. Chandra. This is HAL. I'm ready for my first lesson. 
// Derivation history is on. 
// Reasoning task started: ABox satisfiability 
// > 
// you can press 'c' to make HermiT continue with checking whether the ontology 
// is consistent 
hermit.isSatisfiable(c); // for a class 'c' 
// HermiT should now have said 'Reasoning task finished: true' in the debugger window. 
// Now, you can type 'showModel' to see all the assertions in the ABox that HermiT generated. 

否則,日誌級別可能會有所幫助。

2

獲得反饋的另一種方式是使用分析器。 jvisualvm包含在所有最新的Oracle JRE中,採樣器模式將爲您提供有關HermiT正在做什麼的很好線索。這不是一個進度監視器,但它有助於瞭解是什麼讓事情放緩的是本體或特定構造的大小。