SPARQL XML results: allows blank nodes without label

pull/171/head
Tpt 3 years ago
parent f23350dac8
commit f72f18842d
  1. 2
      lib/src/sparql/json_results.rs
  2. 9
      lib/src/sparql/xml_results.rs

@ -386,7 +386,7 @@ impl<R: BufRead> ResultsIterator<R> {
Some(Type::Literal) => {
let value = value.ok_or_else(|| {
invalid_data_error(
"uri serialization should have a 'value' key",
"literal serialization should have a 'value' key",
)
})?;
Ok(match lang {

@ -574,7 +574,14 @@ impl<R: BufRead> ResultsIterator<R> {
}
state = State::Triple;
}
State::Uri | State::BNode => state = self.stack.pop().unwrap(),
State::Uri => state = self.stack.pop().unwrap(),
State::BNode => {
if term.is_none() {
//We default to a random bnode
term = Some(BlankNode::default().into())
}
state = self.stack.pop().unwrap()
}
State::Literal => {
if term.is_none() {
//We default to the empty literal

Loading…
Cancel
Save