Open kevinschaper opened 1 year ago
Hi @kevinschaper ! That is fantastic. Performing prefix checks is an excellent use case as a plugin.
I would say go ahead with the implementation :) Feel free to ping if you have any questions.
Regarding strictness: I would suggest having the plugin accept strictness at runtime. That way, the strictness flag can be used to either report an error or just warn. Of course, the validator wouldn't terminate right away. But you would get valid: false
for the object in your Validation Report. You can handle the report on the KGX side by raising a validation error.
Almost as a finer grain extension of the benefits of the range plugin, it would be great to have a prefix checking plugin.
I can take a shot at implementing it, the one question I had @deepakunni3 is whether there's a way to control the strictness of a plugin? I think officially in linkml prefixes are only advisory and invalid prefixes should only be warnings, but there are situations (like, when kgx output is first generated as part of an ingest) where I might want to fail on a prefix error.
One approach I could see taking is to make the plugin available as two different modules,
prefix_validation
andprefix_validation_strict
and just share the code between them.