Skip to main content

Module sparql

Module sparql 

Source
Expand description

Common traits for working with SPARQL.

§Design rationale

These traits are deliberately very generic. Specific implementations may have additional features, such as:

  • setting default values for BASE, PREFIX, FROM, FROM NAMED directives, before parsing query string, or
  • pre-binding variables before evaluating query;
  • etc…

However, we do not want to impose these feature, or any subset thereof, to all implementations of Sophia.

§Extension point

A possible way to extend these traits with additional functionalities (such as the ones described above) would be to define subtraits of Query with additional methods (e.g.set_base, bind_variables…). Implementation could then express requirements as trait bound, e.g.:

    D: SparqlDataset,
    D::Query: Clone + BindVariable,

Sophia may define such traits in the future.

Enums§

SparqlResult
The result of executing a SPARQL query.

Traits§

IntoQuery
A utility trait to allow SparqlDataset::query to accept either &str or Self::Query.
Query
Preprocessed query, ready for execution.
SparqlBindings
The result of executing a SPARQL SELECT query
SparqlDataset
A dataset that can be queried with SPARQL.