Re: Unable to load a remote context

Hi Keith,

Thanks for reporting the typo, it's been fixed.

Regarding the remote context loading issue, the problem is that you
aren't serving CORS headers. Since your context is on a domain that is
different from the playground, you'll need to enable CORS so the JSON-LD
processor can fetch the context.

If you need help enabling CORS, see this link:

http://enable-cors.org/server.html

Hopefully this helps!

-Dave


On 04/17/2014 05:21 PM, Keith Suderman wrote:
> I apologize if this is not the correct place for this question; Google
> could not find any place better.
> 
> 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).
> 
> I have copied the context from http://json-ld.org/contexts/person to our
> server (http://vocab.lappsgrid.org/person.jsonld) and I am testing on
> the JSON-LD playground (http://json-ld.org/playground/).  My first
> thought was that the content-type of the returned document is incorrect,
> but I’ve double checked and the content-type returned is
> application/ld+json so I do not know what else could be wrong; as far as
> I can tell the two contexts are identical as are the relevant HTTP headers.
> 
> My test input is simply:
> 
> {
> "@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": "" } } } }
> 
> Thanks in advance.
> Keith Suderman
> 
> 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.
> 
> 
> ------------------------------
> Research Associate
> Department of Computer Science
> Vassar College
> Poughkeepsie, NY
> 
> 


-- 
Dave Longley
CTO
Digital Bazaar, Inc.

Received on Thursday, 17 April 2014 23:49:49 UTC