Title: SPARQL endpoint + write-time index — make pods queryable · Issue #509 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: SPARQL endpoint + write-time index — make pods queryable · Issue #509 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: SPARQL endpoint + write-time index — make pods queryable · Issue #509 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Why Right now JSS stores JSON-LD blobs but offers no way to ask questions of them. Every app re-implements its own walker: "fetch the container, parse ldp:contains, fetch each child, scan for the property I want." This is O(N) and brittl...
Open Graph Description: Why Right now JSS stores JSON-LD blobs but offers no way to ask questions of them. Every app re-implements its own walker: "fetch the container, parse ldp:contains, fetch each child, scan for the p...
X Description: Why Right now JSS stores JSON-LD blobs but offers no way to ask questions of them. Every app re-implements its own walker: "fetch the container, parse ldp:contains, fetch each child, scan for ...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/509
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SPARQL endpoint + write-time index — make pods queryable","articleBody":"## Why\n\nRight now JSS stores JSON-LD blobs but offers no way to *ask questions* of them. Every app re-implements its own walker: \"fetch the container, parse `ldp:contains`, fetch each child, scan for the property I want.\" This is `O(N)` and brittle, and it's the single biggest reason Solid \"feels like a file dump\" rather than a database.\n\nA pod with even a thousand resources becomes painful. A pod with serious archival data (photos, transcripts, messages, agent record-of-work) is unusable without query.\n\nAdding a `/sparql` endpoint plus a write-time index turns every pod into a small queryable knowledge graph. That single addition unlocks:\n\n- **Agent grounding** — Charlie can `SELECT ?x WHERE { ?x schema:type schema:Photo ; schema:dateCreated ?d FILTER(?d > \"2025-01-01\") }` instead of walking the file tree.\n- **Cross-app reads** — vellum can find \"all notes mentioning #project-x\" without scanning every file.\n- **Search UI in explorer** — the Phase 8 search box becomes a SPARQL query under the hood.\n- **Federated query** — once one pod speaks SPARQL, asking across pods is plumbing rather than reinvention.\n- **MCP tool** — JSS already exposes 16 MCP tools; `sparql_query` becomes the 17th and makes pod data first-class to any agent.\n\n## Shape\n\n```\nPOST /sparql\nContent-Type: application/sparql-query\n\u003cquery body>\n\n→ application/sparql-results+json\n```\n\n- Index lives at `/.index/` inside the pod (writable only by owner).\n- Populated on every write (`PUT`, `POST`, `PATCH`, `DELETE`) — small, synchronous, indexes only the JSON-LD content that was just touched.\n- Backed by a tiny embedded store. Options:\n - **SQLite + a tiny triple-table schema** — boring, robust, single file, no native deps.\n - **Quadstore** (LevelDB-backed npm package) — SPARQL-aware out of the box.\n - **N3.js + in-memory store** — simplest spike but loses on restart.\n- ACL-aware: query results are filtered by the requesting agent's read access. No leaking private resources.\n\n## Scope (first cut)\n\nMinimal but useful subset:\n\n- `SELECT` with BGPs, `FILTER`, `LIMIT`, `OFFSET`, `ORDER BY`\n- `ASK`\n- `CONSTRUCT` (optional in v1)\n- `OPTIONAL`, `UNION`\n- No `UPDATE` in v1 — writes go through the LDP/HTTP path so the index is always derived\n- No federation (`SERVICE`) in v1 — that's a separate issue\n\nThings explicitly **out** of scope:\n- OWL reasoning / inferencing — a 10× project for marginal value\n- Custom function extensions\n- Full SPARQL 1.1 surface\n\n## Tradeoffs\n\n- ✓ Single addition that elevates \"Solid pod\" from file dump to knowledge graph\n- ✓ Every Solid-native app gets cheap cross-resource query\n- ✓ Pod-resident — no external triple store, no separate process\n- ✗ Write path slows slightly (index update)\n- ✗ Pod size grows (~5-15% overhead for the index)\n- ✗ Schema drift risks: if app-A writes weird JSON-LD, queries assuming app-B's shape may miss it. (Mitigation: SHACL at write time — separate future issue.)\n\n## Open questions\n\n- **Sync vs async indexing**: synchronous keeps consistency simple but couples write latency to index size. Async needs a queue + a way to surface \"stale\" reads.\n- **Reindex command**: `jss reindex` for cold-start or migrations. Walks `/.well-known/index-roots` or just everything under `/`.\n- **Backup story**: index is derived data; should `jss backup` skip it? Probably yes, with reindex on restore.\n- **`/sparql` UI**: lightweight YASGUI-style endpoint at `/sparql` for humans? Or keep it pure API and let apps ship their own?\n- **ACL filtering granularity**: per-resource read check is straightforward but slow for big result sets. Pre-filter the index by access patterns? Cache per-agent views?\n- **Federation later**: once `/sparql` exists, `SERVICE \u003chttps://other.pod/sparql>` is a small step. Worth designing the v1 result format to compose cleanly.\n\n## Effort\n\n- Spike on top of quadstore or similar: ~1 week to a working `/sparql` against a small pod, no auth.\n- Real cut with ACL filtering, sync indexing, reindex command, tests: ~3-4 weeks.\n\n## Related\n\n- #507 / #508 — filesystem mounts. SPARQL-backed pods give those a `solid-find` companion that's a real search rather than a tree walk.\n- Charlie, vellum, explorer, taskify — every one becomes simpler with query as a primitive.\n- MCP tool `sparql_query` — extends the 16-tool surface to \"ask the pod anything.\"","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-19T07:04:32Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/509"}
| 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:08a03706-3986-0248-3062-07fa6804c217 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB62:2CCAD0:221DEB:2CEB9B:6B039CE3 |
| html-safe-nonce | c14514b932a00b0ada0109afa98537a5763f59350b1da785858ca5348cb0b9ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjYyOjJDQ0FEMDoyMjFERUI6MkNFQjlCOjZCMDM5Q0UzIiwidmlzaXRvcl9pZCI6IjIxMzgyNjUwNDM2NjA0MTQxODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf0f506f7f3c153ffb94e6d86931458a90e2f469282e46344e232a8f1d69cb7c |
| hovercard-subject-tag | issue:4475174457 |
| 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/509/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8e893f27831439e5f7d010e122edbbb17bf3227947e97dbfb56c93055a6fb41c/JavaScriptSolidServer/JavaScriptSolidServer/issues/509 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8e893f27831439e5f7d010e122edbbb17bf3227947e97dbfb56c93055a6fb41c/JavaScriptSolidServer/JavaScriptSolidServer/issues/509 |
| og:image:alt | Why Right now JSS stores JSON-LD blobs but offers no way to ask questions of them. Every app re-implements its own walker: "fetch the container, parse ldp:contains, fetch each child, scan for the p... |
| 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