// first determine those operations, which generate triples of the result (and delete the other ones (and their preceding operators...))
// also replace Construct operators with Generate operators!
final LinkedList<Generate> listOfConstructedTripel = new LinkedList<Generate>();
for(final BasicOperator bo: new LinkedList<BasicOperator>(resultInference.getPrecedingOperators())){
if(bo instanceof Construct){
final Construct construct = (Construct)bo;
// split construct and replace them with Generate operators!
for(final TriplePattern tp: construct.getTemplates()){
final Generate generate = new Generate(tp);
for(final BasicOperator father: construct.getPrecedingOperators()){
father.addSucceedingOperator(generate);
generate.addPrecedingOperator(father);
}
listOfConstructedTripel.add(generate);
// remove old construct
for(final BasicOperator father: new HashSet<BasicOperator>(construct.getPrecedingOperators())){
father.removeSucceedingOperator(construct);
construct.removePrecedingOperator(father);
}
}
} else if(bo instanceof ConstructPredicate){
final ConstructPredicate cp = (ConstructPredicate) bo;
boolean toDelete = true;