linkml / linkml-runtime

Runtime support for linkml generated models
https://linkml.io/linkml/
Creative Commons Zero v1.0 Universal
24 stars 23 forks source link

add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_curie_maps. fixes #604 #231

Closed sierra-moxon closed 1 year ago

sierra-moxon commented 1 year ago

use case here is:

Incorporate prefixmaps context lookup functionality to linkml-runtime.utils.namespaces.add_prefixmap so that we can use bioregistry contexts as a fallback when none of obo_context, idot_contex, monarch_context, semweb_context, etc. contain the prefix.

somewhat related to https://github.com/linkml/linkml/issues/852 - this doesn't deprecate default_prefix_maps, it just adds to the available maps that folks can use (incl. bioregistry maps).

The next step here is to allow this changed method to read a prefix map directly without the requirement that it be in prefixcommons or prefixmaps.

Hard-coding the map names here is not the best approach; I see a TODO in prefixmaps repo that those at least should be introspected from a config file (👍 ).

codecov-commenter commented 1 year ago

Codecov Report

Merging #231 (0dba73b) into main (badf9b3) will increase coverage by 0.33%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #231      +/-   ##
==========================================
+ Coverage   63.28%   63.61%   +0.33%     
==========================================
  Files          52       53       +1     
  Lines        6076     6126      +50     
  Branches     1642     1652      +10     
==========================================
+ Hits         3845     3897      +52     
  Misses       1774     1774              
+ Partials      457      455       -2     
Impacted Files Coverage Δ
linkml_runtime/utils/namespaces.py 73.05% <100.00%> (+2.16%) :arrow_up:
linkml_runtime/linkml_model/meta.py 52.79% <0.00%> (ø)
linkml_runtime/loaders/rdf_loader.py 28.20% <0.00%> (ø)
linkml_runtime/__init__.py 100.00% <0.00%> (ø)
linkml_runtime/utils/schemaview.py 86.40% <0.00%> (+0.38%) :arrow_up:
linkml_runtime/utils/yamlutils.py 78.15% <0.00%> (+0.42%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

caufieldjh commented 1 year ago

Taking a look - is the plan to use a list of prioritized prefix contexts as fallbacks or just one context?

sierra-moxon commented 1 year ago

in biolink-model, I want to use merged alone from prefixmaps.