[][src]Struct sophia::dataset::inmem::HashDataset

pub struct HashDataset<I> where
    I: TermIndexMap,
    I::Index: Hash,
    <I::Factory as TermFactory>::TermData: 'static, 
{ /* fields omitted */ }

A generic implementation of Dataset and MutableDataset, storing its terms in a TermIndexMap, and its triples in a HashSet.

Methods

impl<I> HashDataset<I> where
    I: TermIndexMap,
    I::Index: Hash
[src]

pub fn new() -> HashDataset<I>[src]

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

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

type Index = I::Index

The type used to represent terms internally.

type TermData = <I::Factory as TermFactory>::TermData

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

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

type Error = Never

The error type that this dataset may raise. Read more

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

An iterator visiting all quads with the given subject. Read more

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

An iterator visiting all quads with the given predicate. Read more

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

An iterator visiting add quads with the given object. Read more

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

An iterator visiting add quads with the given graph name. Read more

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Borrows mutably one of the graphs of this dataset

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

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

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

type MutationError = Never

The error type that this dataset may raise during mutations. Read more

fn inserter(&mut self) -> Inserter<Self>[src]

Return a QuadSink that will insert into this dataset all the quads it receives. Read more

fn insert_all<'a, TS>(
    &mut self,
    src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
    TS: QuadSource<'a>,
    TS::Error: CoercibleWith<Self::MutationError>, 
[src]

Insert into this dataset all quads from the given source.

fn remover(&mut self) -> Remover<Self>[src]

Return a QuadSink that will remove from this dataset all the quads it receives. Read more

fn remove_all<'a, TS>(
    &mut self,
    src: &mut TS
) -> CoercedResult<usize, TS::Error, Self::MutationError> where
    TS: QuadSource<'a>,
    TS::Error: CoercibleWith<Self::MutationError>, 
[src]

Remove from this dataset all quads from the given source.

fn remove_matching<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
    &mut self,
    ms: &S,
    mp: &P,
    mo: &O,
    mg: &G
) -> MDResult<Self, usize> where
    S: TermMatcher,
    P: TermMatcher,
    O: TermMatcher,
    G: GraphNameMatcher,
    Self::Error: Into<Self::MutationError>,
    Never: CoercibleWith<Self::MutationError>,
    Self::MutationError: From<CoercedError<Never, Self::MutationError>>, 
[src]

Remove all quads matching the given matchers. Read more

fn retain<S: ?Sized, P: ?Sized, O: ?Sized, G: ?Sized>(
    &mut self,
    ms: &S,
    mp: &P,
    mo: &O,
    mg: &G
) -> MDResult<Self, ()> where
    S: TermMatcher,
    P: TermMatcher,
    O: TermMatcher,
    G: GraphNameMatcher,
    Self::Error: Into<Self::MutationError>,
    Never: CoercibleWith<Self::MutationError>,
    Self::MutationError: From<CoercedError<Never, Self::MutationError>>, 
[src]

Keep only the quads matching the given matchers. Read more

impl<I> SetDataset for HashDataset<I> where
    I: TermIndexMap,
    I::Index: Hash
[src]

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

Auto Trait Implementations

impl<I> Sync for HashDataset<I> where
    I: Sync,
    <I as TermIndexMap>::Index: Sync

impl<I> Send for HashDataset<I> where
    I: Send,
    <I as TermIndexMap>::Index: Send

impl<I> Unpin for HashDataset<I> where
    I: Unpin,
    <I as TermIndexMap>::Index: Unpin

impl<I> RefUnwindSafe for HashDataset<I> where
    I: RefUnwindSafe,
    <I as TermIndexMap>::Index: RefUnwindSafe

impl<I> UnwindSafe for HashDataset<I> where
    I: UnwindSafe,
    <I as TermIndexMap>::Index: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]