aws / aws/graph-explorer

Investigate alternative SPARQL queries for schema sync performance

Open
#1,604 0 comments 0 reactions 0 assignees View on GitHub
fundamental performance schema sparql
Dominant language
TypeScript
Stars
481
Forks
108
Avg merge
6d 8h
Merged PRs (30d)
5

Description

## Goal

Investigate whether an alternative SPARQL query strategy — discovering predicates, classes, and class-predicate-class triples separately — would perform better than our current schema sync queries on medium and very large datasets.

The suggested approach is:

1. Discover all predicates: `SELECT DISTINCT ?p { GRAPH ?g { ?s ?p ?o } }` (cheap with GPSO index)
2. Discover all classes: `SELECT DISTINCT ?c { GRAPH ?g { ?s a ?c } }` (uses POGS index, should also be cheap)
3. For each combination of class and predicate, verify the connection: `ASK { GRAPH ?g { ?from a C1 . ?to a C2 . ?from P ?to } }`

This strategy relies on index-friendly access patterns (GPSO, POGS) and breaks the schema discovery into smaller, targeted queries rather than larger aggregate ones.

## Expected Outcome

- Performance comparison of the suggested queries vs. our current schema sync queries on medium and very large SPARQL datasets
- Determination of whether these queries return all the information we currently need (vertex types, edge types, predicates, property types, counts, etc.) or if additional queries are required to fill gaps
- A recommendation on whether to adopt this approach, adapt parts of it, or keep the current strategy

## Related Issues

- Part of #354
- Related to #381

---

> [!IMPORTANT]
> If you are interested in working on this issue, please leave a comment.

> [!TIP]
> Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.