extension/restrictions accept shape references (EXTENDS @<label>) - #17
Merged
Merged
Conversation
shexTest, shex.js, Apache Jena and rudof all write EXTENDS @<label> / RESTRICTS @<label> (e.g. schemas/vitals-RESTRICTS.shex), but ShExDoc.g4's extension/restrictions rules accepted only a bare shapeExprLabel. The bare-label form was never correct and never deployed, so both rules now take shapeRef instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericprud
force-pushed
the
extends-shaperef
branch
from
July 28, 2026 00:43
db25499 to
5ff1c70
Compare
ericprud
pushed a commit
to ericprud/grammar-python-antlr-linkml
that referenced
this pull request
Jul 28, 2026
- ShExDoc grammar: extension and restrictions take shapeRef ('EXTENDS @<label>'),
matching usage everywhere (shexTest, shex.js, Apache Jena, rudof). The bare
shapeExprLabel form was never correct and never deployed, so it is not accepted.
Parser regenerated with ANTLR 4.9.3 to match the antlr4-python3-runtime~=4.9.3 pin.
(Companion grammar change PRed at shexSpec/grammar#17.)
- visitQualifier / shapeExprDecl restrictions route shapeRef through shapeRef_to_iriref.
- ShExC serializer emits the @-form for EXTENDS/RESTRICTS so output re-parses.
- generate_shexj.load_shex_file: chardet.detect can return {'encoding': None}; never
pass None to bytes.decode (crashed on the shexTest ShExC manifest).
Verified against shexSpec/shexTest validation manifest via linkml/PyShEx:
1184 tests = 1180 passed, 0 failed, 4 skips (schemas pyshexc cannot parse).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericprud
pushed a commit
to ericprud/PyShEx
that referenced
this pull request
Jul 28, 2026
shexSpec/grammar#17 and linkml/grammar-python-antlr-linkml#4 dropped the never-deployed bare shapeExprLabel form; EXTENDS/RESTRICTS now require a shape reference (EXTENDS @<label>). All shexTest EXTENDS schemas already use the @-form, so results are unchanged: 129 passed, 21 skipped, 1 xfailed. Co-Authored-By: Claude Fable 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.
shexTest, shex.js, Apache Jena and rudof all writeEXTENDS @<label>/RESTRICTS @<label>(e.g.schemas/vitals-RESTRICTS.shex), butShExDoc.g4'sextension/restrictionsrules only accepted a bareshapeExprLabel. Both now accept(shapeRef | shapeExprLabel), keeping the bare-label form for backwards compatibility. The first-token sets are disjoint, so the alternatives don't conflict.Regenerating the Python parser from this grammar (with ANTLR 4.9.3) plus small visitor updates is PRed at linkml/grammar-python-antlr-linkml#4; with those, PyShEx passes the shexTest validation manifest from ShExC: 1184 tests = 1091 passed / 0 failed / 93 trait-skips.
🤖 Generated with Claude Code