pub struct GraphView {
pub name: String,
pub base_iri: Option<String>,
/* private fields */
}Expand description
A read-only, named view over a set of RDF triples.
Conceptually represents a named graph in an RDF dataset. The view holds an owned snapshot of the triples (or references to an external store via index).
Fields§
§name: StringName / IRI of this graph view.
base_iri: Option<String>Optional base IRI for relative IRI resolution.
Implementations§
Source§impl GraphView
impl GraphView
Sourcepub fn new(name: &str, triples: Vec<RdfTriple>) -> Self
pub fn new(name: &str, triples: Vec<RdfTriple>) -> Self
Create a new named graph view with the given triples.
Sourcepub fn with_base_iri(self, base: &str) -> Self
pub fn with_base_iri(self, base: &str) -> Self
Set the base IRI for this view.
pub fn is_empty(&self) -> bool
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 all triples matching the given triple pattern. None = wildcard.
Sourcepub fn predicates(&self) -> Vec<&str>
pub fn predicates(&self) -> Vec<&str>
All distinct predicates in this view.
Sourcepub fn filter(
&self,
subject: Option<String>,
predicate: Option<String>,
object: Option<String>,
) -> FilteredView
pub fn filter( &self, subject: Option<String>, predicate: Option<String>, object: Option<String>, ) -> FilteredView
Create a FilteredView over this view.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphView
impl RefUnwindSafe for GraphView
impl Send for GraphView
impl Sync for GraphView
impl Unpin for GraphView
impl UnsafeUnpin for GraphView
impl UnwindSafe for GraphView
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