Skip to content

Fix relative endpoint URL resolution when saving to SPARQL workspace#118

Merged
MathiasVDA merged 5 commits intomainfrom
copilot/fix-wrong-endpoint-sparql
Feb 7, 2026
Merged

Fix relative endpoint URL resolution when saving to SPARQL workspace#118
MathiasVDA merged 5 commits intomainfrom
copilot/fix-wrong-endpoint-sparql

Conversation

Copy link

Copilot AI commented Feb 4, 2026

Relative endpoints (e.g., /sparql) were being saved with a static http://server/ prefix instead of resolving against the current page's protocol and host. On https://example.com/yasgui/, an endpoint configured as /sparql would be saved as http://server/sparql rather than https://example.com/sparql.

Changes

  • packages/yasgui/src/urlUtils.ts: Added resolveEndpointUrl() to convert relative/absolute paths to fully qualified URLs using window.location.protocol and window.location.host

  • packages/yasgui/src/Tab.ts: Wrap endpoint with resolveEndpointUrl() when saving to SPARQL workspaces:

    associatedEndpoint: workspace.type === "sparql" ? resolveEndpointUrl(this.getEndpoint()) : undefined,
  • test/unit/url-utils-test.ts: Unit tests covering protocol resolution, port preservation, and absolute/relative path handling

The fix only affects SPARQL workspace saves; Git workspaces are unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>Wrong endpoint for saved query in SPARQL workspace</issue_title>
<issue_description>When the endpoint in Yasgui is configured relatively, for example "/sparql", the query is saved with the endpoint "http://server/sparql".

We need to get the full url path (including correct https schema) and save that instead of adding the static http://server/. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 4, 2026 10:08
…endpoints

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix wrong endpoint for saved query in SPARQL workspace Fix relative endpoint URL resolution when saving to SPARQL workspace Feb 4, 2026
Copilot AI requested a review from MathiasVDA February 4, 2026 10:13
* Initial plan

* Fix quick describe for tokenized prefixed URIs

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>

* Address code review feedback - use template literals and improved parsing

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
@MathiasVDA MathiasVDA marked this pull request as ready for review February 7, 2026 12:09
@MathiasVDA
Copy link
Collaborator

Good works now properly!

@MathiasVDA MathiasVDA merged commit 52c7797 into main Feb 7, 2026
2 checks passed
@MathiasVDA MathiasVDA deleted the copilot/fix-wrong-endpoint-sparql branch February 7, 2026 12:09
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.

Wrong endpoint for saved query in SPARQL workspace

2 participants