[][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>>;
    pub fn graph(&self, id: Option<&T>) -> Option<&Self::Graph>;
pub fn graphs<'a>(&'a self) -> Self::Graphs;
pub fn quads<'a>(&'a self) -> Self::Quads; pub fn default_graph(&self) -> &Self::Graph { ... }
pub fn subjects<'a>(
        &'a self,
        id: Option<&T>
    ) -> Option<<Self::Graph as Graph<T>>::Subjects>
    where
        Self::Graph: 'a,
        T: 'a
, { ... }
pub fn predicates<'a>(
        &'a self,
        id: Option<&T>,
        subject: &T
    ) -> Option<<Self::Graph as Graph<T>>::Predicates>
    where
        Self::Graph: 'a,
        T: 'a
, { ... }
pub fn objects<'a>(
        &'a self,
        id: Option<&T>,
        subject: &T,
        predicate: &T
    ) -> Option<<Self::Graph as Graph<T>>::Objects>
    where
        Self::Graph: 'a,
        T: 'a
, { ... } }

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>[src]

Type of graphs in the dataset.

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

Graph iterator.

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

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

Quads iterator.

Loading content...

Required methods

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

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

Note to implementors: the default graph should always exists.

pub fn graphs<'a>(&'a self) -> Self::Graphs[src]

Returns an iterator over the graphs of the dataset.

pub fn quads<'a>(&'a self) -> Self::Quads[src]

Returns an iterator over the quads of the dataset.

Loading content...

Provided methods

pub fn default_graph(&self) -> &Self::Graph[src]

Get the default graph of the dataset.

This is the same as graph(None).

Note to implementors: the default graph should always exists.

pub fn subjects<'a>(
    &'a self,
    id: Option<&T>
) -> Option<<Self::Graph as Graph<T>>::Subjects> where
    Self::Graph: 'a,
    T: 'a, 
[src]

Iterate through all the subjects of the given graph.

pub fn predicates<'a>(
    &'a self,
    id: Option<&T>,
    subject: &T
) -> Option<<Self::Graph as Graph<T>>::Predicates> where
    Self::Graph: 'a,
    T: 'a, 
[src]

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

pub fn objects<'a>(
    &'a self,
    id: Option<&T>,
    subject: &T,
    predicate: &T
) -> Option<<Self::Graph as Graph<T>>::Objects> where
    Self::Graph: 'a,
    T: 'a, 
[src]

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...