Re: How to avoid that collections "break" relationships (ISSUE-41)

On Jun 15, 2014, at 10:16 AM, ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org> wrote:

> On 06/13/2014 12:14 AM, Markus Lanthaler wrote:
> 
>> Sure. I just created a Wiki page summarizing the current state of affairs:
>> 
>>  https://www.w3.org/community/hydra/wiki/Collection_Design
>> 
>> Hope this helps. If not, please let me know.
> I assume one can also use such collection this way?
> {
>  "@id": "/alice/friends",
>  "@type": "Collection",
>  "manages": {
>    "property": "schema:knows",
>    "subject": {
>      "@id": "/alice",
>      "schema:name": "Alice"
>      "schema:image": "https://photos.example.me/saying-tofuuuu.png"
>    }
>  }
> }
> 
> http://www.w3.org/TR/json-ld/#embedding
> 
> I don't argue that it has any advantages over getting data about
> </alice> with separate request, just wondering if embedding also applies
> here.

From an RDF/JSON-LD perspective, this is of course perfectly fine. Putting the collection in context, you might have something like the following:

{
  “@id”: “/alice”,
  “@type”: “Person”,
  “name”: “Alice”,
  “image”: "https://photos.example.me/saying-tofuuuu.png”,
  “hasCollection”: [{
    “@id”: “/alice/friends”,
    “@type”: “Collection”,
    “manages”: {“property”: “knows”, “subject”: “/alice”}
  }]
}

As RDF, the two representations are semantically equivalent, and just from JSON-LD, if you flatten you’ll also coalesce the properties from both the outer- and inner- versions of alice to something like the following:

[
  {
    “@id”: “/alice”,
    “@type”: “Person”,
    “name”: “Alice”,
    “image”: "https://photos.example.me/saying-tofuuuu.png”,
    “hasCollection”: “/alice/friends”
  }, {
    “@id”: “/alice/friends”,
    “@type”: “Collection”,
    “manages”: “_:a”
  }, {
    “@id”: “_:a”,
    “property”: “knows”,
    “subject”: “/alice”
  }
]

Gregg

Received on Sunday, 15 June 2014 18:35:04 UTC