*
* @return return a rule result with all predicates rif:error, which are detected errors in the ontology!
* @throws Exception
*/
public RuleResult inferTriplesAndStoreInDataset() throws Exception {
final CollectRIFResult cr = this.getCollectedResults(true);
final RuleResult result = new RuleResult();
if(this.evaluator instanceof BasicIndexQueryEvaluator){
for(final QueryResult qr: cr.getQueryResults()){
if(qr instanceof GraphResult){
final GraphResult gr = (GraphResult) qr;
for(final Triple t: gr.getGraphResultTriples()){
final Collection<Indices> ci = ((BasicIndexQueryEvaluator)this.evaluator).getDataset().getDefaultGraphIndices();
for (final Indices indices : ci) {
indices.add(t);
}
}
} else if(qr instanceof RuleResult){
final RuleResult rr = (RuleResult) qr;
for(final Predicate predicate: rr.getPredicateResults()){
if(rif_error.equals(predicate.getName())){
result.getPredicateResults().add(predicate);
}
}
}
}
} else if (this.evaluator instanceof StreamQueryEvaluator) {
String s = "";
for(final QueryResult qr: cr.getQueryResults()){
if(qr instanceof GraphResult){
final GraphResult gr = (GraphResult) qr;
// TODO duplicated triple elimination!
for(final Triple t: gr.getGraphResultTriples()){
if(!t.getSubject().isBlank() && !t.getSubject().isURI()){