You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gen-shacl rules: translate any_of (and the other boolean operators) in rule conditions, as gen-json-schema does #54
Corrected 2026-10-15. This issue first said the rule is dropped silently. That doesn't hold on linkml#3990 (c48bb2a47) or #14 (536d6f194): gen-shacl logs WARNING … Rule 2 of class 'Thing': skipped, because its postconditions use any_of. Warnings name a rule by index and description, not title, so a search for the title finds nothing. Dropping the sibling slot_conditions follows linkml#3989's contract that a rule is translated whole or skipped. On upstream main such rules are skipped at DEBUG level only; linkml#3989 raises that to a warning. #48 is unrelated (class expressions on subclasses).
What
gen-shacl skips every rule whose conditions use an expression-level any_of (likewise all_of, exactly_one_of, none_of). gen-json-schema enforces the same rule, so the two disagree on the same instances.
gen-json-schema's then is {"anyOf": [{"properties": {"status": {"const": "ok"}}, "required": ["status"]}, {… "fine" …}], "properties": {"level": {"minimum": 1}}, "required": ["level"]}.
Instance (kind: b)
JSON Schema
SHACL (pyshacl)
level: 2, status: ok
valid
conforms
level: 2, status: bad
invalid
conforms
level: 0, status: ok
invalid
conforms
Proposed fix
Translate the operators in rule conditions. A violation of P → (A ∧ (B ∨ C)) is P ∧ (¬A ∨ (¬B ∧ ¬C)); the branches reuse the per-slot patterns of _postcondition_violations.
Name the rule title in skip warnings (_RuleSite.__str__).
Acceptance criteria
_json_schema_and_shacl_verdicts (test_shaclgen.py) agrees for any_of in postconditions, with sibling slot_conditions, and under open_world. The other three operators are translated the same way or stay skipped with a warning.
Skip warnings name the rule title when it has one.
changed the title [-]gen-shacl rules: a postcondition block containing any_of is dropped whole and silently, taking its sibling slot_conditions with it[/-][+]gen-shacl rules: translate any_of (and the other boolean operators) in rule conditions, as gen-json-schema does[/+]on Oct 15, 2026
Activity
[-]gen-shacl rules: a postcondition block containing any_of is dropped whole and silently, taking its sibling slot_conditions with it[/-][+]gen-shacl rules: translate any_of (and the other boolean operators) in rule conditions, as gen-json-schema does[/+]