- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Wed, 13 Nov 2013 14:04:40 +0100
- To: "'Thomas Hoppe'" <thomas.hoppe@n-fuse.de>, <public-linked-json@w3.org>
On Wednesday, November 13, 2013 12:59 PM, Thomas Hoppe wrote: > On 11/13/2013 12:08 PM, Markus Lanthaler wrote: > > On Wednesday, November 13, 2013 11:51 AM, Thomas Hoppe wrote: > >> I have just wrapped my head around a very subtle detail of the spec > >> regarding IRI resolution. > >> Say I'd like to have a node like this: > >> > >> { > >> "@context": { > >> "label": "http://www.w3.org/2000/01/rdf-schema#label" > >> }, > >> "@id": "4711", > >> "label": "Just a simple document" > >> } > >> > >> Which has been retrieved from this URI: > >> > >> http://api.example.com/docs/4711 > >> > >> Following the statements and definitions in sections "6.1 Base IRI" and > >> "5.2 IRIs" one could think that the resulting IRI is: > >> > >> http://api.example.com/docs/47114711 > > Why? That's not how relative IRI resolution works. JSON-LD works > > exactly the same way as, e.g, HTML or CSS in this regard. > > Well look at the example "Example 7: IRIs can be relative" given in > section 5.2. > which uses "../" as @id one could deduce that if there are no slashes > in the > @id that they are just concatenated. > However, if it is defined in the API as you state below I'm happy :) There's nothing in the spec indicating that, is there? It's also not how relative IRIs work in any other technology I'm aware of. The prose above example 7 explains how the relative IRI is interpreted: Values that are interpreted as IRIs, can also be expressed as relative IRIs. For example, assuming that the following document is located at http://example.com/about/, the relative IRI ../ would expand to http://example.com/ -- Markus Lanthaler @markuslanthaler
Received on Wednesday, 13 November 2013 13:05:17 UTC