Re: Filters as views (ISSUE-45)

On 10. jan. 2016, at 20.58, Ruben Verborgh <ruben.verborgh@ugent.be> wrote:

> Example:
>    "This video is really funny, but the audio in its AVI version is broken."
> Then we have the video resource:
>    /videos/funny-video
> which has several representations (AVI, MOV, MP4).
> In order to make the statement above,
> we also need to identify the "representation",
> which thereby acts as a resource:
>    /videos/funny-video.avi
> This resource itself can have representations in turn.

I don’t agree. These two:

    /videos/funny-video
    /videos/funny-video.avi

have nothing to do with one another; they are two different resources. It’s possible for a server to redirect the client to the .avi version if it receives an Accept-header of "video/avi”, but it could also just serve the .avi version directly without letting the client know about its URI.

So while representations can have different URIs, they don’t have to and when they do, they take on the form of separate resources themselves.

> A filter that acts as a hypermedia control,
> describing how client input goes from one collection resource to another,
> is perfectly composable and generalizable.

I think I agree with you.

>> @id: /friends
>> member: [ ... ]
>> view: {
>>   @type: ViewTemplate, IriTemplate
>>   template: /friends{?gender}
>>   mapping: {
>>     variable: gender
>>     property: http://schema.org/gender
>>     filter: true
>> }
> 
> The alternative with hydra:filter as proposed before:
> 
> @id: "/friends",
> filter: {
>   template: "/friends{?gender}",
>   mapping: {
>     variable: "gender",
>     property: "http://schema.org/gender"
>  }
> }

I prefer the latter too.

> In general, this makes me wonder what the difference is
> between a collection and a partial collection view.
> Do we really need to distinguish?

I think we don’t.

> Seems much simpler is everything is just a collection,
> with a relation to its parent collection.
> Way fewer classes; much easier to explain.

I agree.

> PS For paging, I see the use of a partial view:
> after all, there are more "parts" in the series.
> But for filters, there's just one part: the parent,
> and a possible child, which is just another filter.

Yep.

-- 
Asbjørn Ulsberg           -=|=-        asbjorn@ulsberg.no
«He's a loathsome offensive brute, yet I can't look away»

Received on Monday, 11 January 2016 20:04:59 UTC