pub struct GraphView<'a> { /* private fields */ }
Expand description
A read-only view on an RDF graph contained in a Dataset
.
It is built using the Dataset::graph
method.
Usage example:
use oxrdf::*;
let mut dataset = Dataset::default();
let ex = NamedNodeRef::new("http://example.com")?;
dataset.insert(QuadRef::new(ex, ex, ex, ex));
let results: Vec<_> = dataset.graph(ex).iter().collect();
assert_eq!(vec![TripleRef::new(ex, ex, ex)], results);
Implementations§
Source§impl<'a> GraphView<'a>
impl<'a> GraphView<'a>
Sourcepub fn iter(&self) -> GraphViewIter<'a> ⓘ
pub fn iter(&self) -> GraphViewIter<'a> ⓘ
Returns all the triples contained by the graph.
pub fn triples_for_subject<'b>( &self, subject: impl Into<NamedOrBlankNodeRef<'b>>, ) -> impl Iterator<Item = TripleRef<'a>> + 'a
pub fn objects_for_subject_predicate<'b>( &self, subject: impl Into<NamedOrBlankNodeRef<'b>>, predicate: impl Into<NamedNodeRef<'b>>, ) -> impl Iterator<Item = TermRef<'a>> + 'a
pub fn object_for_subject_predicate<'b>( &self, subject: impl Into<NamedOrBlankNodeRef<'b>>, predicate: impl Into<NamedNodeRef<'b>>, ) -> Option<TermRef<'a>>
pub fn predicates_for_subject_object<'b>( &self, subject: impl Into<NamedOrBlankNodeRef<'b>>, object: impl Into<TermRef<'b>>, ) -> impl Iterator<Item = NamedNodeRef<'a>> + 'a
pub fn triples_for_predicate<'b>( &self, predicate: impl Into<NamedNodeRef<'b>>, ) -> impl Iterator<Item = TripleRef<'a>> + 'a
pub fn subjects_for_predicate_object<'b>( &self, predicate: impl Into<NamedNodeRef<'b>>, object: impl Into<TermRef<'b>>, ) -> impl Iterator<Item = NamedOrBlankNodeRef<'a>> + 'a
pub fn subject_for_predicate_object<'b>( &self, predicate: impl Into<NamedNodeRef<'b>>, object: impl Into<TermRef<'b>>, ) -> Option<NamedOrBlankNodeRef<'a>>
pub fn triples_for_object<'b>( &self, object: impl Into<TermRef<'b>>, ) -> impl Iterator<Item = TripleRef<'a>> + 'a
Trait Implementations§
Source§impl<'a> IntoIterator for &GraphView<'a>
impl<'a> IntoIterator for &GraphView<'a>
Source§impl<'a> IntoIterator for GraphView<'a>
impl<'a> IntoIterator for GraphView<'a>
Auto Trait Implementations§
impl<'a> Freeze for GraphView<'a>
impl<'a> RefUnwindSafe for GraphView<'a>
impl<'a> Send for GraphView<'a>
impl<'a> Sync for GraphView<'a>
impl<'a> Unpin for GraphView<'a>
impl<'a> UnwindSafe for GraphView<'a>
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> 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