RE: relate a Collection and a PagedCollection

On Friday, April 25, 2014 7:42 PM, Ruben Verborgh wrote:
> >  {
> >    "@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"
> >  }
> 
> The good thing is. people who feel that
>     /collection#dataset == /collection
> can just write that. Which is great.
> 
> So if you want, you can treat a collection and a page as the same thing.
> If you don't want that (like me), you don't have to. Good!

Really? If we introduce this strong separation of concepts, it becomes
completely ambigous of what is meant if things like these would be allowed.
Would "markus" then only know the people on that specific page or also
people on other pages?


> > 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"
> >  }
> 
> I like that serialization too, good to have a choice!
> 
> > The disadvantage here is that while it looks nice for the first page, it
> > kind of breaks down for all other pages.
> 
> It could still be "hasPage" though.
> 
> > I also still think that hybrid is OK, but the totalItems property is
indeed tricky.
> 
> The good thing is, with the above,
> the user can choose whether (s)he wants hybrid or not.

How would you convey that information? Especially if Page is a subclass of
Collection it isn't that simple anymore IMO. I'm a bit skeptical that it is
a good thing to allows both hybrids and strict separation. I think we should
decide on one of the two.


--
Markus Lanthaler
@markuslanthaler

Received on Sunday, 27 April 2014 13:38:03 UTC