linkml / prefixmaps

Semantic prefix map registry
https://linkml.io/prefixmaps/
Apache License 2.0
11 stars 3 forks source link

Release 2.0 can no longer expand OMIM IDs #62

Closed kevinschaper closed 8 months ago

kevinschaper commented 9 months ago

Notebook demonstrating the problem: https://colab.research.google.com/drive/1O0hAD5frD6lY0yVrvFVR2zYrM1elFLic#scrollTo=__ctJM_dA7Ts

from curies import Converter
from prefixmaps.io.parser import load_multi_context

context = load_multi_context(["merged"])
extended_prefix_map = context.as_extended_prefix_map()
converter = Converter.from_extended_prefix_map(extended_prefix_map)
print(converter.expand("OMIM:123"))

prints None

I don't think this is the only prefix that's failing for us in the latest release, but it's one that jumped out.

amc-corey-cox commented 9 months ago

Okay, the OMIM issue is here:

from prefixmaps.io.parser import load_multi_context
context = load_multi_context(["merged"])
extended_prefix_map = context.as_extended_prefix_map()
converter = Converter.from_extended_prefix_map(extended_prefix_map)
print(converter.expand("OMIM:123")) # = 'None'

But when I use the load_converter instead as suggested in the readme OMIM is there in the converter.

from prefixmaps import load_converter
new_converter = load_converter("merged")
print(new_converter.expand("OMIM:123")) # = 'http://identifiers.org/mim/123'

1) I think that is our expected behavior. Kevin can we switch to using load_converter or is there some reason we're using load_multi_context to get the context first? 2) Do we need to fix load_multi_context or is it acting as intended?

amc-corey-cox commented 8 months ago

PR https://github.com/linkml/prefixmaps/pull/63 fixes this issue.