feat: endpoint describe panel (#97) - #189
Conversation
Add an "Endpoint overview" panel that helps to understand a SPARQL endpoint while writing queries. It is opened with the new "Describe endpoint" button in the control bar (or F8) and docks next to the editor. It can be pinned, collapsed to a thin rail and resized, and on small screens it opens as a bottom sheet. - Reads the SPARQL Service Description (endpoint without ?query) and VoID (/.well-known/void or embedded in the SD) and shows features, extension functions, named graphs, dataset statistics and class/property partitions. Missing sources are reported, not errors. - Bounded overview queries for all categories of the issue: named graphs (paginated), triple counts, namespaces, classes, properties, SKOS schemes, SHACL/ShEx shapes, sample instances, hubs, languages, links and time/geo (incl. a bounding box computed from WKT samples). Queries only run on demand; expensive ones are flagged. - Results are cached per endpoint in their own storage key, so they survive new queries, tab switches and reloads, without risking the main configuration when the storage quota is exceeded. - Clicking an IRI inserts it (prefixed, adding the PREFIX) into the query; describe queries can be opened in a new tab. - Queries and categories are configurable via `endpointDescribe`. - Tab gets `runBackgroundQuery` / `getRequestInit`, and yasqe's `executeQuery` a `skipGraphArgs` option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEbQuDzCkbQKKsARAXTpKu
…eference Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEbQuDzCkbQKKsARAXTpKu
Findings from running the panel against DBpedia, Wikidata and data.europa.eu: - The namespaces query used a REPLACE() pattern that matches the empty string, which Virtuoso rejects. Use "[^#/]+$" and add a regression test. - Virtuoso "anytime queries" (DBpedia) answer HTTP 206 / X-SQL-State S1TAT with incomplete, often empty results. Such results are now marked as partial instead of looking like "no data". - Error pages are summarized: HTML bodies (Wikimedia 429, gateway 504) are reduced to their title, 429 explains the rate limiting (with Retry-After), and Java stack traces (Blazegraph) are reduced to their root cause. - Wikidata's service description is ~19 MB. SD/VoID documents are now read up to 5 MB, parsed up to the last complete statement and flagged as truncated; partition de-duplication no longer is quadratic. - Blank-node VoID datasets are no longer shown as IRIs and datasets without any information are dropped. - SKOS concept schemes is flagged as possibly slow (timed out on data.europa.eu). - runQuery() now uses the endpoint of the active tab even when the panel is closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DEbQuDzCkbQKKsARAXTpKu
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It introduces a large new subsystem (~2,500 lines) spanning UI, concurrency/scheduling, RDF parsing, persistent cache eviction, and new public APIs, which warrants final human review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR implements the Endpoint overview ("Describe endpoint") panel (closing #97), a new docked side panel in @matdata/yasgui that helps users explore an unfamiliar SPARQL endpoint while writing queries. It discovers the endpoint's SPARQL Service Description and VoID description, offers ~20 bounded overview queries across six categories, caches results per endpoint in its own storage key, and can be pinned/collapsed/resized. It also adds supporting primitives to @matdata/yasqe (skipGraphArgs) and Tab (runBackgroundQuery, getRequestInit).
Changes:
- New
endpointDescribe/subsystem (panel UI, query catalogue, SD/VoID metadata discovery, response/error normalization, per-endpoint cache with LRU eviction). - New public APIs:
yasgui.endpointDescribe,Tab.runBackgroundQuery(),Tab.getRequestInit(), andexecuteQuery'sskipGraphArgsoption; F8 shortcut and control-bar/hamburger buttons. - Extensive unit + Puppeteer tests, docs (user/developer guides, README, intro), changeset, and the
n3dependency.
| File | Description |
|---|---|
| packages/yasgui/src/endpointDescribe/EndpointDescribePanel.ts | Core panel UI, query scheduling/concurrency, rendering, IRI insertion |
| packages/yasgui/src/endpointDescribe/describeQueries.ts | Catalogue of bounded overview queries + WKT bounding-box post-processing |
| packages/yasgui/src/endpointDescribe/metadataSources.ts | SD/VoID fetching and RDF extraction with size limiting/truncation |
| packages/yasgui/src/endpointDescribe/responseUtils.ts | Partial-result detection and readable error messages |
| packages/yasgui/src/endpointDescribe/DescribeStore.ts | Per-endpoint cache, row truncation, LRU/size eviction, UI state |
| packages/yasgui/src/endpointDescribe/EndpointDescribePanel.scss | Docked/collapsed/bottom-sheet styling |
| packages/yasgui/src/index.ts | Wires panel into layout (mainEl/tabPanelsEl), config, lifecycle |
| packages/yasgui/src/Tab.ts | runBackgroundQuery, getRequestInit, F8 handler |
| packages/yasgui/src/TabSettingsModal.ts | Control-bar and hamburger "Describe endpoint" buttons |
| packages/yasgui/src/defaults.ts | Default endpointDescribe config |
| packages/yasqe/src/sparql.ts | skipGraphArgs option omitting tab graph arguments |
| packages/yasgui/package.json, package-lock.json | Adds n3 dependency |
| test/endpoint-describe-browser.ts, test/unit/endpoint-describe-test.ts, test/unit/yasqe-background-query-test.ts, test/run.ts | New unit + browser test coverage |
| docs/user-guide.md, docs/developer-guide.md, README.md, website/docs/intro.md, .changeset/endpoint-describe-panel.md | Documentation and changeset |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Closes #97
Summary
Adds an Endpoint overview panel for getting to know an unfamiliar SPARQL endpoint while writing queries. Open it with the new Describe endpoint button in the tab control bar (also in the mobile menu) or with
F8.Panel behaviour
Service Description and VoID
?query;/.well-known/void, or embedded in the SD.Overview queries
LIMIT.206/X-SQL-State: S1TAT, often with an empty result.429) is explained, includingRetry-After;Remembered results
Working with results
PREFIXline.Configuration
endpointDescribeoption:enabled,queries,categories,timeoutMs,maxConcurrentQueries,fetchMetadata.API additions
Tab.runBackgroundQuery()andTab.getRequestInit().yasgui.endpointDescribe.skipGraphArgsoption on yasqe'sexecuteQuery.Other
n3added to the yasgui dependencies (already used by yasr).Documentation
F8entry under keyboard shortcuts.yasgui.endpointDescribe,tab.runBackgroundQuery()andtab.getRequestInit().Testing
Live endpoints. Every query was run against DBpedia (Virtuoso), Wikidata (Blazegraph) and data.europa.eu (Virtuoso). SD/VoID discovery was run against all three, and the panel itself was run in headless Chromium against Wikidata and data.europa.eu.
named-graphs/graph-sizeson Wikidata, which runs in triples mode.206results looked like complete results;runQuery()did nothing on a closed panel.data-interop.era.europa.eu) could not be reached from the development environment.Unit tests:
REPLACEpatterns that match the empty string, LIMIT/OFFSET pagination, per-class sample generation, WKT bounding box;429/504/Blazegraph errors;skipGraphArgs.Browser tests (Puppeteer, against a mocked endpoint):
429messages;Other checks:
mainmerged in:npm run build,npm run unit-test(180 passing) andnpm run puppeteer-test(47 passing).🤖 Generated with Claude Code
https://claude.ai/code/session_01DEbQuDzCkbQKKsARAXTpKu