Title: rdf/turtle: emit @type:'@json' literal values (rdf:JSON datatype) — Phase B blocker for CID publicKeyJwk · Issue #390 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: rdf/turtle: emit @type:'@json' literal values (rdf:JSON datatype) — Phase B blocker for CID publicKeyJwk · Issue #390 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: rdf/turtle: emit @type:'@json' literal values (rdf:JSON datatype) — Phase B blocker for CID publicKeyJwk · Issue #390 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Surfaced during #388 (Phase A of #386) Copilot review. Problem JSON-LD 1.1 supports JSON-literal values via @type: '@json' — used for embedding plain objects (like a JWK) in RDF as rdf:JSON datatype literals. JSS's Turtle conneg layer do...
Open Graph Description: Surfaced during #388 (Phase A of #386) Copilot review. Problem JSON-LD 1.1 supports JSON-literal values via @type: '@json' — used for embedding plain objects (like a JWK) in RDF as rdf:JSON datatyp...
X Description: Surfaced during #388 (Phase A of #386) Copilot review. Problem JSON-LD 1.1 supports JSON-literal values via @type: '@json' — used for embedding plain objects (like a JWK) in RDF as rdf:JSON...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/390
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"rdf/turtle: emit @type:'@json' literal values (rdf:JSON datatype) — Phase B blocker for CID publicKeyJwk","articleBody":"Surfaced during #388 (Phase A of #386) Copilot review.\n\n## Problem\n\nJSON-LD 1.1 supports JSON-literal values via `@type: '@json'` — used for embedding plain objects (like a JWK) in RDF as `rdf:JSON` datatype literals. JSS's Turtle conneg layer doesn't currently emit them.\n\n`src/rdf/turtle.js:valueToTerm` (around line 350) only handles object values that are one of:\n- `{ \"@id\": ... }` — IRI reference\n- `{ \"@value\": ..., \"@language\": ... }` — plain literal\n- `{ \"@value\": ..., \"@type\": ... }` — typed literal\n- `{ \"@value\": ... }` — plain literal\n\nA plain object value (e.g. a JWK `{kty: \"EC\", crv: \"P-256\", x: \"...\", y: \"...\"}`) returns `null` and is silently dropped.\n\n## Why it matters\n\n#388's @context defines `publicKeyJwk` with `@type: '@json'` so a Phase B \"add my keys\" app can PATCH:\n\n```jsonld\n{\n \"verificationMethod\": [{\n \"id\": \"...#passkey-1\",\n \"type\": \"JsonWebKey\",\n \"controller\": \"...#me\",\n \"publicKeyJwk\": { \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"...\", \"y\": \"...\" }\n }]\n}\n```\n\nWithout `@type:'@json'` handling in turtle.js, the JWK gets dropped on Turtle conneg — clients negotiating Turtle would see no key bytes, breaking auth.\n\n## Fix shape\n\nExtend `valueToTerm` to handle the `@json` case. Two recognition paths:\n\n1. **Context-driven**: when the property's context entry says `@type: '@json'`, serialize the entire value (after `JSON.stringify`) as a single literal with datatype `http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON`.\n2. **Inline-typed value**: `{ \"@value\": \u003cobject>, \"@type\": \"@json\" }` — same output, value already typed inline.\n\nPseudocode addition in `valueToTerm`:\n\n```js\n// @type:@json literal — JSON-LD 1.1 §4.2.2\nif (isJsonType || (typeof value === 'object' && value['@type'] === '@json')) {\n const json = JSON.stringify(value['@value'] !== undefined ? value['@value'] : value);\n return literal(json, namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON'));\n}\n```\n\nWhere `isJsonType` is plumbed in from the context lookup (similar to existing `isIdType`).\n\n## Acceptance\n\n- [ ] A document with `@context: { foo: { \"@id\": \"ex:foo\", \"@type\": \"@json\" } }` and value `foo: {a: 1, b: [2, 3]}` round-trips to Turtle as a single `rdf:JSON` literal containing the canonical-ish JSON serialization\n- [ ] A document with `bar: { \"@value\": {a: 1}, \"@type\": \"@json\" }` (inline-typed form) also works\n- [ ] Existing `valueToTerm` paths (`@id`, `@value+@language`, `@value+@type`, `@value`) untouched\n- [ ] Test added for both forms in the Turtle conneg suite\n\n## Refs\n\n- #388 — Phase A of #386 where the context entry was added\n- #386 — LWS profile-to-key linking tracker\n- #389 — companion conneg issue (array-form @context handling)\n- [JSON-LD 1.1 §4.2.2 JSON Literals](https://www.w3.org/TR/json-ld11/#json-literals)\n- [RDF 1.1 Concepts: rdf:JSON datatype](https://www.w3.org/TR/rdf11-concepts/#section-Datatypes)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-09T04:19:34Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/390"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:af4f41c4-293f-c4af-68ed-5d7021617e71 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E4F2:DD8B9:D47585:10C2E0C:6B038804 |
| html-safe-nonce | 68a56bdb0673488630940da037086b9a714c710fef79d322f1001a1e6c0201c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNEYyOkREOEI5OkQ0NzU4NToxMEMyRTBDOjZCMDM4ODA0IiwidmlzaXRvcl9pZCI6IjU4OTk3MDU0MTE4ODc2NjMxMDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6373776fcc334c853aa930f4530ac204dcaac61c2816811ed02d4c9304962c19 |
| hovercard-subject-tag | issue:4411081251 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/390/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cd81b3799dea62d21abed8b72878f147a1964b8edfcefab8dce9b625b530ceec/JavaScriptSolidServer/JavaScriptSolidServer/issues/390 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cd81b3799dea62d21abed8b72878f147a1964b8edfcefab8dce9b625b530ceec/JavaScriptSolidServer/JavaScriptSolidServer/issues/390 |
| og:image:alt | Surfaced during #388 (Phase A of #386) Copilot review. Problem JSON-LD 1.1 supports JSON-literal values via @type: '@json' — used for embedding plain objects (like a JWK) in RDF as rdf:JSON datatyp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width