|
|
@ -246,43 +246,50 @@ impl Iterator for TestManifest { |
|
|
|
None => { |
|
|
|
None => { |
|
|
|
match self.manifests_to_do.pop() { |
|
|
|
match self.manifests_to_do.pop() { |
|
|
|
Some(url) => { |
|
|
|
Some(url) => { |
|
|
|
let manifest = SubjectRef::from(NamedNodeRef::new(url.as_str()).unwrap()); |
|
|
|
self.graph.clear(); |
|
|
|
if let Err(error) = load_to_graph(&url, &mut self.graph) { |
|
|
|
if let Err(error) = load_to_graph(&url, &mut self.graph) { |
|
|
|
return Some(Err(error)); |
|
|
|
return Some(Err(error)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// New manifests
|
|
|
|
for manifest in self |
|
|
|
match self |
|
|
|
|
|
|
|
.graph |
|
|
|
.graph |
|
|
|
.object_for_subject_predicate(manifest, mf::INCLUDE) |
|
|
|
.subjects_for_predicate_object(rdf::TYPE, mf::MANIFEST) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Some(TermRef::BlankNode(list)) => { |
|
|
|
match self |
|
|
|
self.manifests_to_do.extend( |
|
|
|
.graph |
|
|
|
RdfListIterator::iter(&self.graph, list.into()).filter_map( |
|
|
|
.object_for_subject_predicate(manifest, mf::INCLUDE) |
|
|
|
|m| match m { |
|
|
|
{ |
|
|
|
Term::NamedNode(nm) => Some(nm.into_string()), |
|
|
|
Some(TermRef::BlankNode(list)) => { |
|
|
|
_ => None, |
|
|
|
self.manifests_to_do.extend( |
|
|
|
}, |
|
|
|
RdfListIterator::iter(&self.graph, list.into()).filter_map( |
|
|
|
), |
|
|
|
|m| match m { |
|
|
|
); |
|
|
|
Term::NamedNode(nm) => Some(nm.into_string()), |
|
|
|
|
|
|
|
_ => None, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Some(_) => return Some(Err(anyhow!("invalid tests list"))), |
|
|
|
|
|
|
|
None => (), |
|
|
|
} |
|
|
|
} |
|
|
|
Some(_) => return Some(Err(anyhow!("invalid tests list"))), |
|
|
|
|
|
|
|
None => (), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// New tests
|
|
|
|
// New tests
|
|
|
|
match self |
|
|
|
match self |
|
|
|
.graph |
|
|
|
.graph |
|
|
|
.object_for_subject_predicate(manifest, mf::ENTRIES) |
|
|
|
.object_for_subject_predicate(manifest, mf::ENTRIES) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Some(TermRef::BlankNode(list)) => { |
|
|
|
Some(TermRef::BlankNode(list)) => { |
|
|
|
self.tests_to_do |
|
|
|
self.tests_to_do |
|
|
|
.extend(RdfListIterator::iter(&self.graph, list.into())); |
|
|
|
.extend(RdfListIterator::iter(&self.graph, list.into())); |
|
|
|
} |
|
|
|
} |
|
|
|
Some(term) => { |
|
|
|
Some(term) => { |
|
|
|
return Some(Err(anyhow!("Invalid tests list. Got term {}", term))); |
|
|
|
return Some(Err(anyhow!( |
|
|
|
|
|
|
|
"Invalid tests list. Got term {}", |
|
|
|
|
|
|
|
term |
|
|
|
|
|
|
|
))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
None => (), |
|
|
|
} |
|
|
|
} |
|
|
|
None => (), |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
None => return None, |
|
|
|
None => return None, |
|
|
|