
Hi Priyank, we have logged the IN issue, but meanwhile you can use a nested OR query for taxon_key to do the same. Here is a modified query that searches for 3 taxon keys: { "creator": "markus", "predicate": { "type": "and", "predicates": [ { "key": "HAS_COORDINATE", "type": "equals", "value": "true" }, { "key": "HAS_GEOSPATIAL_ISSUE", "type": "equals", "value": "false" }, { "key": "YEAR", "type": "greaterThanOrEquals", "value": 1995 }, { "key": "COUNTRY", "type": "equals", "value": "IN" }, { "type": "or", "predicates": [ { "key": "TAXON_KEY", "type": "equals", "value": 797 }, { "key": "TAXON_KEY", "type": "equals", "value": 798 }, { "key": "TAXON_KEY", "type": "equals", "value": 799 } ] } ] } } See my download here which I created using curl: http://www.gbif.org/occurrence/download/0000326-150523225239109 <http://www.gbif.org/occurrence/download/0000326-150523225239109> best, Markus
On 26 May 2015, at 09:54, Priyank Tiwari <priyankgt@gmail.com> wrote:
Thanks Tim.
So to emulate the 'in' behaviour, can I use 'TAXON_KEY' = 'XXX' OR 'TAXON_KEY' = 'YYY' kind of predicate? Any other efficient solution to emulate 'in' behaviour?
On Tue, May 26, 2015 at 1:21 PM, Tim Robertson <trobertson@gbif.org <mailto:trobertson@gbif.org>> wrote: Hi Priyank
The TAXON_KEY currently only supports the equals predicate. We will look to support an array of values in the future.
Please let me know if that solves your problem.
Thanks, Tim
From: Priyank Tiwari <priyankgt@gmail.com <mailto:priyankgt@gmail.com>> Subject: [API-users] Getting server error 500 while trying to post a download request Date: 26 May 2015 08:16:09 GMT+2 To: api-users@lists.gbif.org <mailto:api-users@lists.gbif.org>
Hi,
I am trying to post a download request which is as follows,
curl -i -u username:password -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"creator":"username","notification_address": ["username@domain.com <mailto:username@domain.com>"],"predicate":{"type":"and","predicates":[{"type":"equals","key":"HAS_COORDINATE","value":"true"},{"type":"equals","key":"HAS_GEOSPATIAL_ISSUE","value":"false"},{"type":"greaterThanOrEquals","key":"YEAR","value":1995},{"type":"greaterThanOrEquals","key":"MONTH","value":1},{"type":"equals","key":"COUNTRY","value":"IN"},{"type":"in","key":"TAXON_KEY","values":[797]}]}}' http://api.gbif.org/v1/occurrence/download/request <http://api.gbif.org/v1/occurrence/download/request>
But the server is throwing a 500 error. The relevant part among the entire printed error trace I think is
Caused by: java.lang.IllegalArgumentException: Search parameter TAXON_KEY is not mapped to Hive
at org.gbif.occurrence.download.service.HiveQueryVisitor.toHiveField(HiveQueryVisitor.java:147)
at org.gbif.occurrence.download.service.HiveQueryVisitor.visit(HiveQueryVisitor.java:209)
... 58 more
It says that search parameter TAXON_KEY is not mapped, but I see TAXON_KEY being used in the examples at http://www.gbif.org/developer/occurrence#predicates <http://www.gbif.org/developer/occurrence#predicates>.
Is it a documentation issue or 'in' predicate does not support 'TAXON_KEY'?
Thanks, Priyank _______________________________________________ API-users mailing list API-users@lists.gbif.org <mailto:API-users@lists.gbif.org> http://lists.gbif.org/mailman/listinfo/api-users <http://lists.gbif.org/mailman/listinfo/api-users>
_______________________________________________ API-users mailing list API-users@lists.gbif.org <mailto:API-users@lists.gbif.org> http://lists.gbif.org/mailman/listinfo/api-users <http://lists.gbif.org/mailman/listinfo/api-users>
-- ~ Priyank _______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users