Add SHACL shapes per entity type and CI validation workflow - #4
Merged
Conversation
Shapes in etl/shapes/<domain>.ttl (parallel to the vocab choices in ONTOLOGY-NOTES.md) formalize property/datatype/cardinality constraints for all 11 entity classes. etl/lib/shacl.sh flattens TriG to the union of its graphs (Jena shacl ignores named graphs) and gates on the --text report (shacl always exits 0). validate.sh auto-selects the shapes file by output dir, so shapes run on every make; the GitHub Actions workflow runs the same scripts on committed datasets on push/PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CLI behavior the SHACL wrapper depends on is unchanged (verified: riot --merge, exact "Conforms" text, exit 0 on violations). Jena 6 requires Java 21+ (jars are class-file 65) — CI already uses temurin 21; docs updated. Full validation suite re-run green on 6.1.0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
etl/shapes/<domain>.ttl— SHACL shapes for all 11 entity classes, parallel to the vocabulary choices inetl/ONTOLOGY-NOTES.md:skos:ConceptScheme/skos:Concept(taxonomies),cv:AdminUnit/dct:Location(admin-units),rov:RegisteredOrganization(legal-entities),foaf:Person/org:Membership/time:Interval/time:Instant/org:OrganizationalUnit/org:FormalOrganization(seimas). Shapes describe what the mappings guarantee on current data; URI patterns match path suffixes only, somake BASE=…outputs still validate.etl/lib/shacl.sh— wrapper that flattens TriG to the union of its named graphs (riot --merge; Jenashaclsilently ignores named graphs) and gates on the--textreport (Jenashaclalways exits 0, even on violations).etl/lib/validate.sh— auto-selectsetl/shapes/<domain>.ttlby output directory, so SHACL runs as part of the existing validate stage on everymake(including the gitignored bulk settlements/streets files)..github/workflows/shacl-validation.yml— validates all committeddatasets/current/**/*.trigon push/PR with the same scripts (cached Apache Jena 5.6.0, sha512-verified download, no fail-fast, per-file error annotations). Overlay files (alignments.trig,photos.trig) get SHACL only — their graphs intentionally lack thedct:title/foaf:primaryTopicinvariants.Test plan
riot --validateon all four shapes filesskos:notationremoved → violation report + exit 1validate.shchains SHACL and still prints thevalid:line🤖 Generated with Claude Code