feat: CTRL+SHIFT+CLICK on URI to find all triples where URI is object - #181
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add functionality for CONTROL+SHIFT+CLICK on URI to query triples
feat: CTRL+SHIFT+CLICK on URI to find all triples where URI is object
Sep 12, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Some docs/user-facing messages still say “DESCRIBE” even though the code executes CONSTRUCT, which makes the UI output and comments misleading.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a new URI lookup shortcut across MatGUI’s editor (YASQE/YASGUI) and plain response viewer (YASR Response plugin): CTRL+SHIFT+CLICK runs an “object-of” CONSTRUCT to retrieve triples where the clicked URI is the object, complementing the existing CTRL+CLICK behavior.
Changes:
- Added
buildObjectOfQuery(uri)to YASR response URI utilities and exported it from@matdata/yasrfor reuse. - Updated YASR Response plugin and YASGUI Tab mouse handlers to branch on
event.shiftKeyand run the new object-of lookup on CTRL+SHIFT+CLICK. - Updated YASQE cursor hint text and expanded unit tests for the URI query builders.
File summaries
| File | Description |
|---|---|
| test/unit/response-uri-utils-test.ts | Updates buildDescribeQuery assertion to match current CONSTRUCT output; adds coverage for buildObjectOfQuery. |
| packages/yasr/src/plugins/response/uriUtils.ts | Introduces buildObjectOfQuery(uri) alongside existing query helpers. |
| packages/yasr/src/plugins/response/index.ts | Adds CTRL+SHIFT+CLICK handling to run object-of query and append results in the Response view. |
| packages/yasr/src/index.ts | Exports buildObjectOfQuery from the package entrypoint for reuse in YASGUI. |
| packages/yasqe/src/index.ts | Updates the on-cursor URI shortcut hint to mention both CTRL+CLICK and CTRL+SHIFT+CLICK behaviors. |
| packages/yasgui/src/Tab.ts | Uses buildObjectOfQuery for CTRL+SHIFT+CLICK; keeps existing CTRL+CLICK both-direction CONSTRUCT. |
Review details
Suppressed comments (1)
packages/yasr/src/plugins/response/index.ts:193
- The non-shift shortcut path uses buildDescribeQuery(), which executes a CONSTRUCT query, but the appended headings and error logs still say "DESCRIBE". This makes the UI output inaccurate and can mislead users when interpreting the appended results or debugging failures.
private async runObjectOfQuery(uri: string) {
if (!this.yasr.config.executeQuery) return;
const cmAtStart = this.cm;
if (!cmAtStart) return;
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MathiasVDA
marked this pull request as ready for review
September 12, 2026 16:55
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.
Extends the existing CTRL+CLICK URI lookup in both the query editor and the response viewer with a new CTRL+SHIFT+CLICK action that runs:
Changes
uriUtils.ts— AddedbuildObjectOfQuery(uri)alongside the existingbuildDescribeQuery. Exported from the@matdata/yasrpackage index for reuse.packages/yasr/src/plugins/response/index.ts—handleMouseDownnow branches onevent.shiftKey: CTRL+SHIFT+CLICK appends the object-of CONSTRUCT result to the response view; plain CTRL+CLICK retains the existing DESCRIBE behaviour.packages/yasgui/src/Tab.ts—handleYasqeMouseDownsimilarly branches onevent.shiftKey, callingbuildObjectOfQueryfor CTRL+SHIFT+CLICK and keeping the existing both-direction CONSTRUCT for plain CTRL+CLICK.packages/yasqe/src/index.ts— Cursor hint updated to describe both shortcuts: "CTRL+click: find triples where URI is subject or object. CTRL+SHIFT+click: find triples where URI is object."test/unit/response-uri-utils-test.ts— Fixed stalebuildDescribeQueryassertion (was assertingDESCRIBE <uri>, now matches actual CONSTRUCT output); added coverage forbuildObjectOfQuery.