Skip to content

feat: make SPARQL endpoint path configurable#1617

Open
stefanavesand wants to merge 1 commit intoaws:mainfrom
stefanavesand:configurable-sparql-endpoint-path
Open

feat: make SPARQL endpoint path configurable#1617
stefanavesand wants to merge 1 commit intoaws:mainfrom
stefanavesand:configurable-sparql-endpoint-path

Conversation

@stefanavesand
Copy link
Copy Markdown

Summary

Adds a configurable sparqlEndpointPath field to ConnectionConfig, 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 /sparql as the SPARQL endpoint path. This works for Amazon Neptune and Blazegraph, but many popular triple stores use different paths:

Triple Store SPARQL Path
Amazon Neptune /sparql
Blazegraph /sparql
Apache Jena Fuseki /query
Virtuoso /sparql
GraphDB /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 optional sparqlEndpointPath to ConnectionConfig
  • packages/graph-explorer/src/connector/sparql/sparqlExplorer.ts — Use connection.sparqlEndpointPath ?? "/sparql" instead of hardcoded "/sparql"
  • packages/graph-explorer/src/connector/fetchDatabaseRequest.ts — Forward sparql-endpoint-path header to proxy when set
  • packages/graph-explorer-proxy-server/src/node-server.ts — Read sparql-endpoint-path header, 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 — Add GRAPH_EXP_SPARQL_ENDPOINT_PATH to default connection schema

Backward compatibility

  • The field is optional everywhere — existing connections without it behave identically to before
  • Default value is "/sparql" in both the frontend connector and the proxy server
  • The UI field only appears when SPARQL query language is selected
  • No changes to Gremlin or OpenCypher paths

Testing

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.

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
@kmcginnes
Copy link
Copy Markdown
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.

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.

Remove default '/sparql' path from non-Neptune SPARQL requests

3 participants