Trait QueryableDataset

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

    // 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>>,
    ) -> Box<dyn Iterator<Item = Result<InternalQuad<Self>, Self::Error>>>;
    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,
    ) -> Box<dyn Iterator<Item = Result<Self::InternalTerm, Self::Error>>> { ... }
    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

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

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>>, ) -> Box<dyn Iterator<Item = Result<InternalQuad<Self>, Self::Error>>>

Fetches quads according to a pattern

For graph_name, Some(None) encodes the default graph and Some(Some(_)) a named graph

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, ) -> Box<dyn Iterator<Item = Result<Self::InternalTerm, Self::Error>>>

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 QueryableDataset for Dataset

Implementors§