Issue 18712

Better error message for /occurrence/count route

18712
Reporter: scott
Type: Improvement
Summary: Better error message for /occurrence/count route
Priority: Unassessed
Status: Open
Created: 2016-09-01 01:06:15.649
Updated: 2016-09-01 22:23:38.068
        
Description: http://api.gbif.org/v1/occurrence/count?basisOfRecord=OBSERVATION&year=2012

gives error

The provided address is not calculated in the cube: (basisOfRecord: (nobucket: 03), year: (nobucket: 000007dc))

And http://api.gbif.org/v1/occurrence/count?basisOfRecord=OBSERVATION&typeStatus=ALLOTYPE

gives error

The provided address is not calculated in the cube: (basisOfRecord: (nobucket: 03), typeStatus: (nobucket: 05))

These probably make sense to GBIF devs, but especially to scientists using these, they are baffled by this error message. Would it be possible to have a more meaningful error message for parameter combinations that are not allowed on the /occurrence/count  route?

thanks! Scott Chamberlain]]>
    


Author: trobertson@gbif.org
Created: 2016-09-01 21:50:31.882
Updated: 2016-09-01 21:50:31.882
        
Sorry about this.

We are considering deprecating the /occurrence/count completely and removing it completely.

The reason for this is that the count service existed to provide fast counts at a time when the occurrence search could not provide them.  As such, we've ended up with a separate metrics service which offers a subset of the occurrence search.  Operationally this means added overhead, plus the fact that occasionally counts drift, and we need to rebuild from scratch.  And of course confusion as the API for counts is not the same as search.

All occurrence searches provide a "count" in the response, so you can use e.g. http://api.gbif.org/v1/occurrence/search?typeStatus=ALLOTYPE&limit=0 instead.

Would that satisfy your needs please?

    


Author: scott
Comment: Thanks for the answer!  Sounds good to me. I can appreciate wanting lower overhead. And for the R and Python libraries I maintain I can keep the count methods and simply change the internals to use the search route with limit=0
Created: 2016-09-01 22:23:38.068
Updated: 2016-09-01 22:23:38.068