Given I have an ontology that imports one or more other ontologies, when I read that ontology:
model.read("http://example.com/ExampleOntology.owl", "TURTLE"); I get the exception: 2017-03-29 14:41:04 WARN OntDocumentManager:1076 - An error occurred while attempting to read from http://example.com/OtherImportedOntology.owl. Msg was '[line: 1, col: 1 ] Content is not allowed in prolog.'. org.apache.jena.riot.RiotException: [line: 1, col: 1 ] Content is not allowed in prolog. at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136) at org.apache.jena.riot.lang.LangRDFXML$ErrorHandlerBridge.fatalError(LangRDFXML.java:238) at org.apache.jena.rdfxml.xmlinput.impl.ARPSaxErrorHandler.fatalError(ARPSaxErrorHandler.java:47) at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.warning(XMLHandler.java:199) at org.apache.jena.rdfxml.xmlinput.impl.XMLHandler.fatalError(XMLHandler.java:229) at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.jena.rdfxml.xmlinput.impl.RDFXMLParser.parse(RDFXMLParser.java:150) at org.apache.jena.rdfxml.xmlinput.ARP.load(ARP.java:118) at org.apache.jena.riot.lang.LangRDFXML.parse(LangRDFXML.java:134) at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:179) at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:859) at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:259) at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:245) at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:69) at org.apache.jena.rdf.model.impl.ModelCom.read(ModelCom.java:305) at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:289) 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$1.readModel(OntDocumentManager.java:1032) at org.apache.jena.rdf.model.impl.ModelMakerImpl.getModel(ModelMakerImpl.java:104) at org.apache.jena.ontology.OntDocumentManager.fetchLoadedImportModel(OntDocumentManager.java:1029) at org.apache.jena.ontology.OntDocumentManager.fetchPossiblyCachedImportModel(OntDocumentManager.java:1001) at org.apache.jena.ontology.OntDocumentManager.loadImport(OntDocumentManager.java:974) at org.apache.jena.ontology.OntDocumentManager.loadImports(OntDocumentManager.java:768) at org.apache.jena.ontology.OntDocumentManager.loadImports(OntDocumentManager.java:706) at org.apache.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1964) at org.apache.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2200) at org.apache.jena.ontology.impl.OntModelImpl.read(OntModelImpl.java:2148) The imported ontology that Jena does an HTTP GET to retrieve (http://example.com/OtherImportedOntology.owl) is served as text/turtle, but it appears Jena is trying to parse as RDF/XML. The ontology is served with the correct Content-Type header: 2017-03-29 14:45:59 DEBUG headers:124 - http-outgoing-0 << HTTP/1.1 200 OK 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Cache-Control: no-cache 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Pragma: no-cache 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Content-Type: text/turtle 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Expires: -1 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Last-Modified: Wed, 14 Dec 2016 16:51:09 GMT 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Accept-Ranges: bytes 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << ETag: "48c33e452a56d21:0" 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Server: Microsoft-IIS/7.5 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << X-Powered-By: ASP.NET 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Date: Wed, 29 Mar 2017 19:45:59 GMT 2017-03-29 14:45:59 DEBUG headers:127 - http-outgoing-0 << Content-Length: 17526 Does Jena not use the mime-type that is supplied by the Content-Type response header? I don't see a way of forcing the lang to be used for imports. Thanks, Donald Smith --------------------------------------------------- Confidentiality Notice: This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.