Skip to content

docs: document the language-tagged string use case#91

Draft
jeswr wants to merge 1 commit into
rdfjs:mainfrom
jeswr:docs/langstring-use-case
Draft

docs: document the language-tagged string use case#91
jeswr wants to merge 1 commit into
rdfjs:mainfrom
jeswr:docs/langstring-use-case

Conversation

@jeswr

@jeswr jeswr commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Documents the language-tagged string (rdf:langString) use case. Support already exists (ILangString, LiteralAs.langString/langTuple, LiteralFrom.langString/langTuple, Mapping.languageDictionary) and is covered by the existing test suite — this PR only adds the missing documentation. No behaviour change.

Closes #75

What it does

  • README: adds a Language-tagged strings subsection under Wrapping Terms with:
    • a turtle snippet ("The librarian"@en) and a getter/setter mapping class using LiteralAs.langString / LiteralFrom.langString ({lang, string} objects), with usage output;
    • a note on the langTuple ([language, value]) variants;
    • a Mapping.languageDictionary example wrapping a one-value-per-language predicate as a JavaScript Map, with usage output.
  • JSDoc: adds dense documentation to LiteralAs.langString and LiteralAs.langTuple (summary, @remarks, @throws, titled @example blocks pairing turtle with a mapping class, @see), matching the style of the neighbouring LiteralAs.uInt8Array docs.

Checks

  • npx typedoc passes; all new {@link} targets resolve (the only warnings are ones pre-existing on main).
  • npm test green (122 tests, 0 failures); npm audit --omit=dev --audit-level=moderate clean.

Review timing: This draft was prepared with Claude; I (@jeswr) will personally review it before it progresses. I'm currently batching a lot of work in flight, so expect active review Wednesday-Friday (8-10 July).

Adds a 'Language-tagged strings' subsection to the README under
'Wrapping Terms', showing how to map rdf:langString literals with
LiteralAs.langString/LiteralFrom.langString, the langTuple variants,
and Mapping.languageDictionary for one-value-per-language properties.

Also adds dense JSDoc (@remarks, @throws, titled @example blocks
pairing turtle with a mapping class, @see) to LiteralAs.langString
and LiteralAs.langTuple, matching the style of LiteralAs.uInt8Array.

No behaviour change.

Closes rdfjs#75

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Document LangTag use case

1 participant