@Override public void meet(StatementPattern node) { if (isExclusionPresent(node.getParentNode()) && !isExclusionPresent(node)) { list.add(node); } }
private void buildQuery(final TupleExpr tupleExpr, final StatementPattern matchStatement) { //If our IndexerExpr (to be) is the rhs-child of LeftJoin, we can safely make that a Join: // the IndexerExpr will (currently) not return results that can deliver unbound variables. //This optimization should probably be generalized into a LeftJoin -> Join optimizer under certain conditions. Until that // has been done, this code path at least takes care of queries generated by OpenSahara SparqTool that filter on OPTIONAL // projections. E.g. summary~'full text search' (summary is optional). See #379 if (matchStatement.getParentNode() instanceof LeftJoin) { final LeftJoin leftJoin = (LeftJoin)matchStatement.getParentNode(); if (leftJoin.getRightArg() == matchStatement && leftJoin.getCondition() == null) { matchStatement.getParentNode().replaceWith(new Join(leftJoin.getLeftArg(), leftJoin.getRightArg())); } } final FilterFunction fVisitor = new FilterFunction(matchStatement.getObjectVar().getName()); tupleExpr.visit(fVisitor); final List<IndexingExpr> results = Lists.newArrayList(); for(int i = 0; i < fVisitor.func.size(); i++){ results.add(new IndexingExpr(fVisitor.func.get(i), matchStatement, fVisitor.args.get(i))); } removeMatchedPattern(tupleExpr, matchStatement, new IndexerExprReplacer(results)); }
QueryModelNode parent = node.getParentNode();