Skip to content

feat(pipeline): add Writer flush and dataset selection duration#183

Closed
ddeboer wants to merge 2 commits intomainfrom
feat/writer-flush-prefixes
Closed

feat(pipeline): add Writer flush and dataset selection duration#183
ddeboer wants to merge 2 commits intomainfrom
feat/writer-flush-prefixes

Conversation

@ddeboer
Copy link
Member

@ddeboer ddeboer commented Mar 2, 2026

Summary

  • Add flush() lifecycle method to Writer interface, called after all stages for a dataset complete
  • Add Turtle prefix support to FileWriter: when format is turtle, automatically writes @prefix declarations at the top of output files
  • Measure dataset selection duration in Pipeline.run() and report it via ProgressReporter.datasetsSelected()
  • Display selection duration in ConsoleReporter using prettyMilliseconds()

Test plan

  • npx nx run-many -t typecheck -p pipeline pipeline-console-reporter passes
  • npx nx run-many -t test -p pipeline pipeline-console-reporter passes (161 + 1 tests)
  • npx nx run-many -t lint -p pipeline pipeline-console-reporter passes

ddeboer added 2 commits March 2, 2026 11:38
…leWriter

- Add optional flush(dataset) method to Writer interface for finalizing
  output after all stages complete
- Replace per-write() N3Writer in FileWriter with a lazy per-dataset
  approach: a single N3Writer stays open across write() calls so Turtle
  prefixes are declared once and triples can be grouped by subject
- Add prefixes option to FileWriterOptions, passed through to N3Writer
- Propagate flush() through FanOutWriter and TransformWriter
- Call flush() in Pipeline.processDataset() after stages, before
  datasetComplete
- Add tests for prefix output, single-prefix-block across writes,
  flush-without-write no-op, and per-dataset flush calls in Pipeline
- Add `duration` parameter to `ProgressReporter.datasetsSelected()`
- Measure selection time in `Pipeline.run()` and call `datasetsSelected()`
- Display duration in `ConsoleReporter` using `prettyMilliseconds()`
@ddeboer ddeboer closed this Mar 2, 2026
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.

1 participant