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

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

Merged
merged 12 commits into from
Dec 23, 2022

Conversation

sierra-moxon
Copy link
Member

@sierra-moxon sierra-moxon commented Nov 30, 2022

use case here is:

  • project needs a new prefix to be added to Biolink
  • create prefix in bioregistry
    • not available in prefixcommons without secondary curation in prefixcommons
    • prefix isn't accessible via default_curie_maps in LinkML
    • dual annotation required in Biolink

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 linkml/linkml#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
Copy link

codecov-commenter commented Nov 30, 2022

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%) ⬆️
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%) ⬆️
linkml_runtime/utils/yamlutils.py 78.15% <0.00%> (+0.42%) ⬆️

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

@sierra-moxon sierra-moxon marked this pull request as ready for review December 20, 2022 17:32
@sierra-moxon sierra-moxon changed the title add prefixmaps with modified version add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_prefix_maps. Dec 20, 2022
@caufieldjh
Copy link
Contributor

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

@sierra-moxon
Copy link
Member Author

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

@sierra-moxon sierra-moxon changed the title add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_prefix_maps. add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_prefix_maps. fixes #604 Dec 22, 2022
@sierra-moxon sierra-moxon changed the title add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_prefix_maps. fixes #604 add the ability to declare "prefixmaps" contexts (including bioregistry contexts) in default_curie_maps. fixes #604 Dec 22, 2022
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

Successfully merging this pull request may close these issues.

4 participants