Repository navigation
feat: add TripleTrail as an engine - #9
Merged
Merged
Conversation
TripleTrail explains a query on /{ds}/explain beside /{ds}/sparql and
/{ds}/query, and answers JSON with the plan it ran: each step with its
name, rows, duration and children, plus the planning time and the
decisions of its spatial index. The engine asks that URL and draws the
plan as a tree; a caller limited to some graphs gets the row count with
a note. It is recognised from a Server header naming TripleTrail.
2 of 3 tasks
The demo has a recorded plan per engine to try the view without an endpoint. Add one for TripleTrail, with a spatial filter so the summary lines show, and name the engine in the demo intro and the README.
MathiasVDA
commented
Nov 20, 2026
MathiasVDA
left a comment
Contributor
Author
There was a problem hiding this comment.
Review: OK to merge.
Checked:
src/engines/tripletrail.ts: the/explainURL mapping keeps query strings and handles/sparql,/query,/update, trailing slashes and workspace paths. The parser copes with missing or non-numeric fields, refuses SPARQL results and non-JSON answers with a clear message, and falls back to text for a restricted caller.- Detection only from the
Serverheader, placed after the other header checks, so no existing endpoint changes engine. needsRequestOptions: trueis right, since the request goes to another URL. Hosts withoutqueryRequestfall back to the direct fetch, like Stardog.npm test(36 tests),tsc --noEmit, Prettier onsrcandtests, andnpm run buildpass locally.
Pushed one commit: a TripleTrail sample plan for the demo (?sample=tripletrail), so every engine with a tree or text plan has a recorded sample, plus the engine name in the demo intro and README. Rendered it in the demo: the tree, rows, times and the spatial summary lines show as expected.
Notes, not blocking:
- The plan shape is taken from the PR description and tests. It was not checked against a running TripleTrail server.
- A JSON answer without
plan,rowsorrestricted(for example an error object sent with status 200) shows "No plan." If TripleTrail has such a shape, a message for it can follow. - After the release, the MatGUI user guide (Explain section) should list TripleTrail when the plugin is bumped there.
Generated by Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds TripleTrail to the engines the Explain view can ask for a plan.
src/engines/tripletrail.ts: asks/{ds}/explainbeside/{ds}/sparql,/{ds}/queryor/{ds}/update(also/$/workspaces/{id}/…), withAccept: application/json, throughyasr.executeQuerywith the tab's authentication where the host supports it. It drawsplan.planas a tree (each step'sname,number of results,duration in seconds,children), with the row count, planning time and the spatial index's decisions as the summary. A caller limited to some graphs gets the row count and a note on why there is no plan. Query results or HTML instead of a plan give a clear error.Serverheader naming TripleTrail. TripleTrail sendsServer: TripleTrail/<version>and exposes it to CORS pages from fix(ui): show TripleTrail's plan in MatGUI's Explain tab tripletrail#67. There is no URL rule, since/{ds}/sparqlsays nothing about the engine.tripletrailadded toEngineId,ENGINESandENGINE_IDS. The "No engine recognised" message, README, package description/keywords and publiccode.yml list it.Tests: new cases in
tests/engines/engines.test.ts(URL mapping, request, tree and summary, restricted answer, wrong answers, header detection).npm testpasses with 36 tests, andnpm run build,tsc --noEmitand the Prettier check all pass too.After merging, a release (e.g.
1.1.0) publishes it to npm, and MatGUI then bumps@matdata/yasgui-explain-plugin.