from linkml_validator.validator import Validator
data_obj = {
"id": "obj1",
"name": "Object 1",
"type": "X"
}
validator = Validator(schema="examples/example_schema.yaml")
validator.validate(obj=data_obj, target_class="NamedThing")
We'll likely want to make the schema an argument to set_koza_app and have the validator be defined in the KozaApp init, where a validator can be instantiated.
Then the write method should run validation if a validator exists.
We should add linkml-validator support directly into Koza.
Command line usage should be something like an optional extra argument specifying a schema that will trigger validation
or directly as a module with:
Here is the linkml-validator module example
We'll likely want to make the schema an argument to set_koza_app and have the validator be defined in the KozaApp init, where a validator can be instantiated.
Then the write method should run validation if a validator exists.