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

Add tests for ensuring that the generated LinkML schema in YAML is valid #7

Open
gaurav opened this issue Sep 9, 2021 · 0 comments
Assignees

Comments

@gaurav
Copy link
Collaborator

gaurav commented Sep 9, 2021

The good news is that the LinkML model is itself written in LinkML, so it should be validatable. Unfortunately, most of those validation methods are designed around other formats (such as validating JSON, JSON-LD, RDF and so on) but I haven't found one for validating the YAML directly. Two possibilities:

  1. If we load the generated YAML Schema using the LinkML YAML loader, this should generate validation errors if something is wrong somewhere. We should probably write a unit test with a deliberately broken YAML file to make sure of that, though.
  2. We can convert the YAML Schema into JSON and then validate it using our JSON Schema. Note that @ShahimEssaid has implemented this in Visual Studio (https://github.com/cancerDHC/data-model-harmonization/blob/6f0fa9a659fe8f8e561cd76a4000a378d07e91cf/json-examples/json-examples.code-workspace), so there are ideas there we could reuse.

This might be something worth doing upstream in LinkML so that every LinkML model's generated JSON Schema can be automatically validated.

@sujaypatil96 sujaypatil96 self-assigned this Sep 22, 2021
@gaurav gaurav transferred this issue from cancerDHC/ccdhmodel Oct 1, 2021
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

2 participants