feat(gen-shacl): add presence-implies-value rule pattern#17
Conversation
Generalise the boolean-guard SHACL-SPARQL pattern to enum-valued targets. A rule whose precondition is `value_presence: PRESENT` on a value slot and whose postcondition is `equals_string` / `equals_string_in` on a target slot now emits an `sh:sparql` constraint requiring the target slot to be present and hold one of the allowed values. Each allowed value resolves to its enum `meaning` IRI, with a string-literal fallback. Motivating case (aiSim environment): - "if texture_sky_color is set, sky_model must be TextureSky" - "if overcast_sky_illuminance is set, sky_model must be OvercastSky or MeasuredOvercastSky" The existing boolean-guard (`equals_string: "true"`) and exclusive-value patterns are unchanged; boolean guard keeps priority over the new branch. Adds focused unit tests (enum IRI vs. literal fallback, single value vs. set membership, message emission, SPARQL syntax) plus pyshacl end-to-end validation for the new pattern.
5d896de to
bab76d1
Compare
|
Superseded by #19, which delivers the same presence-implies-value commit (content-identical cherry-pick of While auditing this branch, the self-contained bundle turned out to have four assembly issues (masked because Suggest closing this one in favour of #19 — happy to walk through the diff comparison. |
Cherry-pick of the presence-implies-value rule pattern feature for the SHACL generator.
This adds support for generating SHACL constraints that enforce presence-implies-value rules.