Fix header-check logic flow and use -eq 0 for row count in run_sparql_metatest.sh#563
Conversation
-eq 0 for row count in run_sparql_metatest.sh
There was a problem hiding this comment.
Pull request overview
This PR improves the control flow and clarity of the ontology header “meta-test” in run_sparql_metatest.sh, ensuring the real metpo.owl validation only runs when the fixture proof-of-failure succeeds, and tightening the row-count comparison to reflect expected non-negative counts.
Changes:
- Nest the real
metpo.owlheader query under the successful fixture-violation check, and explicitly skip the real-OWL check when the fixture returns 0 rows. - Replace the
-le 0comparison with-eq 0for the real-OWL row count check.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The header-real query writes an empty TSV when metpo.owl has no header
problems, so 'wc -l - 1' yields -1, not 0. With the new '-eq 0' check that
sent a clean ontology down the error branch ('has -1 metadata problem(s)')
and failed CI. Clamp the count to 0 before the comparison; this keeps the
clearer -eq 0 form and fixes the regression.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Pushed a fix for the failing |
The ontology-header-check section had two issues: the real
metpo.owlcheck ran independently of whether the fixture proof-of-failure passed (confusing logic, misleadingfailflag state), and used-le 0instead of-eq 0for a count that can never be negative.Changes
metpo.owlquery now only runs when the fixture matched ≥1 rows. If the fixture check fails, the real-OWL check is skipped with an explicit message, andfail=1is set once at the end of theelsebranch.-le 0→-eq 0— row counts are never negative; this matches the-ge 1pattern used elsewhere in the script.Original prompt