Skip to content

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

@gaurav

Description

@gaurav

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions