markedone66 opened a new issue, #1765: URL: https://github.com/apache/jena/issues/1765
### Version 4.7.0 ### Question Im using DocumentLoader to reroute the context URL, because the URL in context is not accessible in our application. So i made my own adaptation of these examples: [DocumentLoader](https://github.com/apache/jena/blob/2e48ac6d14b6e61f7ab09a9b61294914c5a0d65e/jena-arq/src/test/java/org/apache/jena/riot/TestJsonLDReader.java) [RDF Parser](https://github.com/apache/jena/blob/main/jena-examples/src/main/java/arq/examples/riot/ExRIOT3_RDFParser.java) Problem, is, it all works perfectly on Jena 4.4.0 (maybe even higher, did not test 5 or 6, 6.1) but as soon as i switch to latest -> 4.7.0 I start getting this error: ``` JsonLdError[code=There was a problem encountered loading a remote context [code=LOADING_REMOTE_CONTEXT_FAILED]., message=There was a problem encountered loading a remote context [code=LOADING_REMOTE_CONTEXT_FAILED].] ``` and then later down the stacktrace ... ``` Caused by: JsonLdError[code=The document could not be loaded or parsed [code=LOADING_DOCUMENT_FAILED]., message=Unexpected response code [403]] org.apache.jena.riot.RiotException: There was a problem encountered loading a remote context [code=LOADING_REMOTE_CONTEXT_FAILED]. ``` Jena should be redirected to a local file server that is running in my docker, i can access it without any issue when i enter debug and i click on the URL its supposed to go. its an HTTP with no auth, so it should be accessible at all times. As i said, works without any issues on 4.4.0 but i get 403 if i swap to 4.7.0 ... What has changed? do i need to add additional configuration or something? Here is some of the logic: ``` JsonLdOptions options = new JsonLdOptions(); DocumentLoader dl = new DocumentLoader(); dl.addInjectedDoc(contextUrlFromPayload, contextFromFileServer); options.setDocumentLoader(dl); // pass the jsonldContext and JsonLdOptions to the read using a jena Context JsonLDReadContext jenaCtx = new JsonLDReadContext(); jenaCtx.setOptions(options); // read the jsonld, replacing its "@context" Dataset ds = jsonld2dataset(eventPayload.toString(), jenaCtx, Lang.JSONLD); Model mod = ModelFactory.createDefaultModel().read(schemaUrl); ``` and ``` private Dataset jsonld2dataset(String jsonld, Context jenaCtx, Lang lang) { Dataset ds = DatasetFactory.create(); RDFParser .create() .fromString(jsonld) .errorHandler(ErrorHandlerFactory.errorHandlerNoLogging) .lang(lang) .context(jenaCtx) .parse(ds.asDatasetGraph()); return ds; } ``` Thanks a lot! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
