biolink / biolink-model-toolkit

A collection of useful python functions for looking up information and working with the Biolink Model
https://biolink.github.io/biolink-model-toolkit/
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

How can category be inferred for a bare URI or CURIE? Could a search of id_prefixes in their category class context allow this inference? #75

Closed RichardBruskiewich closed 2 years ago

RichardBruskiewich commented 2 years ago

Some knowledge representations (e.g. simple RDF statements) do not tag their concepts (URI resources) with category. It may be a helpful heuristic to be able to resolve possible category values for URI's (CURIE's) based on their namespace listing under the id_prefixes slot of Biolink categoryclasses. Of course, if the mappings of id_prefixes is one-namespace-to-many, this heuristic may occasionally fail. Nonetheless, if a given namespace is associated with more than one category, one could at least return the list of all such category classes then leave it to the caller to decide how to capture use them in the tagged concept they are processing.

Whether or not only the most specific category class(es) are returned or the parent classes as well, is left as a separate decision (besides, BMT has a distinct 'ancester' tracing solution for that latter use case...)

sierra-moxon commented 2 years ago

there is the get_element_by_prefix method - hopefully this was what you were looking for :)