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

case sensitivity of jsonb keys and values #50

Open
kcranston opened this issue Apr 27, 2020 · 2 comments
Open

case sensitivity of jsonb keys and values #50

kcranston opened this issue Apr 27, 2020 · 2 comments

Comments

@kcranston
Copy link
Member

From @bomeara on gitter:
"It now appears that looking up ot:focalCladeOTTTaxonName is now case sensitive. This gives studies:
curl -X POST https://api.opentreeoflife.org/v3/studies/find_studies -H "content-type:application/json" -d '{"property":"ot:focalCladeOTTTaxonName","value":"Mammalia","verbose":true}'
but this does not:
curl -X POST https://api.opentreeoflife.org/v3/studies/find_studies -H "content-type:application/json" -d '{"property":"ot:focalCladeOTTTaxonName","value":"mammalia","verbose":true}'
It came up b/c the R rotl package documentation has lower case examples that used to work but don't any longer -- it's easy enough to fix this in the documentation, but I just wanted to make sure this is intended behavior"

Originally opened in OpenTreeOfLife/otcetera#96 but really belongs here.

I think I understand why the case sensitivity, but I am confused about this being a change in behaviour (why did it ever work with lower case?)

@kcranston
Copy link
Member Author

kcranston commented Apr 27, 2020

This search is an example of searching the jsonb data blob (i.e. ot:focalCladeOTTTaxonName is not an explicit column in the study table, but a key that might exist in the jsonb column for a study). Based on a github search, there are no instances of lower case 'mammalia' as ot:focalCladeOTTTaxonName in phylesystem. There is no explicit conversion to lowercase in the script that loads the nexsons, and dicts / json are case sensitive, as is the jsonb column in postgres.

I remain confused.

@mtholder
Copy link
Member

Is it possible that:

  1. an older version of the code (otindex, or peyotl, or phylesystem) did lower-case strings,
  2. that older version of the code populated the running otindex db,
  3. we changed something that causes the strings to not be lower cased,
  4. the relevant studies were not been re-indexed with a newer version of the code that does not lower case things.
  5. something triggered reindexing or recreation of the db, so now that rotl test fails

? could be tricky (and possibly not worth dissecting) if there was a long lag between step 3 and step 5 in that sequence

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