Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.Filter


      }

      // set the filter conditions on the query pattern
      if (filterConditions.getNumberOfArguments() == 1) {
        // no second argument in the or
        expandedPattern = new Filter(expandedPattern, filterConditions.getArg(0));
      }
      else {
        expandedPattern = new Filter(expandedPattern, filterConditions);
      }

      // expand the query.
      parent.replaceChildNode(statementPattern, expandedPattern);
    }
View Full Code Here


    for (TupleExpr optTE : optionalTEs) {
      result = new LeftJoin(result, optTE);
    }

    for (ValueExpr constraint : constraints) {
      result = new Filter(result, constraint);
    }

    return result;
  }
View Full Code Here

          // down below other filters to avoid cloning them
          TupleExpr node = findNotFilter(filterArg);

          Union union = new Union();
          for (ValueExpr arg : constraints) {
            union.addArg(new Filter(node.clone(), arg));
          }

          node.replaceWith(union);

          // Enter recursion
View Full Code Here

        for (int i = constraints.size() - 1; i >= 0; i--) {
          ValueExpr constraint = constraints.get(i);
          TupleExpr right = node.getRightArg();
          Set<String> filterVars = new VarFinder(constraint).getVars();
          if (right.getBindingNames().containsAll(filterVars)) {
            node.setRightArg(new Filter(right.clone(), constraint.clone()));
          }
          else {
            and.addArg(constraint);
          }
        }
View Full Code Here

      getConjunctiveConstraints(filter.getCondition(), conjunctiveConstraints);

      TupleExpr filterArg = filter.getArg();

      for (int i = conjunctiveConstraints.size() - 1; i >= 1; i--) {
        Filter newFilter = new Filter(filterArg, conjunctiveConstraints.get(i));
        filterArg = newFilter;
      }

      filter.setCondition(conjunctiveConstraints.get(0));
      filter.setArg(filterArg);
View Full Code Here

        result = new LeftJoin(result, optTE.getTupleExpr());
      }
    }

    for (ValueExpr constraint : constraints) {
      result = new Filter(result, constraint);
    }

    return result;
  }
View Full Code Here

      sameTerms.add(new SameTerm(objVar.clone(), resource));
    }

    ValueExpr constraint = new Or(sameTerms);

    result = new Filter(result, constraint);

    ProjectionElemList projElemList = new ProjectionElemList();
    projElemList.addElement(new ProjectionElem(subjVar.getName(), "subject"));
    projElemList.addElement(new ProjectionElem(predVar.getName(), "predicate"));
    projElemList.addElement(new ProjectionElem(objVar.getName(), "object"));
View Full Code Here

        TupleExpr tupleExprs = joinTupleExpressions();
        ValueExpr conditions = joinConditions();
       
        return (conditions == null) ?
                tupleExprs :
                new Filter(tupleExprs, conditions);
    }
View Full Code Here

        result = new LeftJoin(result, optTE.getTupleExpr());
      }
    }

    for (ValueExpr constraint : constraints) {
      result = new Filter(result, constraint);
    }

    return result;
  }
View Full Code Here

      getConjunctiveConstraints(filter.getCondition(), conjunctiveConstraints);

      TupleExpr filterArg = filter.getArg();

      for (int i = conjunctiveConstraints.size() - 1; i >= 1; i--) {
        Filter newFilter = new Filter(filterArg, conjunctiveConstraints.get(i));
        filterArg = newFilter;
      }

      filter.setCondition(conjunctiveConstraints.get(0));
      filter.setArg(filterArg);
View Full Code Here

TOP

Related Classes of org.openrdf.query.algebra.Filter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.