I am making an application which may require about 2-3 OWL files to work with, in order to serve different task for the same application. I am using Jena as my semantic web framework. My question is: How do we organize/setup these owl files? Should I read all the owl files in the same dataset or I should maintain different datasets for different owls. Note: I am not considering the Imported owls as it is handled by jena itself.
If I use same dataset, how can I differentiate to between he results obtained by functions like OntModel.lisRootHierarchyClasses(); and other such types of functions. Is it possible to name the ontologies when I read them into the OntModel.
Hence would like to know the best practice to handle more than one OWL files in a same application
For Example: I read my ontologies in the into an ontModel backed by a TDB dataset:
public static void loadModel(){
dataset.begin(ReadWrite.WRITE);
try{
ontModel = ModelToOntModel(model);
FileManager.get().readModel( ontModel, "SourceOwl1.owk");
FileManager.get().readModel( ontModel, "SourceOwl2.owl");
registerListener();
dataset.commit();
} catch (Exception e){
System.out.println("Error in Loading model from source!!");
e.printStackTrace();
} finally {
dataset.end();
}
}
Once the ontmodel
is ready a user input specifies a particular class (say : SourceOWL2_ClassA) among any of the owl files, which i further need to process its Object properties and datatype properties and provide user some information in the same context.
But in order to do that, properties from SourceOWL1 also get listed and hence cause errors. Further more the structure of the SourceOWL1 and SourceOWL2 are very much different, where SourceOWL1 contains about 3 imports and SourceOWL2 contains none.