Re: ISSUE-45: Introduce hydra:filter (subPropertyOf hydra:search)

> The other problem with this approach ist hat {property} would have to be
> expanded to a full URL as otherwise. So you would end up with very long and
> ugly URLs.
This idea was definitely not a final solution I just wanted to exemplify 
what I mean.
A better solution would maybe involve the definitions in the context to
type coerce like in JSON-LD...
>> Which would allow to describe the diversity of current filtering
>> notations found in APIs.
> I don't know of many APIs that allow completely arbitrary filtering. Most of
> them are quite restricted... which makes sense because filtering might be a
> quite costly operation especially if there are lots of properties.
If you look around, there are many existing REST API and frameworks that 
let you
define filters in a generic manner:

http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries
http://www.django-rest-framework.org/api-guide/filtering
http://developer.zendesk.com/documentation/rest_api/search.html

I also think that we should not limit us because of concerns like server 
load.
We should anticipate the best API we can think of and, as you always 
say, "keep the simple case simple".
In current DB technologies it is pretty much the same whether you
filter for a string, integer, boolean or whatever column as long as you 
care about proper indexing.
Speaking from a consumer perspective:
In 2014 users expect from an API that it is sortable by any property.
Moreover, if a server has issues to filter for a certain property
or combinations thereof, it can report this back in a restful manner.

> If you
> really want to allow completely arbitrary filtering, it might actually make
> more sense to just send a SPARQL query or something similar. I'm not sure.
> Thoughts?
>
Arbitrary querying is definitely something for dedicated languages like 
SPARQL, SQL, OData etc.
But my concern here is not arbitrary querying - just filtering for any 
property in a collection.
And I think explicitly announcing that every single property might be 
filterable is very verbose.

Received on Wednesday, 23 April 2014 19:18:17 UTC