         return results
     }
 
+    func evaluate(query: Query, in store: TestedQuadStore, dataset: Dataset, defaultGraph: Term) throws -> QueryResult<[TermResult], [Triple]> {
+        do {
+            let e = QueryPlanEvaluator(store: store, dataset: dataset, base: query.base)
+//            e.planner.allowStoreOptimizedPlans = false
+            let result = try e.evaluate(query: query, activeGraph: defaultGraph)
+//            print("Successful query plan evaluation")
+            switch result {
+            case let .bindings(vars, rows):
+                return .bindings(vars, Array(rows))
+            case .boolean(let b):
+                return .boolean(b)
+            case .triples(let t):
+                return .triples(Array(t))
+            }
+        } catch let error {
+            print("*** Failed to generate query plan: \(error)")
+            throw error
+        }
+    }
+    
     func datasetDescription(from quadstore: MemoryQuadStore, for term: Term, defaultGraph graph: Term) throws -> Dataset {
         var d = Dataset()
         let prefix = "http://www.w3.org/2001/sw/DataAccess/tests/test-query#"

                    }
                    if let queryDataset = query.dataset {
                        if !queryDataset.isEmpty {
                            dataset = queryDataset
                        }
                    }

        return result
    }
    
    public func runEvaluationTests(inPath path: URL, testType: Term?, skip: Set<String>? = nil) throws -> [TestResult] {
        if let skip = skip {
            return try runEvaluationTests(inPath: path, testType: testType) {
