Skip to main content

stream_reader

Function stream_reader 

Source
pub fn stream_reader<R: BufRead>(
    reader: R,
    format: &str,
    f: &mut dyn FnMut(RawQuad),
) -> Result<(), IngestError>
Expand description

Stream N-Triples ("nt") / N-Quads ("nq") from a reader, invoking f once per parsed quad — like parse_reader but without collecting into a Vec. Each quad’s term Strings are owned by f (and dropped when it returns if it doesn’t retain them), so a caller that only needs to observe every term — e.g. the two-pass assemble_dataset_streaming building its dictionary — never materializes the whole quad multiset. The big-graph, low-RAM ingest primitive. Blank/comment lines are skipped; a parse error stops the stream and is returned.