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
[Parser] Support valid Unicode escapes in IRIs and literals, rejecting malformed sequences, surrogates, and out-of-range codepoints #599
Align ANTLR lexer and parser with SPARQL 1.1 §19.2 grammar for Unicode escapes (\uXXXX and \UXXXXXXXX) across IRIs and string literals, accepting valid hex encodings while strictly rejecting malformed sequences, isolated surrogates, and code points exceeding 0x10FFFF.
Target Branch
feature/corese-next
Specification & Semantics
According to W3C SPARQL 1.1 Query (§19.2):
\u must be followed by exactly 4 hexadecimal characters representing a valid Unicode scalar value.
\U must be followed by exactly 8 hexadecimal characters representing a valid Unicode scalar value.
Code points greater than U+10FFFF must be rejected with a QuerySyntaxException.
Isolated surrogate code points in the range [U+D800, U+DFFF] must be rejected with a QuerySyntaxException.
Hexadecimal escapes inside IRI references (e.g. <\u0078>) and literals must be decoded properly to their Unicode code points during lexical analysis / parsing.
In Sparql.g4 (or ANTLR grammar / lexer tokens for IRI_REF, STRING_LITERAL*), check how escape sequences are recognized and whether \u / \U escapes in IRI brackets <...> are currently rejected or untreated.
In lexical decoding utilities or AST builders, verify validation of scalar ranges (> 0x10FFFF) and surrogate rejection (0xD800 - 0xDFFF).
Acceptance Criteria
[ ] Unit tests covering valid and malformed \u / \U escapes in strings, multiline strings, and IRIs.
[ ] Valid Unicode escapes in IRIs and literals compile without syntax errors.
[ ] Out-of-range values (> 0x10FFFF), isolated surrogates, and malformed hex lengths throw QuerySyntaxException.
[ ] Targeted W3C syntax-esc-04.rq and syntax-esc-05.rq tests pass.
[ ] 0 SonarLint issues and cognitive complexity < 15.
Activity
remiceres commentedon Sep 29, 2026
Résolu et validé sur
feature/corese-nextvia la PR #612 (SparqlIriEscapes,SparqlTermResolver, tests W3Csyntax-esc-04etsyntax-esc-05).