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

Re: Playground error or schema.org error?

From: Richard Wallis <rjw@dataliberate.com>
Date: Thu, 4 Apr 2019 18:29:32 +0100
Cc: "Cole, Timothy W" <t-cole3@illinois.edu>, Richard Wallis <richard.wallis@dataliberate.com>, Ivan Herman <ivan@w3.org>, Dan Brickley <danbri@google.com>, Gregg Kellogg <gregg@greggkellogg.net>, "David I. Lehn" <dil@lehn.org>, W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
Message-Id: <C2A2C79F-31E8-4AA1-B3B4-6FE983E13B37@dataliberate.com>
To: Pierre-Antoine Champin <pierre-antoine.champin@univ-lyon1.fr>
Simple enough to rectify that. 

Looking to apply some post release tiny technical tweaks tomorrow, so will include that as well. 

When done I’ll check out what happens in Playground. 

~Richard 

> On 4 Apr 2019, at 17:03, Pierre-Antoine Champin <pierre-antoine.champin@univ-lyon1.fr> wrote:
> 
> The only URL that works for me in the playground is "http://schema.org",
> and this is indeed because it does *not* query the original URL, but instead:
> https://json-ld.org/playground/proxy.php?url=http://schema.org
> 
> For any other variant, the original URL is requested,
> and the console displays a Cross-Origin Request error message on the 2nd request
> (i.e. after the succesful redirection).
> 
> This is *definitely* related to the fact that 
>     https://schema.org/docs/jsonldcontext.json
> is missing the header
>     access-control-allow-origin: *
> 
>> On Thu, 4 Apr 2019 at 17:55, Cole, Timothy W <t-cole3@illinois.edu> wrote:
>> Most of which, I now notice, Ruben pointed out earlier (but his note got lost from the main thread)....
>> 
>>  
>> 
>> From: Cole, Timothy W <t-cole3@illinois.edu> 
>> Sent: Thursday, April 4, 2019 10:48 AM
>> To: 'Richard Wallis' <richard.wallis@dataliberate.com>
>> Cc: 'Ivan Herman' <ivan@w3.org>; 'Dan Brickley' <danbri@google.com>; 'Gregg Kellogg' <gregg@greggkellogg.net>; 'David I. Lehn' <dil@lehn.org>; 'W3C JSON-LD Working Group' <public-json-ld-wg@w3.org>
>> Subject: RE: Playground error or schema.org error?
>> 
>>  
>> 
>> Richard-
>> 
>>  
>> 
>> Could it matter that https://schema.org, https://schema.org/CreativeWork, etc. all include the "access-control-allow-origin: *" response header, but the response for https://schema.org/docs/jsonldcontext.json (to which content negotiation always redirects eventually) does not include this response header?
>> 
>>  
>> 
>> Seems unlikely given the one "@context" value that seems to work (which does same redirect, albeit with an extra redirect in between). One wonders if the playground has cached the schema.org context for http://schema.org
>> 
>>  
>> 
>> By the way, adding to the context values that don't work in the playground: "@context": "https://schema.org/docs/jsonldcontext.json"
>> 
>>  
>> 
>> Thanks,
>> 
>>  
>> 
>> -Tim Cole
>> 
>>  
>> 
>> From: Richard Wallis <richard.wallis@dataliberate.com> 
>> Sent: Thursday, April 4, 2019 10:13 AM
>> To: Cole, Timothy W <t-cole3@illinois.edu>
>> Cc: Ivan Herman <ivan@w3.org>; Dan Brickley <danbri@google.com>; Gregg Kellogg <gregg@greggkellogg.net>; David I. Lehn <dil@lehn.org>; W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
>> Subject: Re: Playground error or schema.org error?
>> 
>>  
>> 
>> Ivan, all
>> 
>>  
>> 
>> Investigating this issue has identified several individual things that led to the presumption of an error.
>> 
>>  
>> 
>> Background operation
>> 
>> When the Schema.org application detects it is being asked for the jsonld context file, it returns a http 302 redirect to '/docs/jsonldcontext.json' which builds and returns the context file.  As an aside, an easily readable version of that file is available at /docs/jsonldcontext.json.txt 
>> 
>>  
>> 
>> Use of curl for testing
>> 
>> As the response is a 302 redirect, the -L option is needed enabling it to follow redirects.
>> 
>> Also as Tim points out, the correct Accept value should be application/ld+json
>> 
>>  
>> 
>> Behaviour of example provided (https://tinyurl.com/y45ycru2)
>> 
>> In the example is the following line and the reported error:
>> 
>>  "@context": "http://schema.org/",
>> 
>>  
>> 
>> Potentially the context URI could be rewritten in the following ways with at least some expectation that it would result in valid operation:
>> 
>>  "@context": "https://schema.org/",
>> 
>>  "@context": "https://schema.org",
>> 
>>  "@context": "http://schema.org",
>> 
>>  
>> 
>> In the Playground, only the last of these does not report an error.
>> 
>>  
>> 
>> Testing all four combinations using curl (with -L option and application/ld+json as the Accept value) results in the correct format being returned in every case.
>> 
>>  
>> 
>> This suggests to me that is an issue with the Playground, when encountering https and/or trailing slashes in @context URIs.   My tests indicate that the Schema.org application is functioning correctly in this area.
>> 
>>  
>> 
>>  
>> 
>> ~Richard.
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>> Richard Wallis
>> 
>> Founder, Data Liberate
>> 
>> http://dataliberate.com
>> 
>> Linkedin: http://www.linkedin.com/in/richardwallis
>> 
>> Twitter: @rjw
>> 
>> <image001.jpg>
>> 
>>  
>> 
>>  
>> 
>> On Thu, 4 Apr 2019 at 15:57, Cole, Timothy W <t-cole3@illinois.edu> wrote:
>> 
>> Ivan
>> 
>>  
>> 
>> I set the Accept header to application/ld+json and get the correct result as of 2 minutes ago.  I also got the correct result with this header last week.
>> 
>>  
>> 
>> I don't think Accept: application/json has ever worked to get the context document.
>> 
>>  
>> 
>> Of course this may have no bearing on playground issue.
>> 
>>  
>> 
>> -Tim Cole
>> 
>>  
>> 
>> From: Ivan Herman <ivan@w3.org> 
>> Sent: Thursday, April 4, 2019 8:56 AM
>> To: Richard Wallis <richard.wallis@dataliberate.com>
>> Cc: Dan Brickley <danbri@google.com>; Gregg Kellogg <gregg@greggkellogg.net>; David I. Lehn <dil@lehn.org>; W3C JSON-LD Working Group <public-json-ld-wg@w3.org>
>> Subject: Re: Playground error or schema.org error?
>> 
>>  
>> 
>> Richard, Dan,
>> 
>>  
>> 
>> thanks for the quick reactions!
>> 
>>  
>> 
>> Ivan
>> 
>>  
>> 
>> On 4 Apr 2019, at 15:07, Richard Wallis <richard.wallis@dataliberate.com> wrote:
>> 
>>  
>> 
>> Ivan,
>> 
>>  
>> 
>> Your expectation is correct - looking in to it now.
>> 
>>  
>> 
>>  
>> 
>> ~Richard.
>> 
>> Richard Wallis
>> 
>> Founder, Data Liberate
>> 
>> http://dataliberate.com
>> 
>> Linkedin: http://www.linkedin.com/in/richardwallis
>> 
>> Twitter: @rjw
>> 
>> <image001.jpg>
>> 
>>  
>> 
>>  
>> 
>> On Thu, 4 Apr 2019 at 13:59, Dan Brickley <danbri@google.com> wrote:
>> 
>> + Richard Wallis
>> 
>>  
>> 
>> We switched to a new version of site codebase on Monday. Richard, any ideas?
>> 
>>  
>> 
>> On Thu, 4 Apr 2019, 05:24 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
>> 
>>  
>> 
>>  
>> 
>> 
>> ----
>> 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 17:30:01 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 4 April 2019 17:30:02 UTC