Investigate alternative SPARQL queries for schema sync performance
- 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
Assessment
This issue has not been assessed yet.