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

Test if a given CURIE prefix (namespace) is known to Biolink Model (any of the prefixes, not just the category id_prefixes) #84

Closed
RichardBruskiewich opened this issue Aug 11, 2022 · 1 comment

Comments

@RichardBruskiewich
Copy link
Contributor

BMT doesn't really (yet) have a method to simply validate whether or not a given xmlns prefix is known to the model (ie. is in the list of resolved prefixes)

Would we get that directly from a LinkML call?

We're not really thinking solely of category id_prefixes enumerated prefixes.

Rather, Eric Deutsch is suggesting that the CURIE's in the attribute_type_id field be validated as belonging to a Biolink-known prefix namespace (preferably a value mapped onto an association slot, if the CURIE given isn't strictly speaking a Biolink term)

His specific commentary is regarding validation of the attribute_type_id (preferably inheriting from biolink:association_slot):

The constraint is not really absolute, mostly because many of the concepts we want to convey are not in biolink. So I think we should enforce a curie, so if there's not colon, then that should be an error. If the prefix is not biolink, that should be a warning. If the prefix is not known to biolink that should be a double warning. Are we able to report warnings? or just errors?

  • ERROR if not a CURIE
  • WARNING if not an instance of biolink:association_slot (but is another Biolink class?)
  • (double) WARNING if prefix is not known to Biolink

I guess that the prefixes are loaded via the SchemaDefinition?

Or rather, viewable in the SchemaView which is available in the BMT Toolkit.view instance attribute.

Oddly enough, it is not obvious how one directly checks if a prefix exists in the Namespaces although one can perhaps simulate the checking using a try block wrapped Namespaces.sri_or_curie_for() call?

@RichardBruskiewich
Copy link
Contributor Author

An empty return value from get_element_by_prefix() would not suffice here, since it covers id_prefixes known in all classes and slots

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

No branches or pull requests

1 participant