help and suggestions
,那么这就是我解决这个问题的方法。
基本上,我在没有推理机的情况下获得了对另一个模型的访问权,对基本模型进行了批量更改,然后使用推理机恢复完整模型以获得更新。
这里有一些psuedo代码。这不完全符合我的“真实”场景,但你明白了。
// Create a model with a reasoner and load the full model from owl files or
// whatever
OntModel fullModel = ModelFactory.createOntologyModel();
fullModel.read(...);
// create a model without a reasoner and load it from the full model with
// reified statements
OntModel basicModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
basicModel.add(fullModel);
// batch modifications to the basic model programatically
//(**** RUNS REALLY QUICK *****)
// rebind the full model
fullModel.rebind();
// continue on....