Closed newgene closed 4 months ago
Just something I noticed while trying different classes on the validator, perhaps we need to adjust the error handling. A class that does not exist 500 err A class that exists from schema.org but has no validation 500 err A class that exists but has no validation and of course a class with validation returns correctly 1. https://discovery.biothings.io/api/schema/n3c:Thing/validation Traceback (most recent call last): File "/Users/marco/Desktop/code/discovery-app/env/lib/python3.9/site-packages/tornado/web.py", line 1711, in _execute result = method(*self.path_args, *self.path_kwargs) File "/Users/marco/Desktop/code/discovery-app/discovery/handlers/api/schema.py", line 563, in get self.finish(validation_dict) UnboundLocalError: local variable 'validation_dict' referenced before assignment 2. https://discovery.biothings.io/api/schema/schema:ExerciseGym/validation Traceback (most recent call last): File "/Users/marco/Desktop/code/discovery-app/env/lib/python3.9/site-packages/tornado/web.py", line 1711, in _execute result = method(self.path_args, **self.path_kwargs) File "/Users/marco/Desktop/code/discovery-app/discovery/handlers/api/schema.py", line 559, in get for data_dict in schema_metadata["@graph"]: KeyError: '@graph' 3. returns { } (expected, should be fine)
We currently have a Metadata Validator at https://discovery.biothings.io/validator. For the initial release, we picked a few supported schema classes:
We can expand the support for any class from the registered schemas now (if that class includes schema validation rules of course). Two new features are expected:
We should have a direct URL to link to the metadata validator for a given schema class. Something like this:
https://discovery.biothings.io/validator?schema_class=n3c:Dataset
Some basic error-handling will be necessary, e.g. invalidate class, class contains no validation etc.
A way to search with autocompletion for classes from the registered schema. Ideally filtered for those classes contain validation rules.