Conversation
jdsika
force-pushed
the
feat/shaclgen-inlined-range-sh-node
branch
from
October 2, 2026 15:06
aee8951 to
5db175a
Compare
jdsika
changed the base branch from
main
to
feat/shaclgen-class-boolean-expressions
October 2, 2026 15:06
jdsika
force-pushed
the
feat/shaclgen-inlined-range-sh-node
branch
from
October 2, 2026 15:13
5db175a to
111a453
Compare
jdsika
force-pushed
the
feat/shaclgen-inlined-range-sh-node
branch
from
October 5, 2026 07:15
111a453 to
74a2483
Compare
jdsika
marked this pull request as draft
October 5, 2026 07:28
jdsika
force-pushed
the
feat/shaclgen-inlined-range-sh-node
branch
from
October 5, 2026 09:13
74a2483 to
937b986
Compare
Translate class-ranged range_expression constraints into anonymous node shapes while retaining ordinary range checks. Resolve nested conditions against the value class, including induced slots and imported prefixes. Cover slot alternatives, nested and conditional expressions, class membership, JSON Schema parity, CLI behavior, and unsupported inputs with real validator tests. Document the supported scope and standard mappings. Signed-off-by: jdsika <carlo.van-driesten@vdl.digital>
jdsika
force-pushed
the
feat/shaclgen-inlined-range-sh-node
branch
from
October 5, 2026 09:52
937b986 to
3f14cf9
Compare
jdsika
marked this pull request as ready for review
October 5, 2026 10:06
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 and behavior
gen-shaclsilently ignored a class-ranged slot'srange_expression. A schema could requireDocument.license.categoryto equallicense, yet generated SHACL accepted an unrelated category while generated JSON Schema rejected it.The generator now adds an anonymous
sh:nodeconstraint for the expression and retains the ordinary range check. In class-URI naming mode a value must still satisfysh:class Resource; matching its contents does not substitute for membership. The constraint applies only in the declared context. No new option is introduced.Stacked on #29. This replaces the earlier proposed
--inlined-as-nodefeature: the downstream requirement is contextual constraints, and the existing metamodel can express them without using JSON/YAML inlining to waive RDF class membership.Scope and standards
any_of, and nested slot conditions. Reuses the existing class-expression translation for boolean operators and value/presence/cardinality constraints.equals_expressionconditions are translated without evaluating user code. This includes the metamodel's boolean grouping-slot constraint. Variables, function calls, containers and arithmetic remain explicitly unsupported.linkml:Anyclass range can combine class, datatype, and enum alternatives.The upstream design rationale is discussion #2791, where a maintainer demonstrates a generic quantity range with a contextual unit constraint. Merged JSON Schema PR #2860 implements the same nested-constraint construct.
Downstream evidence
The origin is ontology-management-base#106. Its migration represented contextual link requirements as subclasses while existing RDF stated only the generic link type. The earlier flag validated those subclasses' shapes without requiring their membership. An OMB blank-node inference defect was separate and already fixed in
e99ace5.An isolated model revision uses ordinary link/manifest ranges plus anonymous contextual expressions, including closed categories, conditional artifact metadata requirements, and simulation-manifest member requirements. Consumer fixtures and expected verdicts are unchanged. This is a migration experiment, not a committed change to OMB; the caller must remove the old flag and revise the affected models before adopting this replacement.
Cross-generator review
equals_expressionvalidation is not implemented there; the scalar-expression SHACL cases are not claimed as parity tests.range_expression; this PR does not change OWL output. Existing limitations include the treatment ofequals_stringas a datatype pattern and incomplete cardinalities in anonymous expressions, so full validation equivalence is not claimed.range_expression. Python/Pydantic generation likewise has no general implementation of this construct. These are existing support gaps, not evidence that the SHACL mapping can be assumed equivalent across all artifacts.Validation
Real generated artifacts are validated with pySHACL (including meta-SHACL) and JSON Schema; no mocks or weakened assertions. Tests cover class membership, local scope, references, inheritance, imported prefixes, naming/suffixes, union branches, nested/boolean/conditional expressions, unsupported-input failures, and CLI behavior.
3f14cf91bdc82111ecca5aaf22fbbab21a13497e, including the full regular Linux/Windows Python matrix, all four slow-test jobs, both notebook jobs, dependency/link checks and the package build. CI run.The implementation and validation are ready for fork review. Adopting it in OMB still requires the model/caller migration described above; no upstream PR is opened by this change.