W3C home > Mailing lists > Public > public-json-ld@w3.org > May 2015

Question related to JSON-LD

From: James Wright <balugajames@gmail.com>
Date: Tue, 19 May 2015 20:15:43 -0600
Message-ID: <CACp0+qyof5Hjdy3YEjsP4qTk-f=_+ENY3WoRrem6f9AuoyxWMw@mail.gmail.com>
To: public-json-ld@w3.org
Hello Everyone,

First let me say that I really appreciate all the work that was done on
JSON-LD. Its really awesome.

Now, I have a problem which I can't seem to figure out. Some of the APIs I
interact with have this sort of pattern or similar:

{
   "id": "23",
    "name": "Bob",
    "resources": {
       "self": {
           "ref": "api/collection/23"
       },
       "html": {
           "ref": "html/collection/bob"
     }
}

So in this case, the @id of the object is located at the path:
resources.self.ref

I can't seem to figure out how to map a context so that this works. After
expansion and compaction I would like this to become:

{
   "@id": "../api/collection/23",
   "givenName": "Bob",
   "webpage": "html/collection/bob"
}

Essentially, 'resources' is meaningless. I can't seem to find a way to
represent this.

I can say:

resources: "@graph"

but then I get the following which is not what I want

{
    "@graph": [ ... ]
}

Any ideas? Or is this a limitation? Basically it would be nice if there was
a to say
- James
Received on Friday, 22 May 2015 11:19:07 UTC

This archive was generated by hypermail 2.3.1 : Friday, 22 May 2015 11:19:08 UTC