INCATools / ontology-access-kit

Ontology Access Kit: A python library and command line application for working with ontologies
https://incatools.github.io/ontology-access-kit/
Apache License 2.0
109 stars 23 forks source link

`.entities()` typedef update #690

Open joeflack4 opened 6 months ago

joeflack4 commented 6 months ago

Overview

Currently, the return type definitions for .entities() methods are inaccurate. it says Iterable[CURIE], but it is also possible for it to return "quoted URIs" (example: <http://identifiers.org/hgnc/10004>).

Possible solutions

a. Fix so that URIs, not quoted URIs are returned, and update type def Union[CURIE, URI] b. Add new type for quoted URIs and update type def Union[CURIE, QUOTED_URI[ c. IDENTIFIER

Additional details

Context / discussion

_[Chris](https://github.com/INCATools/ontology-access-kit/pull/688#issuecomment-1863151973)_: > The intent is that CURIEs are input and output. Yes, I know that when using semsql URIs that have no prefixes get turned into quoted URIs (different from URIs), but this should be fixed elsewhere. _[Joe](https://github.com/INCATools/ontology-access-kit/pull/688#issuecomment-1863524743):_ > I guess you're right, they are "quoted URIs". Here's an example of one I see: > > `''` > > Why don't we add something like QUOTED_URI to `oaklib.types`?: > ```py > CURIE = str > QUOTED_URI = str > URI = str > ``` > > When you say "should be fixed elsewhere", I assume you are referring to them being "quoted" URI strings rather than plain URI strings. I'm definitely down with that. If you mean that URIs should never be returned (you probably don't), I don't think that's possible 100% of the time.

Related

joeflack4 commented 6 months ago

I'm partial to doing (b) now via #688, and then doing (a) later, unless (a) can be done in the near term.

joeflack4 commented 6 months ago

I think we are favoring solution 'c'.