@Test public void testTwoIndexFilter2() throws Exception { String q18 = "" + "SELECT ?s ?t ?u " + "{" + " Filter(?s > 1 && ?t > 8)." + " ?s a ?t ." + " ?t <http: + " ?u <uri:talksTo> ?s . " + "}"; String q19 = "" + "SELECT ?s ?t ?u " + "{" + " Filter(?s > 1)." + " Filter(?t > 8)." + " ?s a ?t ." + " ?t <http: + " ?u <uri:talksTo> ?s . " + "}"; SPARQLParser parser = new SPARQLParser(); ParsedQuery pq1 = parser.parseQuery(q18, null); ParsedQuery pq2 = parser.parseQuery(q19, null); System.out.println("Query is " + pq1.getTupleExpr()); SimpleExternalTupleSet extTup1 = new SimpleExternalTupleSet( (Projection) pq2.getTupleExpr()); List<ExternalTupleSet> list = new ArrayList<ExternalTupleSet>(); list.add(extTup1); VarConstantIndexListPruner vci = new VarConstantIndexListPruner( pq1.getTupleExpr()); List<ExternalTupleSet> processedIndexSet = vci.getRelevantIndices(list); Assert.assertTrue(processedIndexSet.isEmpty()); }
@Override public List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList) { List<ExternalTupleSet> relIndexSet = new ArrayList<>(); for (ExternalTupleSet e : indexList) { if (isRelevant(e.getTupleExpr())) { relIndexSet.add(e); } } return relIndexSet; }
VarConstantIndexListPruner implements IndexListPruner { @Override public List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList) { List<ExternalTupleSet> relIndexSet = new ArrayList<>(); for (ExternalTupleSet e : indexList) { if (isRelevant(e.getTupleExpr())) { relIndexSet.add(e); } } return relIndexSet; } }
VarConstantIndexListPruner implements IndexListPruner { @Override public List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList) { List<ExternalTupleSet> relIndexSet = new ArrayList<>(); for (ExternalTupleSet e : indexList) { if (isRelevant(e.getTupleExpr())) { relIndexSet.add(e); } } return relIndexSet; } VarConstantIndexListPruner(TupleExpr te); }
VarConstantIndexListPruner implements IndexListPruner { @Override public List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList) { List<ExternalTupleSet> relIndexSet = new ArrayList<>(); for (ExternalTupleSet e : indexList) { if (isRelevant(e.getTupleExpr())) { relIndexSet.add(e); } } return relIndexSet; } VarConstantIndexListPruner(TupleExpr te); @Override List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList); }
VarConstantIndexListPruner implements IndexListPruner { @Override public List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList) { List<ExternalTupleSet> relIndexSet = new ArrayList<>(); for (ExternalTupleSet e : indexList) { if (isRelevant(e.getTupleExpr())) { relIndexSet.add(e); } } return relIndexSet; } VarConstantIndexListPruner(TupleExpr te); @Override List<ExternalTupleSet> getRelevantIndices(List<ExternalTupleSet> indexList);  }