Question related to JSON-LD

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