Managing your automated testing
Constraint violation checks
We can define custom checks using SPARQL. SPARQL queries define bad modelling patterns (missing labels, misspelt URIs, and many more) in the ontology. If these queries return any results, then the build will fail. Custom checks are designed to be run as part of GitHub Actions Continuous Integration testing, but they can also run locally.
Steps to add a constraint violation check:
- Add the SPARQL query in
src/sparql
. The name of the file should end with-violation.sparql
. Please give a name that helps to understand which violation the query wants to check. - Add the name of the new file to odk configuration file
src/ontology/uberon-odk.yaml
:- Include the name of the file (without the
-violation.sparql
part) to the list inside the keycustom_sparql_checks
that is insiderobot_report
key. -
If the
3. Update the repository so your new SPARQL check will be included in the QC.robot_report
orcustom_sparql_checks
keys are not available, please add this code block to the end of the file.
- Include the name of the file (without the