RE: General JSON-LD question about external context files

Hi Dimitri

> "id" : {
>     "@type" : "@id"
>  }
>
> Works indeed with an integer, but 
>
> "id": "@id"
>
> doesn't. Is this perhaps a bug in the JSON-LD processors? I thought the latter
> was just a shortcut for the first.

Using the first method above, in the N-Quads output you will see something like:

_:b0 <http://vocab.com/vocab#Title> "Event 1" .
_:b0 <http://vocab.com/vocab#id> <http://base.com/1> .
_:b1 <http://vocab.com/vocab#Title> "Event 2" .
_:b1 <http://vocab.com/vocab#id> <http://base.com/2> .

Whereas you probably want the following that can only be achieved by aliasing
the @id keyword:

<http://base.com/1> <http://vocab.com/vocab#Title> "Event 1" .
<http://base.com/2> <http://vocab.com/vocab#Title> "Event 2" .

In section 6.5 Type Coercion [1] of the rec it states "Alternatively, the
keywords @id or @vocab may be used as value to indicate that within the body of
a JSON-LD document, a string value of a term coerced to @id or @vocab is to be
interpreted as an IRI."

So this is probably where the constraint comes to only allow string values to be
interpreted as an IRI.

John

[1] http://www.w3.org/TR/json-ld/#type-coercion

Received on Wednesday, 4 November 2015 11:32:34 UTC