Repository navigation
fix(ui): show TripleTrail's plan in MatGUI's Explain tab - #67
Merged
Merged
Conversation
MatGUI's Explain view only knows QLever, GraphDB, Stardog, Blazegraph and Neptune, so on the Query page it said "No engine recognised for this endpoint" and showed no plan. The Query page now registers a TripleTrail engine with it: for this server's own endpoints it POSTs the query to …/explain (with the admin token and view-as headers) and draws plan.plan as a tree with the rows and time of each step.
a_saved_graph_is_read_again_by_a_new_engine removed its folder with remove_dir_all while the engine's background save of the rebuilt graph could still write into it, which failed on CI with "Directory not empty" and left the folder behind. It now uses tripletrail_testdir::tempdir, removed after the engine is dropped and retried while a writer finishes.
2 of 3 tasks
Answers said "Server: tiny-http (Rust)". They now say "TripleTrail/<version>", and --cors exposes the header, so the Explain plugin of MatGUI and YASGUI can recognise the engine (the plugin's TripleTrail engine keys on it) on any host, not only the Query page.
… is done" This reverts commit d02f174.
The Explain plugin of MatGUI and YASGUI does not recognise TripleTrail yet; its TripleTrail engine waits for a plugin release.
…-uprney # Conflicts: # CHANGELOG.md
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.
What and why
On the Query page, MatGUI's Explain tab of the results showed no plan and said "No engine recognised for this endpoint". The MatGUI 6.13.0 explain plugin only knows QLever, GraphDB, Stardog, Blazegraph and Neptune (detected from the
Serverheader or the URL), and there is no hook to add an engine from outside the bundle. The server's/{ds}/explainitself was fine.The Query page now subclasses MatGUI's
Explainplugin after MatGUI loads and registers it under the same name:resolveEngine: when the plugin finds no engine and the endpoint is this server's own…/sparqlor…/query(a dataset or a Workbench workspace), it uses a TripleTrail engine, shown as "Detect (TripleTrail)" in the Engine list. A stored or forced engine choice still wins.runRequest: POSTs the query to…/explainasapplication/sparql-querywith the admin token and the view-as headers (as the query itself is sent).parse: mapsplan.plan(name,number of results,duration in seconds,children) to the plugin's tree, with the row count, planning time and spatial decisions as the summary. A restricted caller (row count only) gets a short text instead of a tree.It works the same with
--matgui-urlpointing at the CDN build, since it only relies onYasgui.Yasr.plugins.Explain. The Explain button above MatGUI is unchanged.Also in this PR:
Server: TripleTrail/<version>on every answer (it saidtiny-http (Rust)), and--corsexposes it. The Explain plugin's new TripleTrail engine (feat: add TripleTrail as an engine yasgui-explain-plugin#9) recognises the server by this header, so MatGUI on any host can find the plan once a plugin release with that engine is bundled (not yet). Until then, the Query page's own registration above covers the built-in UI.How it was tested
tests/admin.rs::the_query_page_explain_view_reads_the_plan_of_this_server: the servedapp.jswires the engine, and/{ds}/explainanswers the request the view sends with the fields it reads, for every step of the plan.Serverheader names TripleTrail;cargo test -p tripletrail-server --test admin --test httppass.cargo fmt --check,cargo clippy -p tripletrail-server --all-targets -- -D warnings,cargo test -p tripletrail-server --test admin,GUIDE_CHAPTER=02 cargo test -p tripletrail-server --test guide.Documentation
docs/guide/) shows it: new section "See how a query ran" in02-first-steps.md, with a tested/ds/explainexampledocs/(server.md, Web UI,--cors) and the CHANGELOG entry describe it