Is there a way to check whether imports already have been load for an OntModel? As to call loadImports() only once and avoid calling it with each OntModel access.
On Thu, Jul 14, 2016 at 2:48 PM, Andy Seaborne <a...@apache.org> wrote: > On 13/07/16 22:33, Martynas Jusevičius wrote: >> >> Hey, >> >> I upgraded Jena from 2.11.0 to 3.0.1 and OntModel imports stopped >> working when getOntology() is called. >> >> I traced the problem to AdapterFileManager.readModelWorker(Model >> model, String filenameOrURI, String baseURI, String syntax), where >> >> model.read(in, baseURI, syntax) >> >> was at some point replaced with >> >> RDFDataMgr.read(model, mappedURI, baseURI, lang) >> >> and therefore OntModelImpl.read() doesn't get called, and >> OntModelImpl.loadImports() doesn't get called. >> >> Respective stacktraces provided below. Is there a workaround? > > > You could try calling loadImports on the OntModel from getOntology > > >> >> 3.0.1 >> >> at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134) >> at >> org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:282) >> at org.apache.jena.util.FileManager.readModel(FileManager.java:341) >> at org.apache.jena.util.FileManager.readModel(FileManager.java:325) >> at >> org.apache.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1062) >> at >> org.apache.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:584) >> >> 2.11.0 >> >> >> com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1980) >> at com.hp.hpl.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2250) >> at >> org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:302) >> at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:362) >> at com.hp.hpl.jena.util.FileManager.readModel(FileManager.java:346) >> at >> com.hp.hpl.jena.ontology.OntDocumentManager.read(OntDocumentManager.java:1063) >> at >> com.hp.hpl.jena.ontology.OntDocumentManager.getOntology(OntDocumentManager.java:585) >> >> >> Martynas >> atomgraph.com >> >