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

Different validation on linkml-validate and linkml-convert --validate #1638

Open
Silvanoc opened this issue Sep 17, 2023 · 0 comments
Open
Labels
bug Something that should work but isn't, with an example and a test case. community-generated developer-days smallish tickets that can be considered "maintenance" and fixed within a single session linkml-validate

Comments

@Silvanoc
Copy link
Contributor

Describe the bug
Validation behaves differently if run directly with linkml-validate or indirectly with linkml-convert --validate.

Additional context
Within the scope of PR #1630 I've been stumbling over some validation errors that where puzzling me. Until I've realized that the code preparing the validation has decisive differences between linkml-validate and linkml-convert --validate, though I would expect them to basically behave the same way.

In the case of linkml-validate the object is loaded by default as a dictionary with load_as_dict(), only if it fails load() will be used and then converted to a dict. That dict will then be validated with iter_validate_dict().

In the case of linkml-convert --validate the object is loaded by default as an object with load(). Then some inferrence is run, if selected (is it needed for the validation? or for something else later on?). Finally the object gets validated, since the option --validate has been passed, with validate_object().

According a Slack message from @pkalita-lbl, I started working with dictionaries instead of object for validation and it helped me getting the option linkml-validate --include-range-class-descendants working. Therefore I assume that I'm probably having the same issue trying to get linkml-convert --include-range-class-descendants working in PR #1630.

IMO the validation mentioned above in linkml-convert --validate should use the same pattern as linkml-validate does. It would result in the same validation results (what probably every user expects) and hopefully help me to get PR #1630 working.

@Silvanoc Silvanoc added the bug Something that should work but isn't, with an example and a test case. label Sep 17, 2023
@sierra-moxon sierra-moxon added the developer-days smallish tickets that can be considered "maintenance" and fixed within a single session label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that should work but isn't, with an example and a test case. community-generated developer-days smallish tickets that can be considered "maintenance" and fixed within a single session linkml-validate
Development

No branches or pull requests

3 participants