Makes BIND evaluation pass the SPARQL tests

pull/10/head
Tpt 5 years ago
parent 4f00ed8266
commit 585917344c
  1. 19
      lib/src/sparql/eval.rs
  2. 6
      lib/tests/sparql_test_cases.rs

@ -241,20 +241,13 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> {
expression, expression,
} => { } => {
let eval = self.clone(); let eval = self.clone();
Box::new( Box::new(self.eval_plan(&*child, from).map(move |tuple| {
self.eval_plan(&*child, from) let mut tuple = tuple?;
.filter_map(move |tuple| match tuple { if let Some(value) = eval.eval_expression(&expression, &tuple) {
Ok(mut tuple) => { put_value(*position, value, &mut tuple)
put_value(
*position,
eval.eval_expression(&expression, &tuple)?,
&mut tuple,
);
Some(Ok(tuple))
} }
Err(error) => Some(Err(error)), Ok(tuple)
}), }))
)
} }
PlanNode::Sort { child, by } => { PlanNode::Sort { child, by } => {
let iter = self.eval_plan(&*child, from); let iter = self.eval_plan(&*child, from);

@ -76,8 +76,10 @@ fn sparql_w3c_query_evaluation_testsuite() -> Result<()> {
"http://www.w3.org/2001/sw/DataAccess/tests/data-r2/type-promotion/manifest.ttl", "http://www.w3.org/2001/sw/DataAccess/tests/data-r2/type-promotion/manifest.ttl",
]; ];
let manifest_11_urls = let manifest_11_urls = vec![
vec!["http://www.w3.org/2009/sparql/docs/tests/data-sparql11/exists/manifest.ttl"]; "http://www.w3.org/2009/sparql/docs/tests/data-sparql11/bind/manifest.ttl",
"http://www.w3.org/2009/sparql/docs/tests/data-sparql11/exists/manifest.ttl",
];
let test_blacklist = vec![ let test_blacklist = vec![
//Multiple writing of the same xsd:integer. Our system does strong normalization. //Multiple writing of the same xsd:integer. Our system does strong normalization.

Loading…
Cancel
Save