I am using JENA TDB to store a OWL file read as OntModel. The code for the same is :
public static void initializeModel(){
dataset=TDBFactory.createDataset("Path/to/TDBDir");
Model b = dataset.getDefaultModel();
ontModel= ModelToOntModel(b);
FileManager.get().readModel( ontModel, "Path/to/sourceOWL.owl");
jListener= new JenaListener(ontModel,"MODEL");
ontModel.register(jListener);
}
Hereby I am facing a problem where if the owl file is change externally (specifically when we delete something form the owl file) when the application is not running and again re-run the application, the data set appears to be in an inconsistent state as per the owl file, as because the entities deleted from the owl file still persists in the ontModel
(as those old entries persists in the TDB), which is not desired in our case.
Is there any way to overcome this kind of problem? so that the dataset remains consistent with my OWL file? Or is the method as shown above is not the correct way of creating TDB?