W3C home > Mailing lists > Public > public-hydra@w3.org > June 2014

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

From: <thomas.hoppe@n-fuse.de>
Date: Sun, 15 Jun 2014 20:45:04 +0200
Message-ID: <20140615184504.5886097.4894.25122@n-fuse.de>
To: Gregg Kellogg <gregg@greggkellogg.net>, ☮ elf Pavlik ☮ <perpetual-tripper@wwelves.org>
Cc: public-hydra@w3.org


Gesendet von meinem BlackBerry 10-Smartphone.
  Originalnachricht  
Von: Gregg Kellogg
Gesendet: Sonntag, 15. Juni 2014 20:35
An: ☮ elf Pavlik ☮
Cc: public-hydra@w3.org
Betreff: 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:45:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 15:53:59 UTC