Title: rdf/turtle: emit a space before ';' and '.' for readability · Issue #419 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: rdf/turtle: emit a space before ';' and '.' for readability · Issue #419 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: rdf/turtle: emit a space before ';' and '.' for readability · Issue #419 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Symptom Today's Turtle output (e.g. https://test.solid.social/profile/card.jsonld with Accept: text/turtle) packs ; and . directly against the previous token: <...#me> a foaf:Person, schema:Person; foaf:name "test"; pim:storage Open Graph Description: Symptom Today's Turtle output (e.g. https://test.solid.social/profile/card.jsonld with Accept: text/turtle) packs ; and . directly against the previous token: <...#me> a foaf:Person, schema:Person;...
X Description: Symptom Today's Turtle output (e.g. https://test.solid.social/profile/card.jsonld with Accept: text/turtle) packs ; and . directly against the previous token: <...#me> a foaf:Person, sche...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/419
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"rdf/turtle: emit a space before ';' and '.' for readability","articleBody":"## Symptom\n\nToday's Turtle output (e.g. `https://test.solid.social/profile/card.jsonld` with `Accept: text/turtle`) packs `;` and `.` directly against the previous token:\n\n```turtle\n\u003c...#me> a foaf:Person, schema:Person;\n foaf:name \"test\";\n pim:storage \u003chttps://test.solid.social/>.\n\u003c...#nostr-key-1> a \u003chttps://www.w3.org/ns/cid/v1#Multikey>;\n \u003chttps://www.w3.org/ns/cid/v1#controller> \u003c...#me>;\n \u003chttps://www.w3.org/ns/cid/v1#publicKeyMultibase> \"fe70102de7ec...\".\n```\n\nA more typical/canonical-leaning style separates the statement terminators from the previous token by a space:\n\n```turtle\n\u003c...#me> a foaf:Person, schema:Person ;\n foaf:name \"test\" ;\n pim:storage \u003chttps://test.solid.social/> .\n\u003c...#nostr-key-1> a \u003chttps://www.w3.org/ns/cid/v1#Multikey> ;\n \u003chttps://www.w3.org/ns/cid/v1#controller> \u003c...#me> ;\n \u003chttps://www.w3.org/ns/cid/v1#publicKeyMultibase> \"fe70102de7ec...\" .\n```\n\n## Status of \"canonical form\" for Turtle\n\nThere is **no formally W3C-defined canonical Turtle**. RDF Dataset Canonicalization (RDC-1.0) operates on N-Quads, not Turtle. So strictly speaking, both forms are spec-conformant Turtle.\n\nHowever, the spaced form is widely treated as the \"pretty\" / preferred style:\n\n- W3C [Turtle 1.1 spec examples](https://www.w3.org/TR/turtle/) consistently use a space before `;` and `.`\n- Apache Jena's RIOT Turtle writer emits the spaced form\n- Most hand-written Turtle in the Solid / Linked Data ecosystem uses the spaced form\n- It improves human readability (the terminator is visually separable from the value) and reduces ambiguity for naive line-counters\n\nThe current N3.js default packs them. JSS uses N3.js (`new Writer({...})`) — see `src/rdf/turtle.js:72`.\n\n## What to investigate\n\n1. Whether N3.js's `Writer` exposes a config option (`spaceBeforeTerminator`, `pretty`, etc.) for this. If it does, flip the option in our usage.\n2. If not, evaluate whether a small post-processing pass on the writer's output (regex `/([^\\s])([;.])(\\s|$)/g` → `$1 $2$3`, with care around literals containing `;` or `.`) is the right approach. Note the literal-safety concern is real — `\"foo;bar\"` must not become `\"foo ;bar\"`.\n3. Check whether any existing test depends on the no-space form (it shouldn't — Turtle parsers must accept both — but a snapshot-style test might).\n\n## Acceptance\n\nAfter the change, `curl -H 'Accept: text/turtle' \u003cprofile>` emits:\n\n- A space before every `;` that terminates a predicate-list continuation\n- A space before every `.` that terminates a triple\n- Existing parsers (N3.js, Jena, rdflib, etc.) round-trip unchanged\n- Existing JSS Turtle tests still pass (or are minimally updated to match the new style)\n\n## Refs\n\n- [W3C Turtle 1.1](https://www.w3.org/TR/turtle/) — spec examples use the spaced form\n- [Apache Jena RIOT Turtle output style](https://jena.apache.org/) — same\n- N3.js writer used at `src/rdf/turtle.js:72`\n- Sibling Turtle issues: #389 (array-context), #390 (`@type: '@json'`), #415/#416 (nested VM), #417 (Multikey class IRI) — all about making JSS's Turtle output spec-correct + interop-friendly","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-10T10:09:43Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/419"}
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:7d7fccc0-406a-c2ce-7eeb-3903a985ca71 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id DF02:3C1C49:2DF9F2C:3C553D8:6B0390D5 html-safe-nonce 22096fe14aec0ad9ed5a7ac8be21454314df573fc46651fb3c2e33436127866b visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjAyOjNDMUM0OToyREY5RjJDOjNDNTUzRDg6NkIwMzkwRDUiLCJ2aXNpdG9yX2lkIjoiNzI5NjUyNDA5MDQ2MTA5ODE5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac cd86e45593adf91aaf2d0cb6fee8d33bc3e16abecf2e87c417fea08d7183870c hovercard-subject-tag issue:4415317859 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/419/issue_layout twitter:image https://opengraph.githubassets.com/0ff7113f0307a8f20d447e9e0ca04d14d04a1e3b621fb0c80cb53f15e97a119f/JavaScriptSolidServer/JavaScriptSolidServer/issues/419 twitter:card summary_large_image og:image https://opengraph.githubassets.com/0ff7113f0307a8f20d447e9e0ca04d14d04a1e3b621fb0c80cb53f15e97a119f/JavaScriptSolidServer/JavaScriptSolidServer/issues/419 og:image:alt Symptom Today's Turtle output (e.g. https://test.solid.social/profile/card.jsonld with Accept: text/turtle) packs ; and . directly against the previous token: <...#me> a foaf:Person, schema:Person;... 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
Response headers:
Server github.com Content-Type text/html; charset=utf-8 Cache-Control max-age=0, private, must-revalidate
URLs of crawlers that visited me.