Hi there

I am trying to read in an ontology imports.

Here is what I am doing at the moment:

1.  OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
2.                      model.read(Ontology_input_file);
3.  
4.  Ontology_import_list = model.listImportedOntologyURIs();
5.  
6.  
7.  Ontology_import_list.stream().forEach(Import_uri -> {
8.  
9.                      ont2.addImport(model2.createResource(Import_uri));
10.                     model.read(Ontology_input_file2);
11.                     Import_uri = Import_uri.concat("#");
12.                     String prefix = model.getNsURIPrefix(Import_uri);
13.                     PrefixMapping prefixMapping = 
model2.setNsPrefix(prefix, Import_uri);                   
15.             });


In line 10. I would like to change Ontology_input_file2 (which a string to 
points to a specific file in the directory of Ontology_input_file) with the 
file that, in the directory of Ontology_input_file, has Import_uri as uri.

Thanks, Jos  

Reply via email to