Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.Filter


    public void meet(SameTerm sameTerm) {
      super.meet(sameTerm);

      if (sameTerm.getParentNode() instanceof Filter) {
        // SameTerm applies to the filter's argument
        Filter filter = (Filter)sameTerm.getParentNode();

        ValueExpr leftArg = sameTerm.getLeftArg();
        ValueExpr rightArg = sameTerm.getRightArg();

        // Verify that vars are bound by filterArg
        Set<String> bindingNames = filter.getArg().getBindingNames();

        if (leftArg instanceof Var && !bindingNames.contains(((Var)leftArg).getName())
            || rightArg instanceof Var && !bindingNames.contains(((Var)rightArg).getName()))
        {
          // One or both var(s) are unbound, this expression will never
          // return any results
          filter.replaceWith(new EmptySet());
          return;
        }

        if (leftArg instanceof Var && rightArg instanceof Var) {
          // Rename rightArg to leftArg
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

    ValueExpr constraint = sameTerms.get(0);
    for (int i = 0; i < sameTerms.size(); i++) {
      constraint = new Or(constraint, sameTerms.get(i));
    }

    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

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.