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

On Tuesday, May 06, 2014 11:10 AM, Vagif Abilov wrote:
> After reading more of the specs I believe our way to go is to use
> @container/@index that allows keeping in a compacted form unmapped
> properties with primitive values. If values are objects, then we will
> have to define local context for them.

Vagif, we do those properties come from? Are they user generated? Can't you just mint an IRI for them? If you don't know all of them beforehand, you can work around that by simply setting @vocab to some "vocabulary base". Something like

  {
    "@context": {
      "@vocab": "http://example.com/unknown-properties#"
    }
  }

That way "favouriteSoccerClub" would for example be expanded to "http://example.com/unknown-properties#favouriteSoccerClub"


HTH,
Markus


--
Markus Lanthaler
@markuslanthaler


 

> 
> 
> Cheers Vagif
> 
> On Tue, May 6, 2014 at 9:38 AM, Vagif Abilov <vagif.abilov@gmail.com> wrote:
> Thanks Gregg,
> 
> You are writing "ignored (or dropped)", and for us it makes a big
> difference whether unmapped data are ignored or dropped. Obviously we
> don't want parts of information to be dropped from the JSON response
> (returned as JSON-LD). Are there any rules for when unmapped data are
> simply ignored and when they are dropped? Best regards Vagif
> 
> On Mon, May 5, 2014 at 8:22 PM, Gregg Kellogg <gregg@greggkellogg.net> wrote:
> 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 Saturday, 10 May 2014 13:23:56 UTC