Re: Embedding a plain JSON node in a JSON-LD document

On May 5, 2014, at 2:13 PM, Vagif Abilov <vagif.abilov@gmail.com> wrote:

> Hi,
> 
> We have a bit of a challenge with some of the resources that we are exposing over the Web using REST services. We strive to return all responses as JSON-LD documents, but the structure of some  document sections is not determined upfront, which means we can't build JSON-LD context for such documents. Currently we are returning them as plain JSON documents, but we would like to do better than that. Consider the following document:
> 
> {
>   firstName: "John",
>   lastName: "Smith",
>   dateOfBirth: "1970/03/12",
>   additionalInfo: {
>     favouriteSoccerClub: "soccer"
>   }
> }
> 
> In the document above "firstName", "lastName", "dateOfBirth" represent information with defined context, so it can be returned in a JSON-LD response. But "favouriteSoccerClub" is a part of a property bag with items added ad-hoc, so they can't be semantically described. Is it possible to expose such document as JSON-LD with "additionalInfo" embedded as some kind of CLOB but in a JSON format, so "additionalInfo" would still be a valid JSON node?

Sure, if “additionalInfo” isn’t mapped to a URI, it and it’s contents will simply be ignored (or dropped) when processed by a JSON-LD algorithm such as “expand”, so it’s fine to include data that shouldn’t be interpreted.

Gregg

> Thanks in advance
> 
> Vagif

Received on Monday, 5 May 2014 18:23:21 UTC