W3C home > Mailing lists > Public > public-linked-json@w3.org > January 2012

RE: Aliasing @id results in typed literals for IRIs

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Tue, 10 Jan 2012 19:32:56 +0800
To: <public-linked-json@w3.org>
Message-ID: <015901cccf8b$9c1e0a80$d45a1f80$@lanthaler@gmx.net>
Sorry, my bad, I was setting @iri instead of doing aliasing @id but that
brought me to an interesting question: If we alias keywords, should the
alias be used for compaction and expansion be used or not? So in this case,
if I alias @id to @iri should the output contain @id or @iri?

Also, if I alias @id expansion produces some strange outputs in the
playground when @id is used in the JSON-LD document (it nests an @id within
@id, http://bit.ly/zKljJE): 

{
    "@id": {
        "@id": "#me"
    },
    "http://xmlns.com/foaf/0.1/knows": [{
        "@id": {
            "@id": "http://example/bob#me"
        },
        "http://xmlns.com/foaf/0.1/name": "Bob",
        "http://xmlns.com/foaf/0.1/homepage": {
            "@id": "http://example.com/bob"
        }
    }, {
        "@id": "http://www.markus-lanthaler.com/#me",
        "http://xmlns.com/foaf/0.1/name": "Markus",
        "http://xmlns.com/foaf/0.1/homepage": {
            "@id": "http://www.markus-lanthaler.com/"
        }
    }]
}


"@id": "http://www.markus-lanthaler.com/#me" is correct as I used @iri in
the input document.


--
Markus Lanthaler
@markuslanthaler



> -----Original Message-----
> From: Markus Lanthaler [mailto:markus.lanthaler@gmx.net]
> Sent: Tuesday, January 10, 2012 7:19 PM
> To: public-linked-json@w3.org
> Subject: Aliasing @id creates results in typed literals for IRIs
> 
> Hi,
> 
> I not sure if this is an issue or a desired behavior - at least it's
> not
> wrong. When I alias @id to, e.g. @iri in the JSON-LD playground @id
> gets
> replaced with @iri as expected when used to define the subject, but it
> yields to a typed literal for objects. See example below
> (http://bit.ly/x1Qmfy):
> 
> {
>     "@iri": "#me",
>     "http://xmlns.com/foaf/0.1/knows": [{
>         "@iri": "http://example/bob#me",
>         "http://xmlns.com/foaf/0.1/name": "Bob",
>         "http://xmlns.com/foaf/0.1/homepage": {
>             "@type": "@iri",
>             "@literal": "http://example.com/bob"
>         }
>     }, {
>         "@iri": "http://www.markus-lanthaler.com/#me",
>         "http://xmlns.com/foaf/0.1/name": "Markus",
>         "http://xmlns.com/foaf/0.1/homepage": {
>             "@type": "@iri",
>             "@literal": "http://www.markus-lanthaler.com/"
>         }
>     }]
> }
> 
> 
> --
> Markus Lanthaler
> @markuslanthaler 
Received on Tuesday, 10 January 2012 11:33:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:36 GMT