Keeps everything related to SPARQL in one placepull/10/head
parent
5966c62cc8
commit
002afb53b4
@ -1,6 +1,27 @@ |
|||||||
//! SPARQL 1.1 implementation.
|
//! SPARQL 1.1 implementation.
|
||||||
//! This is a work in progress!!!
|
//! This is a work in progress!!!
|
||||||
|
|
||||||
|
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; |
||||||
|
|
||||||
pub mod algebra; |
pub mod algebra; |
||||||
|
mod eval; |
||||||
pub mod parser; |
pub mod parser; |
||||||
pub mod xml_results; |
pub mod xml_results; |
||||||
|
|
||||||
|
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) |
||||||
|
} |
||||||
|
} |
||||||
|
Loading…
Reference in new issue