Re: relate a Collection and a PagedCollection

On 04/25/2014 07:29 PM, Markus Lanthaler wrote:
> On Friday, April 25, 2014 6:34 PM, Ruben Verborgh wrote:
>>> To illustrate, we might return something like the following:
>>>
>>> </collection> a hydra:PagedCollection;
>>>  hydra:member <1>, <2>, ...;
>>>  hydra:nextPage </collection?page=2>;
>>>  hydra:pageOf </collection#dataset> .
>>> <collection#dataset> a hydra:Collection;
>>>  hydra:totalItems 243;
>>>  hydra:itemsPerPage 10;
>>>  hydra:firstPage </collection>;
>>>  hydra:lastPage </collection?page=24> .
>>>
>>> I think this is pretty close to what you originally proposed. This does
> allow for a certain
>> amount of semantic purity, but practically doesn't do more for me than
> just collapsing the
>> dataset properties down to the PagedCollection (or CollectionPage, if you
> prefer).
> 
> Yeah. I agree. Let me convert this to JSON-LD because I think that will be
> easier for a lot of people on this list to understand and evaluate. Here's
> Gregg's Turtle converted 1:1, the first page is the "central" resource:
> 
>   {
>     "@id": "/collection",
>     "@type": "Page(dCollection)",
>     "member": [ "1", "2", "..." ],
>     "nextPage": /collection?page=2",
>     "pageOf": {
>       "@id": "/collection#dataset",
>       "@type": "Collection",
>       "totalItems": 243,
>       "itemsPerPage": 10,
>       "firstPage": "/collection",
>       "lastPage": "/collection?page=24"
>     }
>   }
> 
> This has the advantage that the representations of all pages would look more
> or less the same. The downside is, that you would have to link to
> /collection#dataset instead of just /collection. So it would be
> 
>   {
>     "@id": "markus",
>     "knows": "/friend-collection#dataset"
>   }
>   
> An alternative serialization could put the collection itself at the center
> (please note that I changed the resource identifiers):
>   
>   {
>     "@id": "/collection",
>     "@type": "Collection",
>     "totalItems": 243,
>     "itemsPerPage": 10,
>     "firstPage": {
>       "@id": "/collection#page",
>       "@type": "Page(dCollection)",
>       "member": [ "1", "2", "..." ],
>       "nextPage": /collection?page=2",
>       "pageOf": "/collection"
>     },
>     "lastPage": "/collection?page=24"
>   }
> 
> The disadvantage here is that while it looks nice for the first page, it
> kind of breaks down for all other pages.

how about:

* PagedCollection SHOULD embed it's first Page

   {
     "@id": "/collection",
     "@type": "PagedCollection",
     "totalItems": 243,
     "itemsPerPage": 10,
     "firstPage": {
       "@id": "/collection?page=1",
       "@type": "Page",
       "member": [ "1", "2", "..." ],
       "nextPage": /collection?page=2",
       "pageOf": "/collection"
     },
     "lastPage": "/collection?page=24"
   }

* Page SHOULD embed PagedCollection it belongs to

   {
     "@id": "/collection?page=1",
     "@type": "Page",
     "member": [ "1", "2", "..." ],
     "nextPage": /collection?page=2",
     "pageOf": {
       "@id": "/collection",
       "@type": "PagedCollection",
       "totalItems": 243,
       "firstPage": "/collection?page=2",
       "lastPage": "/collection?page=24"
       "itemsPerPage": 10
     }
   }

using PagedCollection (subclasOf: Collection) for fristPage and itemsPerPage

BTW I missed this conversation and created duplicate in
http://lists.w3.org/Archives/Public/public-hydra/2014Oct/0000.html

I also in intuitive way distinguished Collection from its pages in my
first draft for Social WG comparison:
https://www.w3.org/wiki/index.php?title=Socialwg/Collection_Comparison&oldid=77016

Received on Wednesday, 1 October 2014 11:58:20 UTC