Re: JSON-LD onsite examples: are @context values missing a trailing slash?

On  2015-Feb-17, at 23:30, Gregg Kellogg <gregg@greggkellogg.net> wrote:

> This isn't a JSON-LD heuristic, but a general web server mechanism to handle ill-formed URLs. As it happens, although it's common practice, http://schema.org is not a valid URL, as it doesn't have a path component. However, it's common practice for web servers to handle such URLs by normalizing them, in this case, by adding a trailing '/'. Some servers do this by redirecting the agent to the proper resource, it seems that schema.org simply returns the expected resource.

A URL without a path is perfectly valid. See the ‘path-abempty’ component of URI syntax.

Web servers themselves don’t process full URLs in this way - because a user agent won’t ever *send* a full URL to a server.

As a consequence, the canonicalisation of ‘http://schema.org' to ‘http://schema.org/' has absolutely nothing to do with web server processing.

No user agent will make an empty request (i.e., one without a path) to an HTTP server, because is syntactically prohibited. There is no redirect going on. The URI ‘http://schema.org' is canonically identical to ‘http://schema.org/' and ‘http://schema.ORG/'.

@vocab in JSON-LD, @prefix (or PREFIX) in Turtle and xmlns in RDF/XML perform direct string concatenation *prior* to any URI processing.

This is in contrast to @context in JSON-LD, @base in Turtle, or xml:base in RDF/XML, which provide a resolution base used *as part of* URI processing (see “Reference Resolution” in the URI spec). Because of this, @vocab/@prefix/xmlns must all be the fully-formed absolute base URI to which the local name will be concatenated (or else the result will be malformed), whereas @context/@base/xml:base can be any well-formed URI.

M.

-- 
Mo McRoberts - Chief Technical Architect - Archives & Digital Public Space,
Zone 2.12, BBC Scotland, 40 Pacific Quay, Glasgow G51 1DA,
MC3 D6, Media Centre, 201 Wood Lane, London W12 7TQ,
0141 422 6036 (Internal: 07-311707) - PGP key CEBCF03E

Received on Thursday, 19 February 2015 12:17:10 UTC