OpenTreeOfLife / phylesystem-api

API access to Open Tree of Life treestore
BSD 2-Clause "Simplified" License
9 stars 5 forks source link

Some thoughts on the OTL API #47

Open sckott opened 10 years ago

sckott commented 10 years ago

@kcranston asked about our (ropensci) thoughts on the API. Our perspective is of course from working in R...here goes:

mtholder commented 10 years ago

Hi Scott, Thanks for the feedback. That is very helpful. It would be great (for me at least) if you could expand a bit on what you mean by "write methods" in the first bullet point. Were you thinking about methods for submitting entirely new studies, methods for annotating trees from published studies, or something else? I know that there are lots of potential pieces of information that someone might want to associate with a tree, but having a few examples of the types of data that you think folks would want to write would be very helpful.

sckott commented 10 years ago

@mtholder Sorry, by write methods, I meant POST/PUT, so being able to submit data, and not just get data. I was simply thinking of submitting data in general. Hard to know what would be most useful for the community. I imagine submitting annotations to trees would be of use, e.g., an R user may generate a new tree with node age estimates that could be submitted, or traits associated with nodes or tips that could be submitted.

leto commented 10 years ago

Submitting new studies and updating existing studies via the API are documented here:

https://github.com/OpenTreeOfLife/api.opentreeoflife.org/blob/master/docs/README.md

sckott commented 10 years ago

Great, thanks @leto

jimallman commented 10 years ago

Fuzzy search on node/tip names: Don't know if this is built in, but would be awesome to have.

We do currently support this in the TNRS, for example:

curl 'http://ec2-54-203-194-13.us-west-2.compute.amazonaws.com/taxomachine/ext/TNRS/graphdb/autocompleteBoxQuery' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' --data-binary '{"queryString":"arac","contextName":"Animals"}'

As suggested by the name autcompleteBoxQuery, this is tailored to user experience we wanted for taxon search in the main webapp. But we can definitely get there from here..

sckott commented 10 years ago

Nice, good to hear @jimallman

chinchliff commented 10 years ago

There is another query that is tailored for sets of names occurring in the same tree:

curl 'http://ec2-54-203-194-13.us-west-2.compute.amazonaws.com/taxomachine/ext/TNRS/graphdb/c http://ec2-54-203-194-13.us-west-2.compute.amazonaws.com/taxomachine/ext/TNRS/graphdb/autocompleteBoxQueryontextQueryForNames' -H 'Content-Type: application/json' -d '{"queryString":"arachnids, insects, crustaceans"}'

On Fri, Jan 31, 2014 at 2:37 PM, Scott Chamberlain <notifications@github.com

wrote:

Nice, good to hear @jimallman https://github.com/jimallman

Reply to this email directly or view it on GitHubhttps://github.com/OpenTreeOfLife/api.opentreeoflife.org/issues/47#issuecomment-33834855 .