W3C home > Mailing lists > Public > public-hydra@w3.org > November 2015

Re: totalItems with pagination and filtering

From: Maik Riechert <maik.riechert@arcor.de>
Date: Sat, 14 Nov 2015 19:09:48 +0000
To: Tomasz Pluskiewicz <tomasz@t-code.pl>, public-hydra@w3.org
Message-ID: <564786FC.2000103@arcor.de>
Hi Tomasz!

> I would turn this around. Where does /users go when the @id is 
> /users?name=Bob? How about sth like that
>
> GET /users?name=Bob&p=1
> {
>    "@id": "/users?name=Bob",
>    "partOf": "/users"
>    "@type": "Collection",
>    "member": [ ...10 Bob items... ],
>    "totalItems": 50,
>    "view": { .. the page links ... }
> }
>
> My idea would be to always use the parametrized @id (so that you can 
> bookmark it) and add a link to the unfiltered collection, here 
> "partOf" as an example.

After I sent the email I had the same thoughts and I agree, it makes 
more sense to browse through the filtered collection, especially because 
totalItems works then. I also thought about how to link to the 
unfiltered collection, that's tricky.

To help think about it, let's imagine we subclass Collection and use 
something like FilteredCollection which could then include some custom 
predicates like "appliedFilter": {"name": "Bob"}, and the link to the 
unfiltered collection which should be unambiguous. I think partOf 
(dct:isPartOf) is way too generic and doesn't really fit. I typically 
think of partOf as non-overlapping things that make up a given resource. 
What about dct:source instead? "A related resource from which the 
described resource is derived."

Cheers
Maik
Received on Saturday, 14 November 2015 19:10:15 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 14 November 2015 19:10:16 UTC