W3C home > Mailing lists > Public > public-json-ld-wg@w3.org > April 2019

Re: Playground error or schema.org error?

From: Ruben Taelman <ruben.taelman@ugent.be>
Date: Thu, 4 Apr 2019 14:37:38 +0200
To: Ivan Herman <ivan@w3.org>, Dan Brickley <danbri@google.com>, "David I. Lehn" <dil@lehn.org>, Gregg Kellogg <gregg@greggkellogg.net>
Cc: W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
Message-ID: <etPan.5ca5fa93.169fe0d3.136@ugent.be>
Hi Ivan,

I assume this is due to CORS being configured incorrectly on the schema.org server,
or due to a recent change in the CORS spec.
This is the error I am seeing in the console:

> Access to XMLHttpRequest at 'https://schema.org/docs/jsonldcontext.json' (redirected from 'https://schema.org/') from origin 'https://json-ld.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

It’s possible that you are experiencing the same problem we also started seeing in our tooling recently [1].
We have proposed a new change in the CORS spec to resolve these kinds of problems in the future [2].

Regarding the curl command,
I thought contexts should only be returned with a 'application/ld+json’ header.
(Also note that the follow-redirects option should be enabled on curl)
The following command produces the correct result:

> curl -LH "Accept: application/ld+json" https://schema.org

Kind regards,
Ruben Taelman

[1] https://github.com/comunica/comunica/issues/373
[2] https://github.com/whatwg/fetch/issues/878

On 4 April 2019 at 14:24:21, Ivan Herman (ivan@w3.org) wrote:

Just wondering:

https://tinyurl.com/y45ycru2

reports an error on playground on the context line referring to 'schema.org' (the JSON-LD snippet comes from the draft).

I *suspect* this a schema.org error; if I say:

curl --header "Accept: application/json" https://schema.org

I would expect to receive a json-ld file, but I get an HTML instead…

Am I misreading something? Maybe something went wrong when the new version of schema.org was installed a few days ago?

Ivan

----
Ivan Herman, W3C 
Publishing@W3C Technical Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
ORCID ID: https://orcid.org/0000-0003-0782-2704
Received on Thursday, 4 April 2019 12:38:08 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 4 April 2019 12:38:09 UTC