RE: Hydra not working with JSON-LD playground

Hi Pat,

First of all sorry for the delay. I was traveling.

On Wednesday, September 11, 2013 2:45 PM, McBennett, Pat wrote:
> So I was just trying to play with Hydra today, and wanted to use
> the JSON-LD Playground - but it doesn't seem to work.

I assume you were using the playground on json-ld.org, right?


> Basically the following produces no output at all (nor any error, so I
> assume there must be a bug in the Playground, although I couldn't find
> any references in the open issues):

It's not a bug, it's a limitation. But I agree, it should output an error in
that case. I've filed an issue [1].

[...]
>
> I assume this must be a Hydra problem, since the following (from the
> JSON-LD spec) works fine, and is doing basically the same thing:
>
[...]
>
> I notice that the JSON-LD served up by
'http://purl.org/hydra/core/context.jsonld'
> is simply named 'core' with no extension, so maybe it's as simple as the
> Playground needing a '.jsonld' extension or something...?!

No, it's neither a problem with Hydra nor the missing .jsonld extension. The
problem is that purl.org doesn't set the CORS headers and thus a JavaScript
implementation running in the browser can't retrieve the context. It's a
security feature of browsers to block cross-origin requests, i.e., request
going to a different domain.

If you need to test such cases, you should use my playground instead [2].
Here's the direct link for your example:

  http://bit.ly/1eeEi43


Hope this helps,
Markus


[1] https://github.com/json-ld/json-ld.org/issues/298
[2] http://www.markus-lanthaler.com/jsonld/playground/


--
Markus Lanthaler
@markuslanthaler

Received on Sunday, 15 September 2013 11:39:34 UTC