feat: make SPARQL endpoint path configurable#1617
Open
stefanavesand wants to merge 1 commit intoaws:mainfrom
Open
feat: make SPARQL endpoint path configurable#1617stefanavesand wants to merge 1 commit intoaws:mainfrom
stefanavesand wants to merge 1 commit intoaws:mainfrom
Conversation
Add a configurable `sparqlEndpointPath` field to ConnectionConfig, allowing users to specify the SPARQL query endpoint path for their triple store. Defaults to "/sparql" for backward compatibility with Amazon Neptune and Blazegraph. This enables Graph Explorer to work with triple stores that use different SPARQL endpoint paths, such as Apache Jena Fuseki which uses "/query". Changes: - Add optional `sparqlEndpointPath` to ConnectionConfig type - Use configurable path in frontend SPARQL connector instead of hardcoded "/sparql" - Pass path to proxy server via "sparql-endpoint-path" header - Use configurable path in proxy server for query execution and query cancellation - Add "SPARQL Endpoint Path" input field to connection form UI, shown when SPARQL query language is selected - Add GRAPH_EXP_SPARQL_ENDPOINT_PATH to default connection schema Closes aws#23
Collaborator
|
@stefanavesand Thank you for the contribution. It might take some time before I can give this a proper review. When I do get around to it, my team and I will need to discuss if this is the approach we want to take. In our past discussions we decided on a bigger change to the connection UI that would simplify the user experience and add this feature in a more streamlined way. So, my main concern would be to evaluate if any of the changes in this PR hinder our future plans. That would be in addition to the typical code review and manual testing for any PR. |
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.
Summary
Adds a configurable
sparqlEndpointPathfield toConnectionConfig, allowing users to specify the SPARQL query endpoint path for their triple store. Defaults to"/sparql"for full backward compatibility.Closes #23
Motivation
Graph Explorer currently hardcodes
/sparqlas the SPARQL endpoint path. This works for Amazon Neptune and Blazegraph, but many popular triple stores use different paths:/sparql/sparql/query/sparql/repositories/{repo}Without this change, users of Fuseki, GraphDB, and other non-standard-path stores cannot use Graph Explorer at all.
Changes
packages/shared/src/types/index.ts— Add optionalsparqlEndpointPathtoConnectionConfigpackages/graph-explorer/src/connector/sparql/sparqlExplorer.ts— Useconnection.sparqlEndpointPath ?? "/sparql"instead of hardcoded"/sparql"packages/graph-explorer/src/connector/fetchDatabaseRequest.ts— Forwardsparql-endpoint-pathheader to proxy when setpackages/graph-explorer-proxy-server/src/node-server.ts— Readsparql-endpoint-pathheader, default to"/sparql"packages/graph-explorer/src/modules/CreateConnection/CreateConnection.tsx— Add "SPARQL Endpoint Path" input field (shown only when SPARQL is selected)packages/graph-explorer/src/core/defaultConnection.ts— AddGRAPH_EXP_SPARQL_ENDPOINT_PATHto default connection schemaBackward compatibility
"/sparql"in both the frontend connector and the proxy serverTesting
Tested with Apache Jena Fuseki (which uses
/query) against a knowledge graph with 4.7M triples — schema synchronization, node exploration, and graph visualization all work correctly with the custom path.