Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add down-taxonomy searching #1

Open
scottsfarley93 opened this issue Aug 3, 2016 · 8 comments
Open

Add down-taxonomy searching #1

scottsfarley93 opened this issue Aug 3, 2016 · 8 comments

Comments

@scottsfarley93
Copy link

I think it would be really helpful if we could aggregate API responses to higher level taxa. For example, if I search for picea records, I would get everything identified to the genus picea, but also everything everything that was identified to a more specific level (picea abies, Picea abies subsp. abies, Picea cf. P. glauca, etc).

I see this being helpful for both visualization and modeling. Obviously, it could result in some very large responses, like if someone searched for all of Plantae, and I'm not sure how we would deal with that. Ideally it could just be a flag in the query string on all the endpoints that include a taxonname/taxonid field to turn on or off the aggregation.

@SimonGoring
Copy link
Contributor

This is implemented for the occurrences method:

http://apidev.neotomadb.org/v1/data/occurrences?taxonname=Microtus

-vs-

http://apidev.neotomadb.org/v1/data/occurrences?taxonname=Microtus&nametype=base

This is not implemented in the datasets methods, but we've added it to the feature list.

Note that this does not assign cf or type taxa if this is appended at the level equivalent to the call itself, only at levels below.

@SimonGoring
Copy link
Contributor

Also not there's no Microtus all on its own in the DB.

@scottsfarley93
Copy link
Author

Yeah this looks exactly like what I was thinking of!

@scottsfarley93
Copy link
Author

Searching for too large of a group makes it die in an application error. Can we add a rule along the lines of "if you're search for a taxon with more than X children then success of API call = false"?

@SimonGoring
Copy link
Contributor

Thanks @scottsfarley93 , more generally we're discussing issues of how we return very large responses (as noted elsewhere). It might be worth having a two-part system:

  1. A summary query - how many sites/occurrences exist, how many taxa are pulled
  2. The full query

This doesn't really answer what happens if people want to make a very big call though.

@SimonGoring
Copy link
Contributor

Tagging @spatialit so he's in the loop as well.

@spatialit
Copy link

Are there resources other than the datasets resource this should be added to?

@SimonGoring
Copy link
Contributor

Right now datasets and occurrences are the only resources that provide searching by taxon, as far as I know. If you're talking about the summary API service, then we should start a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants