biothings / biothings_explorer_jsonld

Apache License 2.0
4 stars 4 forks source link

Keyword searches? #15

Open lhannest opened 5 years ago

lhannest commented 5 years ago

It looks like there are a number of bioentities designated for names: http://biothings.io/explorer/api/v2/metadata/bioentities

But if I try this: http://biothings.io/explorer/api/v2/crawler?input_type=disease-name&input_value=diabetes I get an exception:

Traceback (most recent call last):
  File "/home/ubuntu/opt/devpy3/lib/python3.5/site-packages/tornado/web.py", line 1509, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/ubuntu/opt/biothings_explorer_web/src/handlers/entitycrawler.py", line 308, in get
    results = exploreinput(input_type, input_value)
  File "/home/ubuntu/opt/biothings_explorer_web/src/handlers/entitycrawler.py", line 160, in exploreinput
    synonyms = IDConverter().find_synonym(input_value, input_type)
  File "/home/ubuntu/opt/biothings_explorer_web/src/biothings_explorer/id_converter.py", line 89, in find_synonym
    return self.find_disease_synonym(input_value, input_type)
  File "/home/ubuntu/opt/biothings_explorer_web/src/biothings_explorer/id_converter.py", line 176, in find_disease_synonym
    params = self.mydisease_params_template.replace('{input_value}', str(input_value)).replace('{input_type}', MYDISEASE_URI2SCOPE[input_type])
KeyError: 'disease-name'

I haven't tried all the name and description bioentity types, but of all the ones I tried this error has been thrown.

The knowledge map has this entry:

{
   "subject":{
      "semantic_type":"disease",
      "prefix":"disease-name"
   },
   "endpoint":"https://pharos.nih.gov/idg/api/v1/diseases/search",
   "object":{
      "semantic_type":"disease",
      "prefix":"pharos.disease"
   },
   "predicate":"EquivalentAssociation"
}

When going to that endpoint I do get data back: https://pharos.nih.gov/idg/api/v1/diseases/search?q=diabetes