W3C home > Mailing lists > Public > public-linked-json@w3.org > April 2014

Re: Unable to load a remote context

From: David I. Lehn <dil@lehn.org>
Date: Thu, 17 Apr 2014 19:50:27 -0400
Message-ID: <CADcbRRPiWCZmOLUUqfGLBHDSSbvhPotu3Y4zmaRr-06vj6k30Q@mail.gmail.com>
To: Keith Suderman <suderman@anc.org>
Cc: Linked JSON <public-linked-json@w3.org>
On Thu, Apr 17, 2014 at 5:21 PM, Keith Suderman <suderman@anc.org> wrote:
> I am experimenting with JSON-LD and I am having a problem loading a remote
> context, I keep getting the error “Derefencing a URL did not result in a
> valid JSON-LD object”.  (Full error message is included below).
> ...
> {
> "@context": "http://vocab.lappsgrid.org/person.jsonld"
> }
> Can anyone spot the problem? I am stumped.
> The full error message is:
> { "name": "jsonld.InvalidUrl", "message": "Derefencing a URL did not result
> in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps
> due to a same-origin policy (ensure the server uses CORS if you are using
> client-side JavaScript), too many redirects, a non-JSON response, or more
> than one HTTP Link Header was provided for a remote context.", "details": {
> "code": "loading remote context failed", "url":
> "http://vocab.lappsgrid.org/person.jsonld", "cause": { "name":
> "jsonld.LoadDocumentError", "message": "URL could not be dereferenced, an
> error occurred.", "details": { "code": "loading document failed", "url":
> "http://vocab.lappsgrid.org/person.jsonld", "cause": "" } } } }

It doesn't look like your server has CORS enabled for the vocab resource:

This site has some CORS info and setup help:

The error message does suggest this as a potential problem.  And
current chrome has console XHR error messages mentioning missing CORS
headers.  Since you seem to have run into this issue, can you suggest
a better way to make this sort of problem and solutions clearer?

> P.S. I also noticed a small spelling mistake in the error message;
> “Derefencing” instead of “Dereferencing”.  I can prepare a pull request if
> anyone wants it.

Please do.

Received on Thursday, 17 April 2014 23:50:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:41 UTC