Skip to content

Vendor the RDFa editor's resources key that skips XML literals - #436

Merged
namedgraph merged 1 commit into
developfrom
fix/rdfa-editor-key-skips-xml-literals
Oct 18, 2026
Merged

namedgraph merged 1 commit into
developfrom
fix/rdfa-editor-key-skips-xml-literals

Conversation

@namedgraph

Copy link
Copy Markdown
Member

Why

After #435, https://northwind-traders.demo.localhost/assistant-repro-1648/ (a document whose assistant turn returned a CONSTRUCT graph describing the document itself) still failed in the browser:

Required cardinality of first argument of ac:label() is exactly one; supplied value contains 2 items (element <rdf:Description>, element <rdf:Description>)

Caught through the DevTools protocol, the error is at ldh-composed-client.xsl line 285, the page-title lookup in client.xsl: ac:label(key('resources', $resource-uri, $results)).

Key declarations with the same name are merged across the stylesheet. The composed client SEF contains seven resources-family keys, and six of them carry #435's exclusion. The seventh is rdfa-editor/translations.xsl, which #435 left alone because the vendored editor is kept byte-identical to its repository. That one still indexed the description inside the XML literal.

What

rdfa-editor/translations.xsl now matches AtomGraph/RDFa-Editor#35 byte for byte. That PR adds the same not(ancestor::*[@rdf:parseType = 'Literal']) predicate to the key, plus a comment explaining it.

Testing

  • The predicate works in Saxon-JS: on the repro document, the old key returns 2 and the fixed key returns 1.
  • The failing key was located in the composed SEF the browser loads; this is the only declaration without the exclusion.
  • Not yet verified end to end: the page itself hasn't been reloaded with this deployed. This needs make sef, then a rebuilt image and stack, then a fresh browser, since the composed SEF's URL is unchanged and /static/ is cached immutable.

🤖 Generated with Claude Code

rdfa-editor/translations.xsl declares the resources key too, and key
declarations of one name are merged across the stylesheet. Left without
#435's exclusion it still indexed the descriptions inside an XML literal,
so a document whose assistant turn returned a graph describing the document
itself still failed in the browser: the page title's
ac:label(key('resources', $resource-uri, $results)) (client.xsl) got two
descriptions. Located in the composed client SEF, where it was the only
one of seven resources-family keys without the predicate.

Byte-identical to AtomGraph/RDFa-Editor#35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@namedgraph
namedgraph merged commit cb2a16a into develop Oct 18, 2026
3 checks passed
@namedgraph
namedgraph deleted the fix/rdfa-editor-key-skips-xml-literals branch October 18, 2026 17:17
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