Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
709 B
28 lines
709 B
6 years ago
|
//! SPARQL 1.1 implementation.
|
||
|
//! This is a work in progress!!!
|
||
|
|
||
6 years ago
|
use model::Dataset;
|
||
|
use sparql::algebra::QueryResult;
|
||
|
use sparql::eval::SparqlEvaluator;
|
||
|
use sparql::parser::read_sparql_query;
|
||
|
use std::io::Read;
|
||
|
use store::store::EncodedQuadsStore;
|
||
|
use store::store::StoreDataset;
|
||
|
use Result;
|
||
|
|
||
7 years ago
|
pub mod algebra;
|
||
6 years ago
|
mod eval;
|
||
7 years ago
|
pub mod parser;
|
||
6 years ago
|
pub mod xml_results;
|
||
6 years ago
|
|
||
|
pub trait SparqlDataset: Dataset {
|
||
|
fn query(&self, query: impl Read) -> Result<QueryResult>;
|
||
|
}
|
||
|
|
||
|
impl<S: EncodedQuadsStore> SparqlDataset for StoreDataset<S> {
|
||
|
fn query(&self, query: impl Read) -> Result<QueryResult> {
|
||
|
let query = read_sparql_query(query, None)?;
|
||
|
SparqlEvaluator::new(self.encoded()).evaluate(&query)
|
||
|
}
|
||
|
}
|