Re: JSON-LD: Please keep @base

On 3 May 2013 09:39, Markus Lanthaler <markus.lanthaler@gmx.net> wrote:
>> Turtle allows the use of a relative base, as does HTML (AFAIKR), if
>> @base is seen in the context of an already established base IRI, this
>> could be valid, IMO.
>
> But neither Turtle nor HTML have external contexts. So are you really
> proposing to allow relative URLs in contexts?

After this discussion, I think it would only make sense to allow
relative IRI references (and @base) in contexts if they are scoped to
within that context. From a programming perspective it has to do with
scoping rules; and we have to kind of choose if we go for PHP-style or
Python style name scopes.

To me (with a Python background ;) ), this would feel more natural if
the scopes worked something like:


A context can have a @base
A context can have relative IRI references
The @base of a context can be relative (to the location of the context)

A context can only see names from the contexts it explicitly imports
(ie. it can't see names from the previous context)

@base is not inherited from an external context
Relative IRI references are resolved "locally" - ie within the external context
--> names imported from an external reference are always absolute


This would probably also be more familiar to the semantic web world.



But that would be a big jump from the current "Just keep evaluating in
a single namespace" mechanism; and probably require rewrite of most
parsers - it would also not allow these kind of tricks:
http://bit.ly/16tFZql

{
  "@context": [
  {
    "id": "widget://c13c6f30-ce25-11e0-9572-0800200c9a66/"
  },
  {
    "proxy": "id:.ro/annotations/"
  }],
  "proxy": "bananas"
}



-- 
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester
http://soiland-reyes.com/stian/work/

Received on Friday, 3 May 2013 08:52:38 UTC