pub struct MergedView {
pub name: String,
/* private fields */
}Expand description
Merges a default graph with one or more named graphs.
The result presents all triples from the default graph plus those from
the named graphs. The default graph takes priority: if a triple appears
in both the default graph and a named graph, only the default version is
returned when deduplicate is true.
Fields§
§name: StringName for this merged view.
Implementations§
Source§impl MergedView
impl MergedView
Sourcepub fn new(
name: &str,
default_graph: GraphView,
named_graphs: Vec<GraphView>,
deduplicate: bool,
) -> Self
pub fn new( name: &str, default_graph: GraphView, named_graphs: Vec<GraphView>, deduplicate: bool, ) -> Self
Create a new merged view from a default graph and a set of named graphs.
Sourcepub fn add_named_graph(&mut self, graph: GraphView)
pub fn add_named_graph(&mut self, graph: GraphView)
Add a named graph to the merge.
Sourcepub fn materialize(&mut self) -> &[RdfTriple]
pub fn materialize(&mut self) -> &[RdfTriple]
Materialize the merged result into a cached Vec<RdfTriple>.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Invalidate the materialization cache.
Sourcepub fn find(
&self,
subject: Option<&str>,
predicate: Option<&str>,
object: Option<&str>,
) -> Vec<RdfTriple>
pub fn find( &self, subject: Option<&str>, predicate: Option<&str>, object: Option<&str>, ) -> Vec<RdfTriple>
Find triples matching a pattern across default + named graphs.
pub fn is_empty(&self) -> bool
Sourcepub fn source_summary(&self) -> HashMap<String, usize>
pub fn source_summary(&self) -> HashMap<String, usize>
Summary of how many triples come from each source.
Trait Implementations§
Source§impl Clone for MergedView
impl Clone for MergedView
Source§fn clone(&self) -> MergedView
fn clone(&self) -> MergedView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MergedView
impl RefUnwindSafe for MergedView
impl Send for MergedView
impl Sync for MergedView
impl Unpin for MergedView
impl UnsafeUnpin for MergedView
impl UnwindSafe for MergedView
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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