Skip to content

feat(repository): add streamed RDF import/export and functional transactions - #630

Merged
abdessamad-abdoun merged 3 commits into
feature/indexed-memory-storagefrom
feature/repository-io-transactions
Oct 15, 2026
Merged

abdessamad-abdoun merged 3 commits into
feature/indexed-memory-storagefrom
feature/repository-io-transactions

Conversation

@remiceres

Copy link
Copy Markdown
Contributor

Important: Please review and merge the Storage PR (#629) first before this PR. This branch is based on top of #629.

Summary

This PR enriches the public Repository API with direct RDF loading and exporting capabilities, introduces functional transaction helpers (inTransaction / computeInTransaction), and implements progressive line-by-line parsing for N-Triples and N-Quads to bound input memory on large datasets.

Key Changes

  • Direct RDF Import (load): Adds overloaded load() methods on Repository and RepositoryConnection accepting Path, InputStream, or Reader, with automatic format detection via file extension.
  • Progressive Streaming Parsers: Implements LineRDFParser for N-Triples and N-Quads, reusing ANTLR lexer/parser across lines so temporary memory is bounded by line size rather than document size.
  • Functional Transactions: Adds inTransaction(Consumer) and computeInTransaction(Function) with automatic commit and rollback, capturing secondary rollback failures via addSuppressed.
  • Direct RDF Export (export): Adds safe export to Path, OutputStream, or Writer, preventing silent data loss by rejecting named graphs when targeting formats that only support default graphs (e.g. Turtle).
  • Validation: 3,178 unit tests passing (100%), 0 SonarLint issues on all modified/new Java files, reference memory at 600k statements unchanged (90,827,088 bytes).

@remiceres remiceres added feature New feature or capability refactoring Internal code restructuring and architecture cleanup labels Oct 15, 2026
@remiceres remiceres self-assigned this Oct 15, 2026
@abdessamad-abdoun
abdessamad-abdoun merged commit f4f336b into feature/indexed-memory-storage Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or capability refactoring Internal code restructuring and architecture cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants