Re: JSON-LD context file at schema.org - request for feedback

On 21 January 2015 at 17:51, Kingsley  Idehen <kidehen@openlinksw.com> wrote:
> On 1/21/15 10:38 AM, ☮ elf Pavlik ☮ wrote:
>
> On 01/21/2015 04:12 PM, Kingsley Idehen wrote:
>
>> On 1/21/15 8:05 AM, Dan Brickley wrote:
>
>>> The context is content negotiable from the site homepage but also
>>> available at http://schema.org/docs/jsonldcontext.json.txt

> Thanks for untangling my tangled mess of content-type names :)

Yeah, the "ld+json" bit always throws me off balance too.

> Now when I copy and paste your example above, I get different results:
>
> curl -IH "Accept: application/ld+json" http://schema.org
> HTTP/1.1 405 Method Not Allowed
> Allow: GET
> Content-Type: text/plain; charset=UTF-8
> Content-Length: 77
> Date: Wed, 21 Jan 2015 17:48:04 GMT
> Server: Google Frontend
> Alternate-Protocol: 80:quic,p=0.02
>
> Here's what works:
>
> curl -iH "Accept: application/ld+json" http://schema.org

It looks like you're trying to do an HTTP HEAD here? That isn't
currently supported in the site implementation for Python-generated
content, only for static files.

The site is an opensource appengine Python app. Looking at
https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass#RequestHandler_head
I suspect we could have it respond to HEAD by adding a "def head(self,
node):" function implementation around here:
https://github.com/schemaorg/schemaorg/blob/master/api.py

> > Is there any chance of -I working alongside -i ?

http://curl.haxx.se/docs/manpage.html

-i, --include

(HTTP) Include the HTTP-header in the output. The HTTP-header includes
things like server-name, date of the document, HTTP-version and
more...

-I, --head

(HTTP/FTP/FILE) Fetch the HTTP-header only! HTTP-servers feature the
command HEAD which this uses to get nothing but the header of a
document. When used on an FTP or FILE file, curl displays the file
size and last modification time only.

... seems like implementing a "head(self, node)" function would facilitate this.

I've filed an issue, although it's in the "someday" pile:
https://github.com/schemaorg/schemaorg/issues/256

> Would it be possible for a .jsonld doc to be published, that set to content-type "application/ld+json" rather than a .txt file that currently returns content-type "text/html" ?

I put in both versions already; the idea is that for a real context
file, you use the homepage. For debugging, you can use the .txt
version (text/plain). But also:

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

... should do what you want.

cheers,

Dan

Received on Thursday, 22 January 2015 12:00:35 UTC