Skip to content

fix(sparql-anything): concatenate outputs without blank lines or listener leaks - #833

Open
ddeboer wants to merge 1 commit into
mainfrom
fix/concatenate-no-blank-lines
Open

fix(sparql-anything): concatenate outputs without blank lines or listener leaks#833
ddeboer wants to merge 1 commit into
mainfrom
fix/concatenate-no-blank-lines

Conversation

@ddeboer

@ddeboer ddeboer commented Sep 8, 2026

Copy link
Copy Markdown
Member

Two fixes to concatenate() in SparqlAnythingConverter:

  • No blank line between outputs. The newline between two per-chunk outputs is now written only when the previous one does not end in one, tracked from the last byte written. SPARQL Anything’s N-Triples writer always ends in a newline, so the unconditional separator put a blank line at every chunk boundary, and the result differed from what cat gives. Consumers that stripped blank lines before diffing against a shell run can drop that.
  • No listener leak past ten chunks. Every output ran its own pipeline() into one shared write stream, and each left its listeners on it, so Node printed MaxListenersExceededWarning for runs of more than ten chunks. The outputs now feed one pipeline through an async generator, which also gives a single error path.

Tests cover both: outputs ending in a newline concatenate byte for byte to their joined contents, an output without one still gets a newline before the next, and twelve chunks emit no process warning. The docs section on how a conversion runs describes the new behaviour.

Fix #821

…ener leaks

- Write the newline between two per-chunk outputs only when the previous
  one does not end in one, so the result is byte for byte what `cat`
  gives; SPARQL Anything’s N-Triples writer always ends in a newline, so
  every boundary carried a blank line.
- Run one pipeline over every output rather than one per output into a
  shared write stream, which left listeners behind per file and had Node
  warn of a leak past ten chunks.
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.

sparql-anything: concatenate() writes a blank line between every two outputs

1 participant