|
|
@ -138,7 +138,7 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
} => { |
|
|
|
} => { |
|
|
|
match &options.service_handler { |
|
|
|
match &options.service_handler { |
|
|
|
None => if *silent { |
|
|
|
None => if *silent { |
|
|
|
return Box::new(vec![].into_iter()); |
|
|
|
return Box::new(empty()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
"No handler was supplied to resolve the given service" |
|
|
|
"No handler was supplied to resolve the given service" |
|
|
@ -147,21 +147,30 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
Some(handler) => { |
|
|
|
Some(handler) => { |
|
|
|
let pattern_option = match get_pattern_value(service_name, &[]) { |
|
|
|
let pattern_option = match get_pattern_value(service_name, &[]) { |
|
|
|
None => if *silent { |
|
|
|
None => if *silent { |
|
|
|
return Box::new(vec![].into_iter()); |
|
|
|
return Box::new(empty()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
"The handler supplied was unable to evaluate the given service" |
|
|
|
"The handler supplied was unable to evaluate the given service" |
|
|
|
)))) as EncodedTuplesIterator<'_>; |
|
|
|
)))) as EncodedTuplesIterator<'_>; |
|
|
|
}, |
|
|
|
}, |
|
|
|
Some(term) => { |
|
|
|
Some(term) => { |
|
|
|
let named_node = self.dataset.decode_named_node(term).unwrap(); |
|
|
|
match self.dataset.decode_named_node(term) { |
|
|
|
|
|
|
|
Err(err) => if *silent { |
|
|
|
|
|
|
|
return Box::new(empty()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return Box::new(once(Err(err))) as EncodedTuplesIterator<'_>; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
Ok(named_node) => { |
|
|
|
|
|
|
|
println!("named_node: {:?}", named_node); |
|
|
|
handler.handle(named_node) |
|
|
|
handler.handle(named_node) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
match pattern_option { |
|
|
|
match pattern_option { |
|
|
|
None => if *silent { |
|
|
|
None => if *silent { |
|
|
|
return Box::new(vec![].into_iter()); |
|
|
|
return Box::new(empty()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
return Box::new(once(Err(format_err!( |
|
|
|
"The handler supplied was unable to produce any result set on the given service" |
|
|
|
"The handler supplied was unable to produce any result set on the given service" |
|
|
@ -178,7 +187,13 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
buffered_results: vec![], |
|
|
|
buffered_results: vec![], |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
Err(err) => return Box::new(once(Err(err))) as EncodedTuplesIterator<'_> |
|
|
|
Err(err) => { |
|
|
|
|
|
|
|
if *silent { |
|
|
|
|
|
|
|
return Box::new(empty()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return Box::new(once(Err(err))) as EncodedTuplesIterator<'_> |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
@ -933,14 +948,23 @@ impl<'a, S: StoreConnection + 'a> SimpleEvaluator<S> { |
|
|
|
_ => None, |
|
|
|
_ => None, |
|
|
|
}?; |
|
|
|
}?; |
|
|
|
let iri = self.dataset.get_str(iri_id).ok()??; |
|
|
|
let iri = self.dataset.get_str(iri_id).ok()??; |
|
|
|
let base_iri = options.base_iri.map(|base_iri| Iri::parse(base_iri)); |
|
|
|
match options.base_iri { |
|
|
|
if let Some(Ok(base_iri)) = base_iri { |
|
|
|
None => { |
|
|
|
self.build_named_node(&base_iri.resolve(&iri).ok()?.into_inner()) |
|
|
|
Iri::parse(iri).ok()?; |
|
|
|
} else { |
|
|
|
Some(EncodedTerm::NamedNode { iri_id }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
Some(str_iri) => { |
|
|
|
|
|
|
|
match Iri::parse(str_iri) { |
|
|
|
|
|
|
|
Ok(base_iri) => self.build_named_node(&base_iri.resolve(&iri).ok()?.into_inner()), |
|
|
|
|
|
|
|
_ => { |
|
|
|
Iri::parse(iri).ok()?; |
|
|
|
Iri::parse(iri).ok()?; |
|
|
|
Some(EncodedTerm::NamedNode { iri_id }) |
|
|
|
Some(EncodedTerm::NamedNode { iri_id }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
PlanExpression::BNode(id) => match id { |
|
|
|
PlanExpression::BNode(id) => match id { |
|
|
|
Some(id) => { |
|
|
|
Some(id) => { |
|
|
|
if let EncodedTerm::StringLiteral { value_id } = |
|
|
|
if let EncodedTerm::StringLiteral { value_id } = |
|
|
|