[
https://issues.apache.org/jira/browse/JENA-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15820817#comment-15820817
]
ASF GitHub Bot commented on JENA-1276:
--------------------------------------
Github user afs commented on the issue:
https://github.com/apache/jena/pull/203
`curl -v --header 'Accept: application/ld+json' http://schema.org/` returns
zeros bytes.
Is json-ld following redirects? Where does jsonld-java's httpClient come
from?
It is a 302 redirect to `http://schema.org/docs/jsonldcontext.json`. Does
using that work? It does not for me but it's not clear it is the same error.
(jsonld-java suppresses details).
If you agree this is from jsonld-java, could you close JENA-1276? The
jsonld-java developers aren't going to see it.
What about
* https://github.com/jsonld-java/jsonld-java/issues/188
* https://github.com/jsonld-java/jsonld-java/issues/186
> "loading remote context failed" reading JSON-LD
> -----------------------------------------------
>
> Key: JENA-1276
> URL: https://issues.apache.org/jira/browse/JENA-1276
> Project: Apache Jena
> Issue Type: Bug
> Components: ARQ
> Affects Versions: Jena 3.1.1
> Environment: mac osx 10.11, eclipse mars
> Reporter: François-Paul Servant
>
> getting org.apache.jena.riot.RiotException: loading remote context failed:
> http://schema.org/ reading json-ld with an @context set to schema.org
> see https://github.com/apache/jena/pull/203
> the exception occurs here:
> com.github.jsonldjava.core.DocumentLoader.loadDocument(String) line 29
> where I get:
> org.apache.http.ConnectionClosedException: Premature end of Content-Length
> delimited message body (expected: 124346; received: 0
> {noformat}
> public class TestJsonLDReader {
> @Test public final void simpleReadTest() {
> try {
> String jsonld = someSchemaDorOrgJsonld();
> Model m = ModelFactory.createDefaultModel();
> try (StringReader reader = new StringReader(jsonld)) {
> m.read(reader, null, "JSON-LD");
> }
> assertJohnDoeIsOK(m);
> } catch (RiotException e) {
> // org.apache.jena.riot.RiotException: loading remote context
> failed: http://schema.org/
> e.printStackTrace();
> }
> }
> /** Example data */
> private String someSchemaDorOrgJsonld() {
> return "{\"@id\":\"_:b0\",\"@type\":\"Person\",\"name\":\"John
> Doe\",\"@context\":\"http://schema.org/\"}";
> }
> /** Checking that the data loaded from someSchemaDorOrgJsonld into a
> model, is OK */
> private void assertJohnDoeIsOK(Model m) {
> assertTrue(m.contains(null, RDF.type,
> m.createResource("http://schema.org/Person")));
> assertTrue(m.contains(null,
> m.createProperty("http://schema.org/name"), "John Doe"));
> }
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)