Re: Schema.org just published a JSON-LD context

On 17 June 2014 11:21, Dan Brickley <danbri@danbri.org> wrote:
> On 17 June 2014 11:13, Stian Soiland-Reyes
> <soiland-reyes@cs.manchester.ac.uk> wrote:
>> Brilliant news!
>>
>>
>> However..
>>
>>
>>     Cache-Control: no-cache
>>
>> means the context will be re-requested for every parsing.  (e.g.
>> jsonld-java will normally cache contexts -
>> https://github.com/jsonld-java/jsonld-java#controlling-network-traffic)
>> I guess Google can handle the load, but it would mean slow-down for
>> clients.
>>
>>
>> Also the header
>>
>>     Vary: Accept
>>
>> is missing (indicating that you could get a different representation
>> if you have a different Accept header) - but given the above that is
>> not a big issue..
>
> Thanks. This release was bordering on the 'easter egg' level of
> maturity, but I think we can fix it up pretty quickly. There's basic
> caching in the (appengine) app so the context file is only computed
> once, but you're right these details need attending to.

OK, thanks Markus, Stian. I've just updated the live site,

 curl --verbose -H "Accept: application/ld+json" http://schema.org/ | head

...should show better headers now.

> GET / HTTP/1.1
> User-Agent: curl/7.30.0
> Host: schema.org
> Accept: application/ld+json
>
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Content-Type: application/ld+json
< Cache-Control: public, max-age=43200
< Vary: Accept, Accept-Encoding
< Date: Tue, 17 Jun 2014 11:24:30 GMT
* Server Google Frontend is not blacklisted
< Server: Google Frontend
< Content-Length: 15957
< Alternate-Protocol: 80:quic


Current code is here:
https://github.com/rvguha/schemaorg/blob/master/api.py#L329

Notes on improving it: https://github.com/rvguha/schemaorg/wiki/JsonLd

This thread is a fine place to continue discussions too.

I'm tempted to look at a format like
http://danbri.org/2013/SchemaD3/examples/4063550/hackathon-schema2.js
which can be directly understood by D3.js - e.g.
http://danbri.org/2013/SchemaD3/examples/4063550/hack3c.html ... but
maybe the context file isn't the ideal place to put all those schema
details?

Is it considered better practice to have an informative, full-featured
context file, or something small and compact for speedy access?

cheers,

Dan

Received on Tuesday, 17 June 2014 11:41:58 UTC