RE: Filters as views (ISSUE-45)

Just a quick reply before I call it a day :-)


On 14 Jan 2016 at 22:47, Ruben Verborgh wrote:
>>> Okay, but what is the meaning then of:
>>> - hydra:filter?
>>> - a boolean as value of hydra:filter?
>>> I just don't understand how to interpret this.
>> 
>> Interpret it as "this parameter acts as a filter, multiple filters are
>> combined with AND".
> 
> The "AND" interpretation is not possible,
> because the hydra:filter property is attached to individual mappings.
> The AND-ness should be decided on the level of all mappings.
> (in other words: you cannot AND a single mapping,
>  you need at least two).
> Plus, I'm still not in favor of this boolean.
> Just "this acts as a filter" is not too interesting.

Well, you couldn't have combinations with ORs etc. but you can surely have
other variables which don't act as filters. But you are right, it's not very
flexible. As already said, I'm more than happy to change either the value of
hydra:filter or move hydra:filter from the IriTemplateMapping out to the
ViewTemplate

>>  {
>>    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
>>    "@id": "http://api.example.com/an-issue/comments",
>>    "@type": "Collection",
>>    "totalItems": "4980",
>>    "member": [
>>      ... a subset of the members of the Collection ...
>>    ],
>>    "view": {
>>      "@id": "http://api.example.com/an-issue/comments?page=3",
>>      "@type": "PartialCollectionView",
>>      "first": "/an-issue/comments?page=1",
>>      "previous": "/an-issue/comments?page=2",
>>      "next": "/an-issue/comments?page=4",
>>      "last": "/an-issue/comments?page=498"
>>    }
>>  }
>>
>> So the members are associated to the collection, not the view. How would
you
>> envision that to work look like when PartialCollectionView is a subclass
of
>> Collection?
> 
> Exactly the same.

Really? So http://api.example.com/an-issue/comments?page=3 would be a
collection with no members?


>> Where would you put the first/previous/next/last links?
> 
> Same place.
> 
>> Where the totalItems count (of both the page and the entire collection)?
> 
> I'd put 4980 where it is; and 100 (assuming this as the page size) on the
view.

OK. This really surprises me. So, how would the filtered version look then?
Would you attach the members to the view in that case? We there and not when
paginating?


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 14 January 2016 22:27:56 UTC