Skip to main content

parse_reader

Function parse_reader 

Source
pub fn parse_reader<R: BufRead>(
    reader: R,
    format: &str,
    cap: usize,
) -> Result<Vec<RawQuad>, IngestError>
Expand description

Stream-parse N-Triples ("nt") or N-Quads ("nq") from a reader, one line at a time, so the whole input text is never resident — the big-build memory win over reading the file into a String first (each line String is transient, freed every iteration). cap pre-sizes the output Vec (e.g. file_len / 64) to avoid reallocation doublings of the large spine. Turtle is not streamable here (oxttl needs the whole input); callers use the text path for "ttl".