Skip to content
mjcollin edited this page Nov 24, 2014 · 13 revisions

Notes on design:

Function names:

Query Objects:

Let's do objects but let's make people generate valid idigbio query JSON for now. That way everyone's code will be making query objects and if we want to help making query object easier later, we're not going to have to re-spec the idigSearch method to take a query object instead of a list/JSON. EG:

query <= idigQuery(text='{"family": ["asteraceae","fagaceae"]}') results <= idigSearch(query)

It's more clunky than I'd like but it keeps things tied directly to the API, is simple for us to impliment (just call jsonlite::toJSON) and if we want to add convenince methods for building queries, no existing code will need to change.

I wrote the below before changing my mind: I think I want to do a query object. Nested lists are just going to be trouble. The object can have a "fromJson" method that just takes JSON text for those who are chaining APIs or who want to just write JSON. Otherwise, probably a 1:1 matching of https://github.com/iDigBio/idigbio-search-api/blob/master/app/lib/query-shim.js is best. And update the iDigBio Query format documentation to include the query shim methods so that there is 1:1:1 correspondence between a query format snipped, a query shim method, and an R query object method.

Tests:

Yes. Look @ Francois's stuff for JSON definitions between Python and R

Clone this wiki locally