Skip to content

PROV-N and PROV-JSON qualified-name lexical handling#13

Merged
amateescu merged 1 commit into
mainfrom
provn-lexical-handling
Jun 12, 2026
Merged

PROV-N and PROV-JSON qualified-name lexical handling#13
amateescu merged 1 commit into
mainfrom
provn-lexical-handling

Conversation

@amateescu

Copy link
Copy Markdown
Owner

Changes

  • The PROV-N parser now accepts the rest of the grammar's PN_CHARS_OTHERS set (@ & + * $ ! % plus percent-encoding) in qualified names, so names like ex:a@b that ProvToolbox emits no longer fail with Expected ')'.
  • A new internal QualifiedNameEscaper backslash-escapes PN_CHARS_ESC punctuation in local names on output and decodes it on input. Delimiter punctuation (( ) [ ] ' = , ; :) is escaped everywhere; . only when leading or trailing and - only when leading, per PN_LOCAL, so common dotted names like node.article.body keep their familiar lexical form. The PROV-N serializer escapes these instead of rejecting representable names, and the deserializer decodes them, so a name's canonical local part is the decoded form (matching the RDF/Turtle ground truth) rather than leaking a literal backslash.
  • The same escape/decode is applied to PROV-JSON: ProvToolbox carries the PROV-N escaping inside its prefix:local strings, so the JSON serializer escapes and the deserializer decodes, keeping all formats in agreement on the canonical local part.
  • The PROV-N string-literal reader gains the missing \b, \f and \' ECHAR sequences, which were previously left verbatim.
  • Every qualified-name emission (identifiers, relation endpoints, attribute values, datatypes) in PROV-N, PROV-JSON and PROV-XML now routes through PrefixMinter, so a value whose namespace was never declared still gets a declaration (a root xmlns in XML) instead of unparseable output or an unbound prefix. The minter preserves each name's own namespace boundary, so a versioned local part containing / (e.g. node:42/rev/7) is never re-split.

…ASCII and ECHAR arms, and route qualified-name emission through the prefix minter
@amateescu amateescu merged commit 7ab7a95 into main Jun 12, 2026
7 checks passed
@amateescu amateescu deleted the provn-lexical-handling branch June 12, 2026 23:14
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