pub struct Quad { /* private fields */ }
Expand description
An RDF Quad
Represents an RDF statement with subject, predicate, object, and graph name. This is used in RDF datasets where triples can belong to different named graphs.
Implementations§
Source§impl Quad
impl Quad
Sourcepub fn new(
subject: impl Into<Subject>,
predicate: impl Into<Predicate>,
object: impl Into<Object>,
graph_name: impl Into<GraphName>,
) -> Self
pub fn new( subject: impl Into<Subject>, predicate: impl Into<Predicate>, object: impl Into<Object>, graph_name: impl Into<GraphName>, ) -> Self
Creates a new quad
Sourcepub fn new_default_graph(
subject: impl Into<Subject>,
predicate: impl Into<Predicate>,
object: impl Into<Object>,
) -> Self
pub fn new_default_graph( subject: impl Into<Subject>, predicate: impl Into<Predicate>, object: impl Into<Object>, ) -> Self
Creates a new quad in the default graph
Sourcepub fn from_triple(triple: Triple) -> Self
pub fn from_triple(triple: Triple) -> Self
Creates a quad from a triple, placing it in the default graph
Sourcepub fn from_triple_in_graph(
triple: Triple,
graph_name: impl Into<GraphName>,
) -> Self
pub fn from_triple_in_graph( triple: Triple, graph_name: impl Into<GraphName>, ) -> Self
Creates a quad from a triple with a specific graph name
Sourcepub fn graph_name(&self) -> &GraphName
pub fn graph_name(&self) -> &GraphName
Returns the graph name of this quad
Sourcepub fn into_parts(self) -> (Subject, Predicate, Object, GraphName)
pub fn into_parts(self) -> (Subject, Predicate, Object, GraphName)
Decomposes the quad into its components
Sourcepub fn is_default_graph(&self) -> bool
pub fn is_default_graph(&self) -> bool
Returns true if this quad is in the default graph
Sourcepub fn triple_in_default_graph(&self) -> Option<Triple>
pub fn triple_in_default_graph(&self) -> Option<Triple>
Returns the triple if this quad is in the default graph, None otherwise
Sourcepub fn has_variables(&self) -> bool
pub fn has_variables(&self) -> bool
Returns true if this quad contains any variables
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Quad
impl<'de> Deserialize<'de> for Quad
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Extend<Quad> for Dataset
impl Extend<Quad> for Dataset
Source§fn extend<T: IntoIterator<Item = Quad>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Quad>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Quad> for Dataset
impl FromIterator<Quad> for Dataset
Source§impl Ord for Quad
impl Ord for Quad
Source§impl PartialOrd for Quad
impl PartialOrd for Quad
impl Eq for Quad
impl StructuralPartialEq for Quad
Auto Trait Implementations§
impl Freeze for Quad
impl RefUnwindSafe for Quad
impl Send for Quad
impl Sync for Quad
impl Unpin for Quad
impl UnwindSafe for Quad
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.