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

Allow user-provided SSSOM maps to be used for prefix prioritization #369

Open
caufieldjh opened this issue Jan 12, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@caufieldjh
Copy link
Collaborator

The prefix_prioritization_map defines prefixes to be used to replace others in a clique merge:

kgx/kgx/utils/kgx_utils.py

Lines 412 to 432 in 6645182

def get_prefix_prioritization_map() -> Dict[str, List]:
"""
Get prefix prioritization map as defined in Biolink Model.
Returns
-------
Dict[str, List]
"""
toolkit = get_toolkit()
prefix_prioritization_map = {}
# TODO: Lookup via Biolink CURIE should be supported in bmt
descendants = toolkit.get_descendants("named thing")
descendants.append("named thing")
for d in descendants:
element = toolkit.get_element(d)
if element and "id_prefixes" in element:
prefixes = element.id_prefixes
key = format_biolink_category(element.name)
prefix_prioritization_map[key] = prefixes
return prefix_prioritization_map

But what if we have an exact preference for a prefix, e.g., we want all Drug nodes to have DrugCentral prefixes?
(and/or we have prefixes not known to biolink-model?)
It would be convenient to provide this function with a SSSOM map to use in addition to the biolink-model prefix priorities.

@caufieldjh caufieldjh added the enhancement New feature or request label Jan 12, 2022
@cmungall
Copy link
Contributor

cmungall commented Jan 12, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants