apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.12k stars 652 forks source link

how to debug LOADING_REMOTE_CONTEXT_FAILED problems? #2739

Closed VladimirAlexiev closed 1 month ago

VladimirAlexiev commented 2 months ago

Version

5.1.0

Question

https://github.com/EKGF/dprod/issues/90:

Trying to convert https://github.com/EKGF/dprod/blob/main/examples/data-quality/example.json with riot causes error:

riot.bat -out=trig -syntax=jsonld example.json
There was a problem encountered loading a remote context [code=LOADING_REMOTE_CONTEXT_FAILED].

The context is https://ekgf.github.io/dprod/dprod.jsonld and:

So what may be the reason for the problem?

afs commented 2 months ago

Getting example.json returns an HTML document; the github display of the file. Use the "raw", the processing is all inside Titanium JSON-LD.

Internally, there is a nested stacktrace that says:

    A keyword [@context] redefinition has been detected.

My guess is that it is because of the array but I'm not a JSON-LD expert.

VladimirAlexiev commented 1 month ago

Thanks @afs !

The reason is context nested inside context (actually dprod.jsonld is not a context at all, it's a dumped ontology). So the Playground is more lenient than Titanium (thus Riot). But really dprod.jsonld is to blame.

Thank for the PR you made! I'll close this specific issue.

afs commented 1 month ago

Looks like https://github.com/filip26/titanium-json-ld/issues/348.