pub struct StreamingRdfLoader { /* private fields */ }Expand description
Streaming RDF loader for memory-efficient processing.
This loader processes RDF data in chunks, allowing you to handle large datasets without loading everything into memory.
Implementations§
Source§impl StreamingRdfLoader
impl StreamingRdfLoader
Sourcepub fn with_batch_size(self, size: usize) -> Self
pub fn with_batch_size(self, size: usize) -> Self
Set the batch size for chunked processing.
Larger batches are more efficient but use more memory. Default is 1000 triples per batch.
Sourcepub fn on_triple<F>(self, handler: F) -> Self
pub fn on_triple<F>(self, handler: F) -> Self
Set a handler for individual triples.
The handler receives (subject, predicate, object) as strings.
Sourcepub fn on_batch<F>(self, handler: F) -> Self
pub fn on_batch<F>(self, handler: F) -> Self
Set a handler for triple batches.
The handler receives a slice of Triple objects.
Sourcepub fn on_progress<F>(self, handler: F) -> Self
pub fn on_progress<F>(self, handler: F) -> Self
Set a handler for progress updates.
The handler is called every progress_interval triples.
Sourcepub fn with_progress_interval(self, interval: usize) -> Self
pub fn with_progress_interval(self, interval: usize) -> Self
Set the interval for progress updates.
Default is every 10000 triples.
Sourcepub fn collect_into_graph(self) -> Self
pub fn collect_into_graph(self) -> Self
Enable collecting triples into a graph.
This is useful when you need the complete graph after streaming. Note: This increases memory usage.
Sourcepub fn filter_predicates(self, predicates: Vec<String>) -> Self
pub fn filter_predicates(self, predicates: Vec<String>) -> Self
Filter to only process triples with specific predicates.
Sourcepub fn filter_subject_prefix(self, prefix: String) -> Self
pub fn filter_subject_prefix(self, prefix: String) -> Self
Filter to only process triples whose subject starts with a prefix.
Sourcepub fn process_turtle(
&mut self,
data: &str,
) -> Result<(StreamStats, Option<Graph>)>
pub fn process_turtle( &mut self, data: &str, ) -> Result<(StreamStats, Option<Graph>)>
Process Turtle data from a string.
Sourcepub fn process_turtle_reader<R: BufRead>(
&mut self,
reader: R,
) -> Result<(StreamStats, Option<Graph>)>
pub fn process_turtle_reader<R: BufRead>( &mut self, reader: R, ) -> Result<(StreamStats, Option<Graph>)>
Process Turtle data from a reader.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingRdfLoader
impl !RefUnwindSafe for StreamingRdfLoader
impl Send for StreamingRdfLoader
impl !Sync for StreamingRdfLoader
impl Unpin for StreamingRdfLoader
impl !UnwindSafe for StreamingRdfLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more