Re: relate a Collection and a PagedCollection

Hi Markus,

>>> {
>>>   "@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?

It surprises me you say this,
because that is exactly how PagedCollection works in Hydra now.
Currently, the first page == the collection,
so "markus knows /friend-collection" could mean either or both.

This ambiguity is precisely the reason why I proposed the other approach
in which the first page != the collection.

But for "backwards" compatibility (= current Hydra approach),
you _could_ make them the same if you wanted to.
Or we can explicitly forbid this.
I just pointed it out to show my approach
can be compatible with the current PagedCollection approach.

>> The good thing is, with the above,
>> the user can choose whether (s)he wants hybrid or not.
> 
> How would you convey that information?

Simply

{
  "@id": "/collection",
  "@type": "Collection",
  "totalItems": 243,
  "itemsPerPage": 10,
  "nextPage": /collection?page=2",
  "lastPage": "/collection?page=24"
}

> Especially if Page is a subclass of Collection it isn't that simple anymore IMO.

True.

> 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.

Well, you know my preference by now ;-)

Cheers,

Ruben

Received on Sunday, 27 April 2014 16:19:41 UTC