Skip to content

feat: CTRL+SHIFT+CLICK on URI to find all triples where URI is object - #181

Merged
MathiasVDA merged 6 commits into
mainfrom
copilot/add-control-shift-click-uri
Sep 12, 2026
Merged

MathiasVDA merged 6 commits into
mainfrom
copilot/add-control-shift-click-uri

Conversation

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown

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:

CONSTRUCT { ?s ?p <uri> } WHERE { ?s ?p <uri> } LIMIT 1000

Changes

  • uriUtils.ts — Added buildObjectOfQuery(uri) alongside the existing buildDescribeQuery. Exported from the @matdata/yasr package index for reuse.
  • packages/yasr/src/plugins/response/index.tshandleMouseDown now branches on event.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.tshandleYasqeMouseDown similarly branches on event.shiftKey, calling buildObjectOfQuery for 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 stale buildDescribeQuery assertion (was asserting DESCRIBE <uri>, now matches actual CONSTRUCT output); added coverage for buildObjectOfQuery.

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
Copilot AI requested a review from MathiasVDA September 12, 2026 16:10
@MathiasVDA
MathiasVDA requested a lite review from Copilot September 12, 2026 16:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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/yasr for reuse.
  • Updated YASR Response plugin and YASGUI Tab mouse handlers to branch on event.shiftKey and 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.

Comment thread packages/yasr/src/plugins/response/index.ts Outdated
Comment thread packages/yasr/src/plugins/response/uriUtils.ts Outdated
@MathiasVDA
MathiasVDA marked this pull request as ready for review September 12, 2026 16:55
@MathiasVDA
MathiasVDA merged commit 03c9937 into main Sep 12, 2026
2 checks passed
@MathiasVDA
MathiasVDA deleted the copilot/add-control-shift-click-uri branch September 12, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONTROL+SHIFT+CLICK on URI should look up all triples where URI is object of

3 participants