Trait rdftk_core::data_set::DataSet [−][src]
pub trait DataSet {}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 has_index(&self, index: &DataSetIndex) -> bool; 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 has_indices(&self, indices: &[DataSetIndex]) -> bool { ... }
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 is_empty(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]Returns true
if there are no graphs in this data set, else false
.
fn len(&self) -> usize
[src]
fn len(&self) -> usize
[src]Return the number of graphs in this data set.
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.
fn graphs<'a>(
&'a self
) -> Box<dyn Iterator<Item = (&'a GraphNameRef, &'a GraphRef)> + 'a>
[src]
fn graphs<'a>(
&'a self
) -> Box<dyn Iterator<Item = (&'a GraphNameRef, &'a GraphRef)> + 'a>
[src]Return an iterator over graph name/graph pairs.
fn has_index(&self, index: &DataSetIndex) -> bool
[src]
fn has_index(&self, index: &DataSetIndex) -> bool
[src]Returns true
if this data set has an index of the specified kind, else false
.
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 clear(&mut self)
[src]
fn clear(&mut self)
[src]Remove all graphs from this data set.
fn factory(&self) -> DataSetFactoryRef
[src]
fn factory(&self) -> DataSetFactoryRef
[src]Return the factory that creates data sets of this kind.
Note that this uses Arc as a reference as factories are explicitly intended for cross-thread usage.
Provided methods
fn has_indices(&self, indices: &[DataSetIndex]) -> bool
[src]
fn has_indices(&self, indices: &[DataSetIndex]) -> bool
[src]Returns true
if this data set has *all the specified index kinds, else false
.