|
|
@ -128,11 +128,15 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
service_name, |
|
|
|
service_name, |
|
|
|
graph_pattern, |
|
|
|
graph_pattern, |
|
|
|
.. |
|
|
|
.. |
|
|
|
} => match self.evaluate_service(service_name, graph_pattern, variables, from) { |
|
|
|
} => match self.evaluate_service(service_name, graph_pattern, variables) { |
|
|
|
Ok(result) => result, |
|
|
|
Ok(result) => Box::new(result.flat_map(move |binding| { |
|
|
|
|
|
|
|
binding |
|
|
|
|
|
|
|
.map(|binding| combine_tuples(&binding, &from)) |
|
|
|
|
|
|
|
.transpose() |
|
|
|
|
|
|
|
})), |
|
|
|
Err(e) => { |
|
|
|
Err(e) => { |
|
|
|
if *silent { |
|
|
|
if *silent { |
|
|
|
Box::new(empty()) |
|
|
|
Box::new(once(Ok(from))) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Box::new(once(Err(e))) |
|
|
|
Box::new(once(Err(e))) |
|
|
|
} |
|
|
|
} |
|
|
@ -484,22 +488,14 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
service_name: &PatternValue, |
|
|
|
service_name: &PatternValue, |
|
|
|
graph_pattern: &'b GraphPattern, |
|
|
|
graph_pattern: &'b GraphPattern, |
|
|
|
variables: &'b [Variable], |
|
|
|
variables: &'b [Variable], |
|
|
|
from: EncodedTuple, |
|
|
|
|
|
|
|
) -> Result<EncodedTuplesIterator<'b>> { |
|
|
|
) -> Result<EncodedTuplesIterator<'b>> { |
|
|
|
let service_name = self.dataset.decode_named_node( |
|
|
|
let service_name = self.dataset.decode_named_node( |
|
|
|
get_pattern_value(service_name, &[]) |
|
|
|
get_pattern_value(service_name, &[]) |
|
|
|
.ok_or_else(|| format_err!("The SERVICE name is not bound"))?, |
|
|
|
.ok_or_else(|| format_err!("The SERVICE name is not bound"))?, |
|
|
|
)?; |
|
|
|
)?; |
|
|
|
Ok(Box::new( |
|
|
|
Ok(self.encode_bindings( |
|
|
|
self.encode_bindings( |
|
|
|
variables, |
|
|
|
variables, |
|
|
|
self.service_handler.handle(&service_name, &graph_pattern)?, |
|
|
|
self.service_handler.handle(&service_name, &graph_pattern)?, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.flat_map(move |binding| { |
|
|
|
|
|
|
|
binding |
|
|
|
|
|
|
|
.map(|binding| combine_tuples(&binding, &from)) |
|
|
|
|
|
|
|
.transpose() |
|
|
|
|
|
|
|
}), |
|
|
|
|
|
|
|
)) |
|
|
|
)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|