Trait rdftk_core::model::data_set::DataSet [−][src]
pub trait DataSet: Debug + Featured {}Show methods
fn is_empty(&self) -> bool; fn len(&self) -> usize; fn has_default_graph(&self) -> bool; fn default_graph(&self) -> Option<&GraphRef>; fn has_graph_named(&self, name: &GraphNameRef) -> bool; fn graph_named(&self, name: &GraphNameRef) -> Option<&GraphRef>; fn graphs<'a>(
&'a self
) -> Box<dyn Iterator<Item = (&'a GraphNameRef, &'a GraphRef)> + 'a>; fn set_default_graph(&mut self, graph: GraphRef); fn unset_default_graph(&mut self); fn insert(&mut self, name: GraphNameRef, graph: GraphRef); fn remove(&mut self, name: &GraphNameRef); fn clear(&mut self); fn factory(&self) -> DataSetFactoryRef; fn graph_factory(&self) -> GraphFactoryRef;
Expand description
A DataSet
is a mapping from GraphName
to Graph
; this introduces the notion of a named graph
although in actuality the graph itself is not named as the name is the key within the data set.
Note that this trait represents an immutable data set, a type should also implement the
MutableDataSet
trait for mutation.
Required methods
fn has_default_graph(&self) -> bool
[src]
fn has_default_graph(&self) -> bool
[src]Return true
if this data set has a default graph, else false
.
fn default_graph(&self) -> Option<&GraphRef>
[src]
fn default_graph(&self) -> Option<&GraphRef>
[src]Return the default graph for this data set, if it exists.
fn has_graph_named(&self, name: &GraphNameRef) -> bool
[src]
fn has_graph_named(&self, name: &GraphNameRef) -> bool
[src]Return true
if this data set has a graph with the provided name, else false
.
fn graph_named(&self, name: &GraphNameRef) -> Option<&GraphRef>
[src]
fn graph_named(&self, name: &GraphNameRef) -> Option<&GraphRef>
[src]Return the graph with the provided name from this data set, if it exists.
Return an iterator over graph-name/graph pairs.
fn set_default_graph(&mut self, graph: GraphRef)
[src]
fn set_default_graph(&mut self, graph: GraphRef)
[src]Set the provided graph as the default, unnamed graph, for this data set. Only one graph may be the default.
fn unset_default_graph(&mut self)
[src]
fn unset_default_graph(&mut self)
[src]Remove any graph that may be set as the current default. This operation has no effect if no default graph is present.
fn insert(&mut self, name: GraphNameRef, graph: GraphRef)
[src]
fn insert(&mut self, name: GraphNameRef, graph: GraphRef)
[src]Insert a new graph with it’s associated name into the data set.
fn remove(&mut self, name: &GraphNameRef)
[src]
fn remove(&mut self, name: &GraphNameRef)
[src]Remove the graph with the provided name from this data set. This operation has no effect if no such graph is present.
fn factory(&self) -> DataSetFactoryRef
[src]
fn factory(&self) -> DataSetFactoryRef
[src]Return the factory that creates data sets using the same provider as self
.
Note that this uses Arc as a reference as factories are explicitly intended for cross-thread usage.
fn graph_factory(&self) -> GraphFactoryRef
[src]
fn graph_factory(&self) -> GraphFactoryRef
[src]Return the factory that creates graphs managed by data set’s of this kind.
Note that this uses Arc as a reference as factories are explicitly intended for cross-thread usage.