         case .select(_):
             return QueryResult.bindings(query.projectedVariables, results)
         case .construct(let template):
-            let t = triples(from: iter, with: template)
+            let t = triples(from: results, with: template)
             return QueryResult.triples(t)
         default:
             throw QueryError.evaluationError("TODO: evaluate(query) not implemented for \(query.form)")

        return .variable(".v\(n)", binding: true)
    }
    
    private func triples(from results: AnyIterator<TermResult>, with template: [TriplePattern]) -> [Triple] {
        var triples = [Triple]()
        for r in results {
            for tp in template {
                do {

                        return nil
                    }
                    if let ground = replaced.ground {
                        triples.insert(ground)
                    }
                } catch {}
            }
        }
        return Array(triples)
    }
    
    public func evaluate(query: Query, activeGraph: Term) throws -> QueryResult<[TermResult], [Triple]> {
