Title: rdf/turtle: nested verificationMethod objects dropped from Turtle output · Issue #415 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: rdf/turtle: nested verificationMethod objects dropped from Turtle output · Issue #415 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: rdf/turtle: nested verificationMethod objects dropped from Turtle output · Issue #415 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Sibling of #389 (array-context) and #390 (@type: '@json'). Surfaced when checking whether test.solid.social's JSON-LD profile and its conneg-converted Turtle form match. Symptom When a JSON-LD profile contains a predicate whose values ar...
Open Graph Description: Sibling of #389 (array-context) and #390 (@type: '@json'). Surfaced when checking whether test.solid.social's JSON-LD profile and its conneg-converted Turtle form match. Symptom When a JSON-LD prof...
X Description: Sibling of #389 (array-context) and #390 (@type: '@json'). Surfaced when checking whether test.solid.social's JSON-LD profile and its conneg-converted Turtle form match. Symptom When a ...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/415
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"rdf/turtle: nested verificationMethod objects dropped from Turtle output","articleBody":"Sibling of #389 (array-context) and #390 (`@type: '@json'`). Surfaced when checking whether `test.solid.social`'s JSON-LD profile and its conneg-converted Turtle form match.\n\n## Symptom\n\nWhen a JSON-LD profile contains a predicate whose values are **inline objects** (rather than flat IRI references), the conneg-emitted Turtle drops:\n1. The predicate triple connecting the subject to the inline objects\n2. The inline objects' own triples (their `@id`, `@type`, attributes)\n\nThe `authentication` predicate survives because it points at a flat IRI. The `verificationMethod` predicate disappears because its values are full inline-object descriptions.\n\n## Reproduction\n\nThe on-disk profile at `test.solid.social/profile/card.jsonld` contains:\n\n```json\n{\n \"@context\": { \"...\": \"...\", \"verificationMethod\": { \"@id\": \"cid:verificationMethod\", \"@container\": \"@set\" }, \"publicKeyMultibase\": { \"@id\": \"cid:publicKeyMultibase\" }, ... },\n \"@id\": \"https://test.solid.social/profile/card.jsonld#me\",\n \"verificationMethod\": [{\n \"id\": \".../card.jsonld#nostr-key-1\",\n \"type\": \"Multikey\",\n \"controller\": \".../card.jsonld#me\",\n \"publicKeyMultibase\": \"fe70102de7ec...\"\n }],\n \"authentication\": [\".../card.jsonld#nostr-key-1\"]\n}\n```\n\nAsking JSS for Turtle:\n\n```bash\ncurl -H 'Accept: text/turtle' https://test.solid.social/profile/card.jsonld\n```\n\nreturns (excerpt):\n\n```turtle\n\u003chttps://test.solid.social/profile/card.jsonld#me> a foaf:Person, schema:Person;\n ...\n \u003chttps://www.w3.org/ns/cid/v1#controller> \u003c.../card.jsonld#me>;\n \u003chttps://www.w3.org/ns/cid/v1#service> \u003c.../card.jsonld#oidc>;\n \u003chttps://www.w3.org/ns/cid/v1#authentication> \u003c.../card.jsonld#nostr-key-1>.\n\u003chttps://test.solid.social/profile/card.jsonld#oidc> a \u003chttps://www.w3.org/ns/lws#OpenIdProvider>;\n \u003chttps://www.w3.org/ns/cid/v1#serviceEndpoint> \u003chttps://solid.social/>.\n```\n\nNote:\n\n- ❌ No `cid:verificationMethod` predicate on `#me` at all\n- ❌ No description of `#nostr-key-1` (no `a Multikey`, no controller, no publicKeyMultibase)\n- ✅ `cid:authentication \u003c.../card.jsonld#nostr-key-1>` survives (flat IRI)\n- ✅ `cid:service \u003c.../card.jsonld#oidc>` survives, AND the `#oidc` resource IS described (because it's referenced as a flat IRI from the subject AND its description is at the top level of the doc, not nested inside `service`)\n\nSo the rule seems to be: predicates whose values are inline objects (vs. flat IRI references with the resource described at the document root) get dropped.\n\n## Why this matters\n\n- **JSS's own backend works** because the resource-side LWS10-CID verifier (`src/auth/nostr.js` / `src/auth/cid-doc-fetch.js`) requests `application/ld+json`. The CID-VM check path is unaffected.\n- **Third-party Turtle consumers** see a profile with `cid:authentication \u003c#nostr-key-1>` but ZERO triples about `#nostr-key-1`. They can't find the key material — RDF-store integrations, SPARQL endpoints, CID validators that prefer Turtle, generic Solid clients that default to text/turtle.\n- This is the \"JSON-LD and Turtle profiles match\" property that #386 / #388 (LWS 1.0 alignment) implicitly relies on. Right now they don't match for any pod with a Nostr/Schnorr verificationMethod.\n\n## Likely root cause\n\n`src/rdf/turtle.js`'s emitter probably walks the JSON-LD object's top-level keys and emits a triple per predicate-value pair, but doesn't recursively descend into inline-object values to:\n\n1. Emit the predicate referencing the inline object's `@id`\n2. Recursively emit the inline object's own triples\n\nCompare to how `service` works (and survives): the JSON-LD likely has `service: [\".../card.jsonld#oidc\"]` as a flat-IRI list AND a top-level `#oidc` block describing the service endpoint. Two parallel descriptions. The Multikey VM is only declared as an inline object inside `verificationMethod` — there's no top-level `#nostr-key-1` block to fall back to.\n\n## Possible fixes\n\nA. **Hoist + flatten on serialize**: when emitting Turtle, replace inline objects with flat IRI references AND emit a top-level resource block per inline object. This is the standard JSON-LD → flat-N-Quads transformation.\n\nB. **Recursive emission**: walk inline-object values, emit them as anonymous (or named, if `@id` present) resource blocks alongside the parent.\n\nC. **Switch to a real JSON-LD library**: `jsonld.js` (digitalbazaar) handles this correctly out of the box. JSS's deliberate choice to avoid remote-context fetches (#389) is preserved by passing a pre-resolved local context map.\n\n(C) is the most robust but biggest change. (A) or (B) would unblock the immediate use case.\n\n## Acceptance test\n\nAfter the fix, the Turtle conversion of the test profile must contain:\n\n```turtle\n\u003c.../card.jsonld#me>\n cid:verificationMethod \u003c.../card.jsonld#nostr-key-1>;\n cid:authentication \u003c.../card.jsonld#nostr-key-1>.\n\n\u003c.../card.jsonld#nostr-key-1>\n a cid:Multikey;\n cid:controller \u003c.../card.jsonld#me>;\n cid:publicKeyMultibase \"fe70102de7ec...\".\n```\n\n(Whitespace + prefix-vs-IRI formatting may vary; the triple set must match.)\n\n## Refs\n\n- #386 / #388 — LWS 1.0 + W3C CID v1 alignment (the work that put this VM into the profile)\n- #389 — sibling Turtle bug (array-context loses term expansion)\n- #390 — sibling Turtle bug (`@type: '@json'` literals not emitted — relevant when VMs use `publicKeyJwk` instead of `publicKeyMultibase`)\n- #408 — well-known did:nostr endpoint (uses the same VM data, but reads JSON-LD only)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-10T08:45:09Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/415"}
| 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:a29a72ac-0d75-b337-95aa-6722593ad131 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8524:146A3D:2A88CF8:37F7A2D:6B0389B8 |
| html-safe-nonce | 86b09cdee67e7e89ca960664e1d98377042b01084cc8cb5f5c7d5ae92ae8b1be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTI0OjE0NkEzRDoyQTg4Q0Y4OjM3RjdBMkQ6NkIwMzg5QjgiLCJ2aXNpdG9yX2lkIjoiMjYxNjMwMTkzNDU2NjY3MjgyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | acc46bd1097da3a9e6839dede65e0d4869919275b7cd3a77a8967bf52da60786 |
| hovercard-subject-tag | issue:4415145984 |
| 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/415/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63a495ea15cff95727fbccf010d26f081a646635d6de07b3e992c8324e53fff0/JavaScriptSolidServer/JavaScriptSolidServer/issues/415 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63a495ea15cff95727fbccf010d26f081a646635d6de07b3e992c8324e53fff0/JavaScriptSolidServer/JavaScriptSolidServer/issues/415 |
| og:image:alt | Sibling of #389 (array-context) and #390 (@type: '@json'). Surfaced when checking whether test.solid.social's JSON-LD profile and its conneg-converted Turtle form match. Symptom When a JSON-LD prof... |
| 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