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

Term labels are formatted like byte strings rather than strings, i.e. b'label' #42

Open
dhimmel opened this issue Oct 23, 2020 · 3 comments

Comments

@dhimmel
Copy link

dhimmel commented Oct 23, 2020

Copying part of the JSON result from https://www.ebi.ac.uk/spot/oxo/api/search?ids=EFO:0009623 below:

{
  "_embedded" : {
    "searchResults" : [ {
      "queryId" : "EFO:0009623",
      "querySource" : null,
      "curie" : "EFO:0009623",
      "label" : "nose injury",
      "mappingResponseList" : [ {
        "curie" : "NCIT:C35349",
        "label" : "b'Nose Injury'",
        "sourcePrefixes" : [ "EFO" ],
        "targetPrefix" : "NCIT",
        "distance" : 1
      } ],

Notice the string value for label is b'Nose Injury' rather than the expected Nose Injury.

I haven't looked at the code, but my guess is that labels are actually byte string objects rather than unicode string objects. And when the label object is converted to a string as part of the JSON export, the b'label' notation is applied.

Can the byte strings be decoded to unicode strings prior to the JSON export (or any other option that fixes this)?

@matentzn
Copy link

I could swear I fixed this issue (btw, its due to python 3 vs 2 incompatibility and changes in the way string byte arrays are handled), maybe for the browser, and not for the API; cant find my commit :P ? Its important though so I agree this should be chased up.. Thanks for the report!

@rpandey19
Copy link

rpandey19 commented Jun 10, 2021

Any update on this. I am seeing the same issue. It shows up on the local installation I have of OXO

@matentzn
Copy link

I dont think so! Sorry.

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