Skip to content

docs(shacl): document rule-to-SHACL-SPARQL constraint generation - #23

Open
jdsika wants to merge 1 commit into
feat/shaclgen-compositional-rule-fallbackfrom
docs/shaclgen-rule-constraints
Open

jdsika wants to merge 1 commit into
feat/shaclgen-compositional-rule-fallbackfrom
docs/shaclgen-rule-constraints

Conversation

@jdsika

@jdsika jdsika commented Jul 11, 2026 •

Copy link
Copy Markdown

Mirror of linkml#3991, same head. Review there; this PR tracks the fork stack.

2026-10-23, second push: re-stacked on linkml#3990's second push. The section lists the new composed operators (equals_number, pattern, slot-level booleans) and says why a rule becomes an sh:sparql constraint rather than the metamodel's sh:rule inference mapping.

2026-10-23: rebased onto the rebased linkml#3990 (33b0f44d0); no conflict, docs only.

2026-10-13: rebased onto the updated linkml#3990 and signed off. The section now documents that a bare equals_string precondition reads "every value" (the exclusive-value pattern requires has_member) and that each postcondition slot gets its own constraint.

Summary

This PR documents the translation of LinkML rules into SHACL-SPARQL in docs/generators/shacl.rst, which did not mention it. It also replaces the dangling "See above for implementation status" in the rules section of docs/schemas/advanced.md with links to the JSON Schema and SHACL generator pages.

The new section covers:

Corrections to the earlier version

  • Skipped rules are logged as warnings, not at DEBUG.
  • open_world is honoured.
  • Values are compared with =, not NOT IN.
  • pyshacl validates sh:sparql constraints without advanced=True.

Verification

  • The example's output comes from gen-shacl and was regenerated on this stack; its documented results were checked with pyshacl.
  • make html passes with SPHINXOPTS="-W --keep-going", as in docs-test.

Documentation only.

Upstream stack: linkml#3989 → linkml#3990 → linkml#3991 (docs).
Fork stack: #19 → #20 → #23 (docs); #35 (tests) is also based on #20.

@jdsika jdsika self-assigned this Jul 11, 2026
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from ada76d6 to 5123d41 Compare September 11, 2026 12:53
@jdsika
jdsika changed the base branch from fix/shaclgen-rule-converter-audit-findings to feat/shaclgen-compositional-rule-fallback September 11, 2026 12:53
@jdsika jdsika changed the title docs(shacl): document rules-to-SHACL-SPARQL constraint generation docs(shacl): document rule-to-SHACL-SPARQL constraint generation Sep 11, 2026
@jdsika jdsika closed this Sep 11, 2026
@jdsika jdsika reopened this Sep 11, 2026
@jdsika

jdsika commented Sep 11, 2026

Copy link
Copy Markdown
Author

Mirrored upstream as linkml#3991.

@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from 59544b4 to 1b1c775 Compare October 2, 2026 11:16
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 5123d41 to 608f99c Compare October 2, 2026 11:16
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from 1b1c775 to d035e8c Compare October 2, 2026 11:22
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 608f99c to 7197a7e Compare October 2, 2026 11:22
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from d035e8c to c89faac Compare October 6, 2026 17:47
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch 2 times, most recently from 442dd51 to 6a78f26 Compare October 6, 2026 18:20
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from c89faac to a71a8f9 Compare October 13, 2026 20:11
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 6a78f26 to 83b92de Compare October 13, 2026 20:34
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from a71a8f9 to c48bb2a Compare October 14, 2026 04:55
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 83b92de to 029c4c2 Compare October 14, 2026 04:55
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from c48bb2a to 33b0f44 Compare October 23, 2026 08:47
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 029c4c2 to 4377a5c Compare October 23, 2026 08:47
The SHACL generator translates LinkML rules into sh:sparql constraints,
but its documentation did not mention them.

Describe the two named patterns and the composed translation with the
operators it supports and one constraint per postcondition slot, the
semantics shared with the JSON Schema generator (presence, every value
versus has_member, value comparison, numeric bounds), inheritance,
open_world, --no-emit-rules and the skip warnings, with an example
generated by the generator.  Replace the dangling "See above for
implementation status" in the rules section of advanced.md with links
to the JSON Schema and SHACL generator pages.

Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
@jdsika
jdsika force-pushed the feat/shaclgen-compositional-rule-fallback branch from 33b0f44 to 5a673d4 Compare October 23, 2026 11:34
@jdsika
jdsika force-pushed the docs/shaclgen-rule-constraints branch from 4377a5c to 170b2fb Compare October 23, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant