Skip to content

fix(solid): keep a literal's base direction from read to write - #655

Merged
ixuz merged 1 commit into
mainfrom
fix/directional-literals
Nov 8, 2026
Merged

ixuz merged 1 commit into
mainfrom
fix/directional-literals

Conversation

@ixuz

@ixuz ixuz commented Nov 8, 2026

Copy link
Copy Markdown
Member

What and why

A literal with an RDF 1.2 base direction ("…"@ar--rtl) that another app wrote into a pod document lost its language and direction when the app read the document. Every later write of that document then held a literal typed rdf:dirLangString with no language, which the write check rightly refuses, so saving the preferences or palettes, a large card edit, or any edit of that value failed until the document was fixed outside the app. A Studio draft holding one could neither be edited nor published.

  • Both clients keep such a literal with its language and direction in every dataset made from what was read, and tell two values apart by their direction.
  • A dataset made from an RDF/JS dataset is built as a read builds one, so it keeps the direction too and holds a repeated triple once.
  • Draft statements carry the direction, and so does the check that a release already in the pod is the one being published.
  • The PATCH body, the release writer, the JSON-LD export (@direction) and the test pod write the direction after the language.
  • The write check accepts a well-formed one (a language and ltr or rtl on rdf:dirLangString) and still refuses one with no language, no direction or any other direction, or a direction on any other literal.
  • The app writes no direction of its own. The getters of text in a language leave such a literal out; it is kept as data and written back as it was read.
  • docs/data-model.md states the rule.

No test yet runs this against the real pod servers in CI, so whether each accepts @ar--rtl in a write is not shown here.

Refs: GHSA-vgv2-vh37-7c34

A literal with an RDF 1.2 base direction ("..."@ar--rtl) that another
app wrote into a pod document lost its language and direction when
the app read the document. Every later write of that document then
held a literal typed rdf:dirLangString with no language, which the
write check rightly refuses, so a save of the preferences, the
palettes or a large card edit, and any edit of that value, failed
until the document was fixed outside the app. A Studio draft that
held one could neither be edited nor published.

Both clients now keep such a literal with its language and direction,
in every dataset made from what was read, and tell two values apart by
their direction in a dataset's changes. A dataset made from an RDF/JS
dataset is now built as a read builds one, so it keeps the direction
too and holds a repeated triple once. A draft's statements carry the
direction as well, and tell "x"@ar from "x"@ar--rtl, and so does the
check that a release already in the pod is the one being published.
The PATCH body, the release writer, the JSON-LD export and the test
pod's store write the direction after the language. The write check
accepts a well-formed one: a language and ltr or rtl on a literal
typed rdf:dirLangString. It still refuses one with no language, no
direction or any other direction, or a direction on any other literal.

The app writes no direction of its own. Such a literal is not read as
text in a language, so the getters of that text leave it out, and
setting a property's strings keeps it. It shows nowhere new and stays
as data that is written back as it was read.

Refs: GHSA-vgv2-vh37-7c34
@ixuz ixuz added bug Something isn't working interop labels Nov 8, 2026
@ixuz
ixuz enabled auto-merge November 8, 2026 12:43
@ixuz
ixuz added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 158a1e3 Nov 8, 2026
92 of 98 checks passed
@ixuz
ixuz deleted the fix/directional-literals branch November 8, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working interop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant