[][src]Trait grdf::Dataset

pub trait Dataset<T = Term> {
    type Graph: Graph<T>;
    type Graphs: Iterator<Item = (Option<&'a T>, &'a Self::Graph)>;
    type Quads: Iterator<Item = Quad<&'a T>>;
    fn graph(&self, id: Option<&T>) -> Option<&Self::Graph>;
fn graphs<'a>(&'a self) -> Self::Graphs;
fn quads<'a>(&'a self) -> Self::Quads; fn default_graph(&self) -> &Self::Graph { ... }
fn subjects<'a>(
        &'a self,
        id: Option<&T>
    ) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Subjects> { ... }
fn predicates<'a>(
        &'a self,
        id: Option<&T>,
        subject: &T
    ) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Predicates> { ... }
fn objects<'a>(
        &'a self,
        id: Option<&T>,
        subject: &T,
        predicate: &T
    ) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Objects> { ... } }

gRDF dataset.

A dataset is a collection of graphs. It is made of a default graph and a collection of named graphs.

A dataset can also be seen as a collection of Quads.

Associated Types

type Graph: Graph<T>

Type of graphs in the dataset.

type Graphs: Iterator<Item = (Option<&'a T>, &'a Self::Graph)>

Graph iterator.

Each graph is associated to its name (if any).

type Quads: Iterator<Item = Quad<&'a T>>

Quads iterator.

Loading content...

Required methods

fn graph(&self, id: Option<&T>) -> Option<&Self::Graph>

Get the graph with the given name. Input None to get the default graph.

Note to implementors: the default graph should always exists.

fn graphs<'a>(&'a self) -> Self::Graphs

Returns an iterator over the graphs of the dataset.

fn quads<'a>(&'a self) -> Self::Quads

Returns an iterator over the quads of the dataset.

Loading content...

Provided methods

fn default_graph(&self) -> &Self::Graph

Get the default graph of the dataset.

This is the same as graph(None).

Note to implementors: the default graph should always exists.

fn subjects<'a>(
    &'a self,
    id: Option<&T>
) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Subjects>

Iterate through all the subjects of the given graph.

fn predicates<'a>(
    &'a self,
    id: Option<&T>,
    subject: &T
) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Predicates>

Iterate through all the predicates of the given subject of the given graph.

fn objects<'a>(
    &'a self,
    id: Option<&T>,
    subject: &T,
    predicate: &T
) -> Option<<<Self::Graph as Graph<T>>::Iter as Iter<'a, T>>::Objects>

Iterate through all the objects of the given subect and predicate of the given graph.

Loading content...

Implementors

impl<T: 'static + Hash + Eq> Dataset<T> for HashDataset<T>[src]

type Graph = HashGraph<T>

type Graphs = Graphs<'a, T>

type Quads = Quads<'a, T>

Loading content...