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

Merge BETYdb table queries into a single generic function #26

Closed
2 tasks
dlebauer opened this issue Apr 24, 2015 · 5 comments
Closed
2 tasks

Merge BETYdb table queries into a single generic function #26

dlebauer opened this issue Apr 24, 2015 · 5 comments

Comments

@dlebauer
Copy link
Collaborator

dlebauer commented Apr 24, 2015

Create a single function to query tables in BETYdb.

waiting / depends on #77

Features to implement:

  • Replace betydb_<tablename> functions with one function that takes tablename as an argument
    • call should be something like betydb_query(table = 'citations', key = '', baseurl = 'https://www.betydb.org', apiversion = 'beta', ...)
    • default key, baseurl, apiversion as above
    • (@sckott is there a preferred naming?)
    • ... will accept one or more arguments of the form <field> = 'searchstring' where field is a valid API endpoint / field in the table
    • function parameter can be any valid endpoint for the table ( (docs) )

Tests

  • write tests. These do not need to be comprehensive, just make sure that the fields exist and have the correct type

The following queries should work:

betydb_query(table = 'citation', id = 1)`
betydb_query(table = 'species', genus = 'Salix')`
betydb_query(table = 'variables', name = 'Vcmax', baseurl = 'https://www.betydb.org')`
betydb_query(table = 'citation', author = 'Aasamaa')` # returns 2
betydb_query(table = 'citation', author = 'Aasamaa', year = 2010)` # returns 1

References

feedback

@sckott @gsrhode @robkooper @max-zilla.

  • does this sound like a sensible approach? vs. original implementation of separate functions for each table
  • any other suggestions?
  • I propose all table joins be done within R; this should make it easier for me to develop without having to fiddle with constructing urls. I don't think our current api supports joins (?)
@sckott
Copy link
Contributor

sckott commented Apr 24, 2015

@dlebauer okay, thanks

@sckott
Copy link
Contributor

sckott commented May 27, 2015

@dlebauer should I close this ? Looks like your #27 PR address this, right?

@sckott sckott modified the milestone: v0.1 May 27, 2015
@dlebauer
Copy link
Collaborator Author

@sckott no, I made this issue at the same time as #27 as a place-holder for re-implementing the broken functions that I removed in that pull request.

The test file in PR #29 has the following function that doesn't work, which is where I got stuck trying to put the URL together ... I'd appreciate help on that ... (here is the API documentation)

debugonce(betydb_http)
betydb_traits(genus = "Miscanthus", author = "Arundale", trait = "yield")

@sckott sckott modified the milestones: v0.2, v0.1 Jun 11, 2015
@sckott sckott modified the milestones: v0.2, v0.3 Oct 13, 2015
@sckott sckott modified the milestones: v0.3, v0.4 Jan 27, 2016
@dlebauer dlebauer changed the title Add BETYdb table queries Merge BETYdb table queries into a single generic function Aug 18, 2016
@infotroph infotroph mentioned this issue Feb 24, 2017
5 tasks
@sckott
Copy link
Contributor

sckott commented Mar 21, 2017

@dlebauer can this be closed, been a while, not sure about the details

@dlebauer
Copy link
Collaborator Author

dlebauer commented Mar 21, 2017 via email

@sckott sckott closed this as completed Mar 22, 2017
@sckott sckott removed this from the v0.5 milestone Jun 28, 2019
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

2 participants