biothings / biothings_explorer_jsonld

Apache License 2.0
4 stars 4 forks source link

API `http://biothings.io/explorer/api/v2/directinput2output` cannot handle "do" disease prefix #8

Closed erikyao closed 6 years ago

erikyao commented 6 years ago

E.g. for request url:

http://biothings.io/explorer/api/v2/directinput2output?input_prefix=do&input_value=1498&output_prefix=hp

Response is:

{"message": "Endpoints could be located connecting do to hp. The endpoints are ['https://api.monarchinitiative.org/api/bioentity/disease/{diseaseid}/phenotypes']. However, no output could be found using the endpoint!", "status": 400 }

However, for underlying request endpoint using "ONID" instead of "do":

https://api.monarchinitiative.org/api/bioentity/disease/DOID:1498/phenotypes/

The response is not empty.

Thank you!

kevinxin90 commented 6 years ago

Hi, that’s because the standard way representing a disease ontology is DOID:1498, rather than the number itself. You might try http://biothings.io/explorer/api/v2/directinput2output?input_prefix=do&input_value=DOID:1498&output_prefix=hp to see if it works.

Btw, are you Yao Yao from Steve’s group? Looking forward to seeing u in the hackathon.

Best, Kevin

erikyao commented 6 years ago

Oh, I got it. Thank you very much!

Yes, I work for Steve. See you later!

erikyao commented 6 years ago

Hi Kevin,

In terms of OMIM, I have to use input_prefix=omim.disease and input_value=605543, not input_value=OMIM:605543. Could you please share me the standard you have? Thanks!

http://biothings.io/explorer/api/v2/directinput2output?input_prefix=omim.disease&input_value=605543&output_prefix=hp

http://biothings.io/explorer/api/v2/directinput2output?input_prefix=omim.disease&input_value=OMIM:605543&output_prefix=hp

erikyao commented 6 years ago

I see we need to follow the patterns on Identifiers.org. Thanks!

kevinxin90 commented 6 years ago

You might check out our ID_Mapping file located at: https://github.com/NCATS-Tangerine/translator-api-registry/blob/openapi_2.0/ID_MAPPING_NEW.csv. When determining what is the standard syntax representing an ID, we first refer to 'http://identifiers.org'. For biological ID, it has a field called 'Identifier pattern' to specify the standard syntax. You might check http://identifiers.org/doid/. It specifies the standard syntax should be ^DOID\:\d+$. Also, you might check http://identifiers.org/omim/. It specifies the standard syntax should be ^[*#+%^]?\d{6}$. But I do understand that it might cause some confusion for new users. So I will also add support for both the CURIE form (e.g. OMIM:605543) as well as the short form (e.g. 605543) in the BioThings Explorer, which will make life easier for the users.

Thanks!

Kevin

erikyao commented 6 years ago

The problem is that we use CURIE forms all over our application. I'll adapt our IDs when using BioThings Explorer. Thank you very much!

erikyao commented 6 years ago

BTW, do you happen to know if there is any python library that can convert CURIE form to short form? Thank!