- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Thu, 24 Apr 2014 16:50:52 +0200
- To: "'Thomas Hoppe'" <thomas.hoppe@n-fuse.de>, <public-hydra@w3.org>
On Wednesday, April 23, 2014 9:18 PM, Thomas Hoppe wrote: > > 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#advance d-queries > http://www.django-rest-framework.org/api-guide/filtering Yeah, but if you look, they allow much much more than simple equality filtering. They have operators etc. As said in a different mail to Gregg, we can certainly work on that in the future. I just want to get the basics right first. If this is something you need or something that interests you, you should start writing up some of the requirements and possible design solutions. It always needs someone to get this work started :-) > http://developer.zendesk.com/documentation/rest_api/search.html Hah... Zendesk also uses the same PagedCollection model we do (no first/last link but just count) :-P > 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". +1, obviously :-) > 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. ... and that's exactly something you can't do if you need to accept completely arbitrary queries from basically everyone. In the general case, you don't know the clients and don't control them. Why do you think there are now public SQL servers on the Web? Would be quite convenient, wouldn't it? > 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. OK, fair enough. I will think about it a bit more. You certainly have a point. -- Markus Lanthaler @markuslanthaler
Received on Thursday, 24 April 2014 14:51:18 UTC