RE: Updated Editor's Draft of JSON-LD Syntax

> > It is a separate issue.. and is not just about that. Consider the
> following
> > JSON-LD document:
> >
> > {
> >  "@context": {"homepage": "http://xmlns.com/foaf/0.1/homepage"},
> >  "@id": "homepage#me",
> >  "homepage": {"@id": "homepage"}
> > }
> >
> 
> I see where you are going but I think that
> 
> <homepage#me> <http://xmlns.com/foaf/0.1/homepage>
> <http://xmlns.com/foaf/0.1/homepage> .
> 
> is probably the right answer, though clearly not the intended one...

That would be the output according to the current spec.

 
> Ie, if starting to define a microsyntax to expand parts of a string
> (even if we know that the string is a URI) is feature creep for my
> taste.

I can't see any problem with requiring relative IRIs to start with an "/" or
".", that's as much a microsyntax as the use of a colon to separate prefixes
from suffixes:

{
  "@context": {"homepage": "http://xmlns.com/foaf/0.1/homepage"},
  "@id": "homepage#me",
  "homepage": {"@id": "/homepage"}
}

I would even go a step further and say that this makes a JSON-LD document
much more readable and way easier to understand.


> However... what this seems to ask for is a @base. An earlier version of
> JSON-LS had this, afaik; maybe it is time to revisit this?

No, @base wouldn't solve the above issue per se. But you are right, you
could use an empty prefix for this (which basically emulates @base) as
follows:

{
  "@context": {
    "": "http://www.example.com/",
    "homepage": "http://xmlns.com/foaf/0.1/homepage"
   },
  "@id": "homepage#me",
  "homepage": {"@id": ":homepage"}
}




--
Markus Lanthaler
@markuslanthaler

Received on Monday, 23 January 2012 16:15:30 UTC