[][src]Trait sophia::dataset::Dataset

pub trait Dataset<'a> {
    type Quad: Quad<'a>;
    type Error: CoercibleWith<Error> + CoercibleWith<Never>;
    fn quads(&'a self) -> DQuadSource<'a, Self>;

    fn quads_with_s<T>(&'a self, s: &'a Term<T>) -> DQuadSource<'a, Self>
    where
        T: TermData
, { ... }
fn quads_with_p<T>(&'a self, p: &'a Term<T>) -> DQuadSource<'a, Self>
    where
        T: TermData
, { ... }
fn quads_with_o<T>(&'a self, o: &'a Term<T>) -> DQuadSource<'a, Self>
    where
        T: TermData
, { ... }
fn quads_with_g<T>(
        &'a self,
        g: Option<&'a Term<T>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData
, { ... }
fn quads_with_sp<T, U>(
        &'a self,
        s: &'a Term<T>,
        p: &'a Term<U>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_so<T, U>(
        &'a self,
        s: &'a Term<T>,
        o: &'a Term<U>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_sg<T, U>(
        &'a self,
        s: &'a Term<T>,
        g: Option<&'a Term<U>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_po<T, U>(
        &'a self,
        p: &'a Term<T>,
        o: &'a Term<U>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_pg<T, U>(
        &'a self,
        p: &'a Term<T>,
        g: Option<&'a Term<U>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_og<T, U>(
        &'a self,
        o: &'a Term<T>,
        g: Option<&'a Term<U>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData
, { ... }
fn quads_with_spo<T, U, V>(
        &'a self,
        s: &'a Term<T>,
        p: &'a Term<U>,
        o: &'a Term<V>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData,
        V: TermData
, { ... }
fn quads_with_spg<T, U, V>(
        &'a self,
        s: &'a Term<T>,
        p: &'a Term<U>,
        g: Option<&'a Term<V>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData,
        V: TermData
, { ... }
fn quads_with_sog<T, U, V>(
        &'a self,
        s: &'a Term<T>,
        o: &'a Term<U>,
        g: Option<&'a Term<V>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData,
        V: TermData
, { ... }
fn quads_with_pog<T, U, V>(
        &'a self,
        p: &'a Term<T>,
        o: &'a Term<U>,
        g: Option<&'a Term<V>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData,
        V: TermData
, { ... }
fn quads_with_spog<T, U, V, W>(
        &'a self,
        s: &'a Term<T>,
        p: &'a Term<U>,
        o: &'a Term<V>,
        g: Option<&'a Term<W>>
    ) -> DQuadSource<'a, Self>
    where
        T: TermData,
        U: TermData,
        V: TermData,
        W: TermData
, { ... }
fn contains<T, U, V, W>(
        &'a self,
        s: &'a Term<T>,
        p: &'a Term<U>,
        o: &'a Term<V>,
        g: Option<&'a Term<W>>
    ) -> DResult<'a, Self, bool>
    where
        T: TermData,
        U: TermData,
        V: TermData,
        W: TermData
, { ... }
fn quads_matching<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
        &'a self,
        ms: &'a S,
        mp: &'a P,
        mo: &'a O,
        mg: &'a G
    ) -> DQuadSource<'a, Self>
    where
        S: TermMatcher,
        P: TermMatcher,
        O: TermMatcher,
        G: GraphNameMatcher
, { ... }
fn subjects(&'a self) -> DResultTermSet<'a, Self> { ... }
fn predicates(&'a self) -> DResultTermSet<'a, Self> { ... }
fn objects(&'a self) -> DResultTermSet<'a, Self> { ... }
fn graph_names(&'a self) -> DResultTermSet<'a, Self> { ... }
fn iris(&'a self) -> DResultTermSet<'a, Self> { ... }
fn bnodes(&'a self) -> DResultTermSet<'a, Self> { ... }
fn literals(&'a self) -> DResultTermSet<'a, Self> { ... }
fn variables(&'a self) -> DResultTermSet<'a, Self> { ... }
fn graph<T>(
        &self,
        graph_name: Option<&Term<T>>
    ) -> DatasetGraph<Self, &Self, Option<BoxTerm>>
    where
        T: TermData
, { ... }
fn graph_mut<T>(
        &mut self,
        graph_name: Option<&Term<T>>
    ) -> DatasetGraph<Self, &mut Self, Option<BoxTerm>>
    where
        T: TermData
, { ... }
fn union_graph<T>(&'a self, gmatcher: T) -> DatasetGraph<Self, &Self, T>
    where
        T: GraphNameMatcher
, { ... } }

Generic trait for RDF datasets.

For convenience, this trait is implemented by standard collections of quads.

NB: the semantics of this trait allows a dataset to contain duplicate quads; see also SetDataset.

How to use Dataset in a trait bound?

The same rules as for Graph apply.

Associated Types

type Quad: Quad<'a>

The type of Quads that the methods of this dataset will yield.

type Error: CoercibleWith<Error> + CoercibleWith<Never>

The error type that this dataset may raise.

Must be either Never (for infallible datasets) or Error.

Loading content...

Required methods

fn quads(&'a self) -> DQuadSource<'a, Self>

An iterator visiting all quads of this dataset in arbitrary order.

This iterator is fallible: its items are Results, an error may occur at any time during the iteration.

Loading content...

Provided methods

fn quads_with_s<T>(&'a self, s: &'a Term<T>) -> DQuadSource<'a, Self> where
    T: TermData

An iterator visiting all quads with the given subject.

See also quads.

fn quads_with_p<T>(&'a self, p: &'a Term<T>) -> DQuadSource<'a, Self> where
    T: TermData

An iterator visiting all quads with the given predicate.

See also quads.

fn quads_with_o<T>(&'a self, o: &'a Term<T>) -> DQuadSource<'a, Self> where
    T: TermData

An iterator visiting add quads with the given object.

See also quads.

fn quads_with_g<T>(&'a self, g: Option<&'a Term<T>>) -> DQuadSource<'a, Self> where
    T: TermData

An iterator visiting add quads with the given graph name.

See also quads.

fn quads_with_sp<T, U>(
    &'a self,
    s: &'a Term<T>,
    p: &'a Term<U>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given subject and predicate.

See also quads.

fn quads_with_so<T, U>(
    &'a self,
    s: &'a Term<T>,
    o: &'a Term<U>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given subject and object.

See also quads.

fn quads_with_sg<T, U>(
    &'a self,
    s: &'a Term<T>,
    g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given subject and graph name.

See also quads.

fn quads_with_po<T, U>(
    &'a self,
    p: &'a Term<T>,
    o: &'a Term<U>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given predicate and object.

See also quads.

fn quads_with_pg<T, U>(
    &'a self,
    p: &'a Term<T>,
    g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given predicate and graph name.

See also quads.

fn quads_with_og<T, U>(
    &'a self,
    o: &'a Term<T>,
    g: Option<&'a Term<U>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData

An iterator visiting add quads with the given object and graph name.

See also quads.

fn quads_with_spo<T, U, V>(
    &'a self,
    s: &'a Term<T>,
    p: &'a Term<U>,
    o: &'a Term<V>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData,
    V: TermData

An iterator visiting add quads with the given subject, predicate and object.

See also quads.

fn quads_with_spg<T, U, V>(
    &'a self,
    s: &'a Term<T>,
    p: &'a Term<U>,
    g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData,
    V: TermData

An iterator visiting add quads with the given subject, predicate and graph name.

See also quads.

fn quads_with_sog<T, U, V>(
    &'a self,
    s: &'a Term<T>,
    o: &'a Term<U>,
    g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData,
    V: TermData

An iterator visiting add quads with the given subject, object and graph name.

See also quads.

fn quads_with_pog<T, U, V>(
    &'a self,
    p: &'a Term<T>,
    o: &'a Term<U>,
    g: Option<&'a Term<V>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData,
    V: TermData

An iterator visiting add quads with the given predicate, object and graph name.

See also quads.

fn quads_with_spog<T, U, V, W>(
    &'a self,
    s: &'a Term<T>,
    p: &'a Term<U>,
    o: &'a Term<V>,
    g: Option<&'a Term<W>>
) -> DQuadSource<'a, Self> where
    T: TermData,
    U: TermData,
    V: TermData,
    W: TermData

An iterator visiting add quads with the given subject, predicate, object and graph name.

See also quads.

fn contains<T, U, V, W>(
    &'a self,
    s: &'a Term<T>,
    p: &'a Term<U>,
    o: &'a Term<V>,
    g: Option<&'a Term<W>>
) -> DResult<'a, Self, bool> where
    T: TermData,
    U: TermData,
    V: TermData,
    W: TermData

Return true if this dataset contains the given quad.

fn quads_matching<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
    &'a self,
    ms: &'a S,
    mp: &'a P,
    mo: &'a O,
    mg: &'a G
) -> DQuadSource<'a, Self> where
    S: TermMatcher,
    P: TermMatcher,
    O: TermMatcher,
    G: GraphNameMatcher

An iterator visiting add quads matching the given subject, predicate, object and graph name.

See also quads.

fn subjects(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the terms used as subject in this Dataset.

fn predicates(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the terms used as predicate in this Dataset.

fn objects(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the terms used as object in this Dataset.

fn graph_names(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the terms used as graph names in this Dataset.

fn iris(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the IRIs used in this Dataset.

fn bnodes(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the BNodes used in this Dataset.

fn literals(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the Literals used in this Dataset.

fn variables(&'a self) -> DResultTermSet<'a, Self>

Build a Hashset of all the variables used in this Dataset.

fn graph<T>(
    &self,
    graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &Self, Option<BoxTerm>> where
    T: TermData

Borrows one of the graphs of this dataset

fn graph_mut<T>(
    &mut self,
    graph_name: Option<&Term<T>>
) -> DatasetGraph<Self, &mut Self, Option<BoxTerm>> where
    T: TermData

Borrows mutably one of the graphs of this dataset

fn union_graph<T>(&'a self, gmatcher: T) -> DatasetGraph<Self, &Self, T> where
    T: GraphNameMatcher

Borrows a graph containing the union of all graphs matched by gmatcher

Loading content...

Implementations on Foreign Types

impl<'a, Q> Dataset<'a> for [Q] where
    Q: Quad<'a> + 'a, 
[src]

type Quad = &'a Q

type Error = Never

impl<'a, Q> Dataset<'a> for Vec<Q> where
    Q: Quad<'a> + 'a, 
[src]

type Quad = &'a Q

type Error = Never

impl<'a, Q, S: BuildHasher> Dataset<'a> for HashSet<Q, S> where
    Q: Eq + Hash + Quad<'a> + 'a, 
[src]

type Quad = &'a Q

type Error = Never

Loading content...

Implementors

impl<'a, G, H> Dataset<'a> for GraphAsDataset<G, H> where
    G: Graph<'a>,
    H: Borrow<G>, 
[src]

type Quad = TripleAsQuad<G::Triple>

type Error = G::Error

impl<'a, I> Dataset<'a> for HashDataset<I> where
    I: TermIndexMap,
    I::Index: Hash,
    <I::Factory as TermFactory>::TermData: 'static, 
[src]

type Quad = ([&'a Term<Self::TermData>; 3], Option<&'a Term<Self::TermData>>)

type Error = Never

impl<'a, T> Dataset<'a> for GspoWrapper<T> where
    T: IndexedDataset + Dataset<'a, Quad = ([&'a Term<<T as IndexedDataset>::TermData>; 3], Option<&'a Term<<T as IndexedDataset>::TermData>>)>, 
[src]

type Quad = <Self::Wrapped as Dataset<'a>>::Quad

type Error = <Self::Wrapped as Dataset<'a>>::Error

impl<'a, T> Dataset<'a> for OgpsWrapper<T> where
    T: IndexedDataset + Dataset<'a, Quad = ([&'a Term<<T as IndexedDataset>::TermData>; 3], Option<&'a Term<<T as IndexedDataset>::TermData>>)>, 
[src]

type Quad = <Self::Wrapped as Dataset<'a>>::Quad

type Error = <Self::Wrapped as Dataset<'a>>::Error

Loading content...