Re: Relationship between filter properties and hydra:supportedProperty (was Re: Filters as views (ISSUE-45))

2016-02-15 11:22 GMT+01:00 Maxim Kolchin <kolchinmax@gmail.com>:

>> The comparator itself may be not very precise - I think Tom already
>> throw few more examples, i.e. for strings it can be "equals", but it may
>> also be "startsWith", "endsWith", "matches", etc. W may end up with
>> quite a dictionary here.
>
> I agree, it's not very precise, but I don't see an alternative right
> now. Some limited number of comparators could be included in the core
> spec which would represent 80% of use cases. The rest could be define
> in a separate vocabulary for example.

As I've stated before, I don't think it's necessary for Hydra to do
anything in this regard. OData[1] has specified the operators and
functions (comparators) we need, covering more than the 80% already.

>> As for multiple mapping - we're entering a swampy turf here - how client
>> is supposed to concatenate these multiple properties? While indeed it
>> might be useful (as I'm also seeking for a way of telling the client how to
>> build i.e. a display name from various properties), but this poses quite a
>> challange on it's own.

OData already specifies how this is to be handled.

> The multiple mapping means that the mapping will be applied to each of
> the properties independently and the results will be joined. A
> resource is included in a result set if at least one of the properties
> match the given variable's value.

OData states:

> The expression specified with $filter is evaluated for each resource in the
> collection, and only items where the expression evaluates to true are
> included in the response. Resources for which the expression evaluates
> to false or to null, or which reference properties that are unavailable due
> to permissions, are omitted from the response.

Pretty compatible, if you ask me. So I have to wonder: why do we need
to specify this ourselves? Can't we just use OData Query Options as
is?

[1] http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part2-url-conventions/odata-v4.0-errata02-os-part2-url-conventions-complete.html#_Toc406398116

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

Received on Monday, 15 February 2016 18:47:09 UTC