Re: Unable to load a remote context

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:
http://vocab.lappsgrid.org/person.jsonld

This site has some CORS info and setup help:
http://enable-cors.org/

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.

-dave

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