Repository navigation
[Refactor] Architecture, contracts and ergonomics audit (Part 2: Query API & Repository) (#643) - #646
Merged
remiceres merged 2 commits intoOct 23, 2026
Conversation
… contract javadoc (#643) - Add Repository shortcuts: construct() alias, mapped select(), size(), hasStatement(), and add() - Add Repositories convenience factories: createFrom(Path/Stream) and withMemory/computeWithMemory - Add Dataset.of(IRI...) and collection-based builder methods - Guarantee binding variable projection order in MaterializedResults - Formalize stream lifecycle, thread confinement, and dataset override contracts in Javadoc - Add comprehensive test coverage in RepositoriesTest, DatasetTest, and CoreseRepositoryTest
|
Test Results 418 files 418 suites 35s ⏱️ Results for commit b31de15. ♻️ This comment has been updated with latest results. |
- Enforce batch atomicity in Repository.add(Statement...) via conn.add(Iterable) - Use Collections.unmodifiableList in Repository.select mapper and document eager projection - Adopt Collection<? extends IRI> (PECS) in Dataset.Builder - Deduplicate createAndLoad in Repositories - Enforce deterministic variable projection ordering across all tuple results and binding sets - Add regression assertions in RepositoriesTest, DatasetTest, and CoreseRepositoryTest
|
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
This PR addresses Part 2 of the architecture, Single Responsibility Principle (SRP), and contracts audit on
core.next(#643), focusing on thequerymodule, repository ergonomics, and execution contracts.Key Changes
1. Repository Ergonomics & Shortcuts (
Repository.java,Repositories.java)construct(String sparqlConstruct)as a direct alias forgraph(sparqlConstruct)aligning with standard SPARQL 1.1 terminology.select(String, Function<BindingSet, T>)to map solutions to objects/strings directly without managing manual cursor loops.size(Resource...),hasStatement(Resource, IRI, Value, Resource...), andadd(Statement...)onRepositorywith automatic connection lifecycle management.Repositories.createFrom(Path)andRepositories.createFrom(InputStream, RDFFormat)for quick testing and loading.Repositories.withMemory(Consumer)andRepositories.computeWithMemory(Function)guaranteeing deterministic repository closure.2. Dataset Factory & Builder Enhancements (
Dataset.java)Dataset.of(IRI... defaultGraphs).defaultGraphs(Collection<IRI>)andnamedGraphs(Collection<IRI>).Dataset.empty()(empty override) and passingnull(resetting to query text clauses).3. Materialized Result Integrity & Thread Safety (
MaterializedResults.java)Map.copyOfwithCollections.unmodifiableMap(new LinkedHashMap<>(values))inImmutableBindingSet.volatile boolean closedinTupleResultandGraphResult.4. Stream & Concurrency Lifecycle Documentation
stream()lifecycle inTupleQueryResult: explicit documentation that closing the stream triggersclose(), while terminal stream operations do not auto-close.query,query.api,query.api.repository,query.api.result, andquery.api.dataset.Verification & Quality
core.next.query.*andNextModuleBoundaryTest.Part of #643