Repository navigation
Pass snippet SHACL closures to transform output profile validation - #94
Merged
Merged
Conversation
validate_transform_output only used the profile bblock's inherited closures, so a snippet's shacl-closure applied to the example itself but not to its transformed output. Pass the snippet's own closures through, resolved against the source bblock (relative paths would otherwise resolve against the profile bblock). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rob-metalinkage
added a commit
to rob-metalinkage/ogcapi-sosa
that referenced
this pull request
Oct 21, 2026
closures/<base>.ttl (or <stem>.ttl for all roots of a multi-root example) under _sources/spec-examples/ is added as that example's snippet shacl-closure. It applies to the Turtle validation and, with opengeospatial/bblocks-postprocess#94, to the transform output profile validation. The transform does not merge it into its output. Closures are for facts about related resources only, not the example's own missing mandatory fields. Co-Authored-By: Claude Opus 5.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.
Problem
A snippet's
shacl-closureis used when the example itself is validated, but not when a transform's output is validated againstoutputs.profiles.validate_transform_outputonly received the profile bblock's inherited closures. Background facts that an example relies on (e.g. descriptions of related resources held elsewhere) were therefore lost for its transformed output, and the same data could pass as the example and fail as the transform output.Change
validate_transform_outputtakes an optionaladditional_shacl_closuresargument and passes it to the validators, as_validate_resourcealready does.transform.pypasses the snippet's ownshacl-closureentries. Relative paths are resolved against the source bblock: the RDF validator resolves relative closures against its own bblock, which here is the profile bblock. The profile's inherited closures still come from the profile bblock, as before.test_validate_transform_output_passes_snippet_closures_to_validators.The transform context's
snippet['shacl-closure']is unchanged (snippet closures plus inherited ones).Testing
pytest tests: 169 passed, run in thebblocks-postprocess:latestimage with this branch'sogc/mounted.ogc.sosa.properties.observation, with a per-example closure. Both reports list "Using snippet SHACL closures" and pass, and no other report changed.🤖 Generated with Claude Code