*/
private void process(ResIterator iter, PrintWriter out) {
Map patternRelationsMap = new HashMap();
while (iter.hasNext()) {
Resource currentRelationRes = iter.nextResource();
RelationPattern pattern = new RelationPattern(currentRelationRes
.getProperty(KNOBOT.source).getResource(),
currentRelationRes.getProperty(KNOBOT.target).getResource());
Collection relations = (Collection) patternRelationsMap
.get(pattern);
if (relations == null) {
relations = new ArrayList();
}
relations.add(currentRelationRes);
patternRelationsMap.put(pattern, relations);
}
iter.close();
for (Iterator iterator = patternRelationsMap.keySet().iterator(); iterator
.hasNext();) {
RelationPattern current = (RelationPattern) iterator.next();
deleteAllButBest((Collection) patternRelationsMap.get(current), out);
}
}