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

Access to ambiguous terms #68

Open
jakebeal opened this issue Jul 11, 2022 · 0 comments
Open

Access to ambiguous terms #68

jakebeal opened this issue Jul 11, 2022 · 0 comments

Comments

@jakebeal
Copy link
Contributor

Right now, if a term has an ambiguous name, tyto has no way to allow access to that term. Case sensitivity allows handling of some of the problem cases, but not all.

For example, NCIT has two concepts with the name "Cell", meaning one gets:

> tyto.NCIT.Cell
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3444, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-8-9040bf094937>", line 1, in <module>
    tyto.NCIT.Cell
  File "/usr/local/lib/python3.9/site-packages/tyto/tyto.py", line 47, in __getattr__
    return self.__getattribute__('get_uri_by_term')(name)
  File "/usr/local/lib/python3.9/site-packages/tyto/tyto.py", line 123, in get_uri_by_term
    uri = self._handler('get_uri_by_term', exception, sanitized_term)
  File "/usr/local/lib/python3.9/site-packages/tyto/tyto.py", line 72, in _handler
    response = method(self, *args)
  File "/usr/local/lib/python3.9/site-packages/tyto/endpoint/endpoint.py", line 103, in get_uri_by_term
    raise Exception(f'Ambiguous term {term}--found multiple URIs {response}')
Exception: Ambiguous term Cell--found multiple URIs ['http://purl.obolibrary.org/obo/NCIT_C48694', 'http://purl.obolibrary.org/obo/NCIT_C12508']

One way to deal with this might be to have tyto allow querying of synonyms.

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

1 participant