Make null/empty check stricter in sparql matcher
@@ -495,8 +495,8 @@ public class SparqlMatcherActor extends UntypedActor {
// no needToCheck, which happens when we first look for matches in the graph store:
// download the linked data and return a new NeedModelWrapper
Dataset ds = linkedDataSource.getDataForResource(URI.create(foundNeedUri.uri));
- //make sure we don't accidentally use empty results
- if (ds == null || !ds.isEmpty()) {
+ //make sure we don't accidentally use empty or faulty results
+ if (!NeedModelWrapper.isANeed(ds)) {
return null;
}
return new ScoredNeed(new NeedModelWrapper(ds), foundNeedUri.score);
