Closed dlebauer closed 4 years ago
PS I'd suggest keeping style consistent with the source database to facilitate interoperability
The .x
and .y
versions are definitely from a join, but since they were there already I didn't know how to rename the .y
versions. Do I just remove the .y
versions?
I can convert back to CamelCase
Sorry didn't realize that was my work! Yes drop the .y versions.
The original USDA names have a few potholes, not pure CamelCase - the goal is consistency rather than style. On Tue, Jul 12, 2016 at 6:42 PM Scott Chamberlain notifications@github.com wrote:
The .x and .y versions are definitely from a join, but since they were there already I didn't know how to rename the .y versions. Do I just remove the .y versions?
I can convert back to CamelCase
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sckott/usdaplantsapi/issues/7#issuecomment-232214402, or mute the thread https://github.com/notifications/unsubscribe/AAcX5-ofBaHPy4puo-DcMQGWzOxVc8YJks5qVCZogaJpZM4JK62n .
But keep the joined columns to the right of the columns with .y
versions, correct?
yep - keep joined columns to the right. They are sparse - only 3% of the rows have any information (from http://plants.usda.gov/charinfo.html) - "2000 conservation plant species and 500 additional cultivar".
If speed or optimization is an issue, you could reduce the size by either a) keeping the tables separate and joining on the fly or b) not returning values that are ""
.
I might make a separate table for the other columns.
also, returning ""
isn't ideal, meaning to change all those to null
but haven't sorted out fastest way to do that yet
I might play with not returning fields with no data, though that makes merging records a bit more complicated
@sckott regarding Syntax - I just checked and now see that they don't use camel case but white space. Seems reasonable that useability should trump consistency so go with the potholes.
I noticed in the latest version names have been converted from CamelCase to Camel_Pothole_Case, e.g. AcceptedSymbol to Accepted_Symbol
and
It looks like a join has appended _x and _y to some of these names (e.g. Accepted_Symbol_x and Accepted_Symbol_y)
One side effect of this is that your example
curl 'https://plantsdb.xyz/search?limit=2&fields=Genus,Species,AcceptedSymbol' | jq .
(in the README) is broken (should beAccepted_Symbol_x