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

Re: Updated my JSON-LD serializer for the RDFa distiller

From: Ivan Herman <ivan@w3.org>
Date: Thu, 19 Jan 2012 14:05:14 +0100
Cc: "'Linked JSON'" <public-linked-json@w3.org>
Message-Id: <314686E9-D26F-488D-A303-2D41253CCBB0@w3.org>
To: "Markus Lanthaler" <markus.lanthaler@gmx.net>
Ah, ok. That is fine. In my current generated JSON-LD, if I use a full URI as a key in the context, I use the same full URI in the data.

(Again, I will simplify and beautify this soon, and this will disappear, but just for my understanding...)

Thanks!

Ivan

On Jan 19, 2012, at 13:37 , Markus Lanthaler wrote:

> Hi Ivan
> 
>> although, actually, I have some plans to change the output to do
>> something like that anyway, just for my understanding: do you mean to
>> say that the approach I have below will become invalid? Ie, that
>> putting a URI as a key will become invalid? Or that the alternative of
>> using a CURIE become a possibility? I am still a bit messed up...
> 
> No, it would still be a completely valid document but the type coercion
> wouldn't apply to those properties in the document as you use CURIEs there.
> I think an example makes it easier to understand:
> 
> {
>    "@context": {
>        "foaf": "http://xmlns.com/foaf/0.1/",
>        "http://xmlns.com/foaf/0.1/mbox": {
>            "@type": "@id"
>        },
>        "foaf:homepage": {
>            "@type": "@id"
>        }
>    },
> 
>    "http://xmlns.com/foaf/0.1/mbox": "mailto:alice@example.com",
>    "foaf:homepage": "http://example.com/eve",
> 
>    "foaf:mbox": "mailto:alice@example.com",
>    "http://xmlns.com/foaf/0.1/homepage": "http://example.com/eve"
> }
> 
> 
> In this example the first two properties would be coerced to IRIs, the
> latter two wouldn't. The reason is that a parser wouldn't find the type
> coercion as the property keys in the document and in the context don't
> match.
> 
> Hope this helps.
> 
> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf







Received on Thursday, 19 January 2012 13:04:06 GMT

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