- From: John Walker <john.walker@semaku.com>
- Date: Wed, 4 Nov 2015 12:31:59 +0100 (CET)
- To: Asbjørn Ulsberg <asbjorn@ulsberg.no>, Melvin Carvalho <melvincarvalho@gmail.com>, Dimitri van Hees <info@dimitrivanhees.com>
- Cc: "public-hydra@w3.org" <public-hydra@w3.org>
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