From 2b14dc324758fcb8916bfc2f64c728fd9288eb51 Mon Sep 17 00:00:00 2001 From: cstadler Date: Thu, 15 May 2014 20:17:50 +0200 Subject: [PATCH] Fix for #48: Switched to the filter placement optimizer intended for left joins - although not exactly sure anymore what the code really does --- .../database/FilterPlacementOptimizer2.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sparqlify-core/src/main/java/org/aksw/sparqlify/database/FilterPlacementOptimizer2.java b/sparqlify-core/src/main/java/org/aksw/sparqlify/database/FilterPlacementOptimizer2.java index 32cfaebe..db2dd2ae 100644 --- a/sparqlify-core/src/main/java/org/aksw/sparqlify/database/FilterPlacementOptimizer2.java +++ b/sparqlify-core/src/main/java/org/aksw/sparqlify/database/FilterPlacementOptimizer2.java @@ -112,7 +112,23 @@ public static Op _optimize(OpTopN op, RestrictionManagerImpl cnf) { } + public static Op _optimize(OpJoin op, RestrictionManagerImpl cnf) { + Factory2 factory = new Factory2() { + @Override + public Op create(Op a, Op b) { + Op result = OpJoin.create(a, b); + return result; + } + + }; + + Op result = handleLeftJoin(op.getLeft(), op.getRight(), cnf, factory); + return result; + + } + + public static Op _optimizeBreaking(OpJoin op, RestrictionManagerImpl cnf) { RestrictionManagerImpl leftCnf = filterByVars(cnf, op.getLeft()); RestrictionManagerImpl rightCnf = filterByVars(cnf, op.getRight());