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

Returns true if there are no graphs in this data set, else false.

Return the number of graphs in this data set.

Return true if this data set has a default graph, else false.

Return the default graph for this data set, if it exists.

Return true if this data set has a graph with the provided name, else false.

Return the graph with the provided name from this data set, if it exists.

Return an iterator over graph-name/graph pairs.

Set the provided graph as the default, unnamed graph, for this data set. Only one graph may be the default.

Remove any graph that may be set as the current default. This operation has no effect if no default graph is present.

Insert a new graph with it’s associated name into the data set.

Remove the graph with the provided name from this data set. This operation has no effect if no such graph is present.

Remove all graphs from this data set.

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.

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.

Implementors