TranslatorSRI / NodeNormalization

Service that produces Translator compliant nodes given a curie
MIT License
9 stars 6 forks source link

Support ID prefixes on Biolink mixin classes? #136

Open sierra-moxon opened 1 year ago

sierra-moxon commented 1 year ago

Thanks so much for supporting this really wonderful resource!

In support of ncats.drug (Inxight), I was thinking of adding that prefix to the mixin 'chemical or protein or polypeptide' in biolink-model and I was curious if NN supported prefixes on mixins?

If not, no problem, I can add the prefix to a few different classes. :)

gaurav commented 1 year ago

As far as I can tell, Babel ultimately uses Biolink Model Toolkit's get_element() method to retrieve a Biolink class's id_prefixes field. I think that means that only the id_prefixes for the specific class will be used, and not its parent elements.

https://github.com/TranslatorSRI/Babel/blob/b0d638e4d8532b5103bfbaa746665f90cb90fadf/src/node.py#L85-L109

Do you know of any current Biolink classes where the difference would be evident? If so, I'd be happy to check it out and confirm whether it works or not at present! I think we can also extend our get_prefixes() method to include prefixes from an element as well as all of its parents if that would be useful.

cbizon commented 1 year ago

Yes, all of the prefixes are coming from biolink model. If a prefix isn't assigned to a class in biolink, NN/Babel won't let you emit an equivalent id with that prefix for an entity of that class. And correct, that it's only the most specific class of interest that's being considered, and that's done via BMT