RE: Filters as views (ISSUE-45)

On 13 Jan 2016 at 08:39, Tomasz Pluskiewicz wrote:
> January 12 2016 11:53 PM, "Markus Lanthaler" <markus.lanthaler@gmx.net> wrote:
>> On 12 Jan 2016 at 22:10, Karol SzczepaƄski wrote:
>>> The only objection I could made is that whe we're not keen to move the
>>> paging to that templating mechanism as well:
>> 
>> Actually, this proposal paves the way for that :-)
>> But let's first see if we reach consensus on the proposed design.
> 
> I'm all for it.

OK, I count that as a +1 :-)


> This is what I meant yesterday when I wrote that paging and filtering are two
> sides of the same coin - resource derivation. I find your design abstract enough so that it
> doesn't make any assumptions about the nature of the original and derived resource
> 
> One thing I'm thinking about is inverting the resource/view relation in representation. I think
> it's been discussed so please bear with me. What were the cons of having the view "first"?

Nothing really. They are semantically equivalent. In fact, you can define a "viewOf" reverse property in your JSON-LD context  and serialize it as in your example below if you prefer. If I remember correctly, the main reason we decided to do it the other way round was because serializations (collection with and without pagination) follow the same structure.


> {
> "@id": "/collection?page=2",
> "@type": "PartialCollectionView",
> "first": "/collection?page=1",
> "previous": "/collection?page=1",
> "last": "/collection?page=2",
> "viewOf": {
> "@id": "/collection",
> "totalItems": 2345,
> "member": [ ... ]
> }
> }


--
Markus Lanthaler
@markuslanthaler

Received on Wednesday, 13 January 2016 20:41:58 UTC