QueryableDataset

Trait QueryableDataset 

Source
pub trait QueryableDataset<'a>: Sized + 'a {
    type InternalTerm: Clone + Eq + Hash + 'a;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn internal_quads_for_pattern(
        &self,
        subject: Option<&Self::InternalTerm>,
        predicate: Option<&Self::InternalTerm>,
        object: Option<&Self::InternalTerm>,
        graph_name: Option<Option<&Self::InternalTerm>>,
    ) -> impl Iterator<Item = Result<InternalQuad<Self::InternalTerm>, Self::Error>> + use<'a, Self>;
    fn internalize_term(
        &self,
        term: Term,
    ) -> Result<Self::InternalTerm, Self::Error>;
    fn externalize_term(
        &self,
        term: Self::InternalTerm,
    ) -> Result<Term, Self::Error>;

    // Provided methods
    fn internal_named_graphs(
        &self,
    ) -> impl Iterator<Item = Result<Self::InternalTerm, Self::Error>> + use<'a, Self> { ... }
    fn contains_internal_graph_name(
        &self,
        graph_name: &Self::InternalTerm,
    ) -> Result<bool, Self::Error> { ... }
    fn externalize_expression_term(
        &self,
        term: Self::InternalTerm,
    ) -> Result<ExpressionTerm, Self::Error> { ... }
    fn internalize_expression_term(
        &self,
        term: ExpressionTerm,
    ) -> Result<Self::InternalTerm, Self::Error> { ... }
    fn internal_term_effective_boolean_value(
        &self,
        term: Self::InternalTerm,
    ) -> Result<Option<bool>, Self::Error> { ... }
}
Expand description

A RDF dataset that can be queried using SPARQL

Required Associated Types§

Source

type InternalTerm: Clone + Eq + Hash + 'a

Internal representation of an RDF term

Can be just an integer that indexes into a dictionary…

Equality here is the RDF term equality (SPARQL sameTerm function)

Source

type Error: Error + Send + Sync + 'static

Error returned by the dataset.

Required Methods§

Source

fn internal_quads_for_pattern( &self, subject: Option<&Self::InternalTerm>, predicate: Option<&Self::InternalTerm>, object: Option<&Self::InternalTerm>, graph_name: Option<Option<&Self::InternalTerm>>, ) -> impl Iterator<Item = Result<InternalQuad<Self::InternalTerm>, Self::Error>> + use<'a, Self>

Fetches quads according to a pattern

For graph_name, Some(None) encodes the default graph, Some(Some(_)) a named graph and None any named graph (but not the default one!)

Source

fn internalize_term( &self, term: Term, ) -> Result<Self::InternalTerm, Self::Error>

Builds an internal term from the Term struct

Source

fn externalize_term( &self, term: Self::InternalTerm, ) -> Result<Term, Self::Error>

Builds a Term from an internal term

Provided Methods§

Source

fn internal_named_graphs( &self, ) -> impl Iterator<Item = Result<Self::InternalTerm, Self::Error>> + use<'a, Self>

Fetches the list of dataset named graphs

Source

fn contains_internal_graph_name( &self, graph_name: &Self::InternalTerm, ) -> Result<bool, Self::Error>

Returns if the dataset contains a given named graph

Source

fn externalize_expression_term( &self, term: Self::InternalTerm, ) -> Result<ExpressionTerm, Self::Error>

Builds an ExpressionTerm from an internal term

Source

fn internalize_expression_term( &self, term: ExpressionTerm, ) -> Result<Self::InternalTerm, Self::Error>

Builds an internal term from an ExpressionTerm

Source

fn internal_term_effective_boolean_value( &self, term: Self::InternalTerm, ) -> Result<Option<bool>, Self::Error>

Computes the term Effective boolean value

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> QueryableDataset<'a> for &'a Dataset

Source§

type InternalTerm = TermCow<'a>

Source§

type Error = Infallible

Source§

fn internal_quads_for_pattern( &self, subject: Option<&TermCow<'a>>, predicate: Option<&TermCow<'a>>, object: Option<&TermCow<'a>>, graph_name: Option<Option<&TermCow<'a>>>, ) -> impl Iterator<Item = Result<InternalQuad<TermCow<'a>>, Infallible>> + use<'a>

Source§

fn internalize_term(&self, term: Term) -> Result<TermCow<'a>, Infallible>

Source§

fn externalize_term(&self, term: TermCow<'a>) -> Result<Term, Infallible>

Implementors§