You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
validate.py accepts ontology documents with undeclared concepts, relationships and prefixes #488
validate.py is what the repo documents for checking an ontology document (--schema ontology/ontology.json) and what the validation CI runs. For core documents it checks unique names, references, column arity and SQL on top of the schema. For ontology documents it stops at the schema, since each of those checks is guarded by the presence of datasets.
A small ontology document with any one of the following passes on main (adfa9e4):
the same concept name declared twice
extends naming a concept that is not declared
identify_by naming a relationship the concept does not have
a role played by a concept that is not declared
a QName iri whose prefix is not in prefixes, which ontology.md says is invalid
The reference parser in converters/ontology rejects four of them. The duplicate concept goes through there as well, the later declaration silently replacing the earlier one. So the rules exist, but only for people who run the converter, and CI runs validate.py. The validation CI also only validates the TPC-DS core example, so examples/flights.yaml is not exercised either.
Proposal
Add the checks to validate.py, scoped to the ontology section: unique concept and relationship names, extends, identify_by and role references (built-in concepts included), a cycle check on extends, and QName prefixes against prefixes, with tests under validation/tests and a CI step validating flights.yaml against the ontology schema. ontology_mappings can wait for #458 to settle where they live.
Activity