Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.ValueConstant


            ValueExpr flagsArg = node.getFlagsArg();
            if (flagsArg == null) {
              super.meet(node);
            }
            else if (flagsArg instanceof ValueConstant) {
              ValueConstant flags = (ValueConstant)flagsArg;
              if (flags.getValue().stringValue().equals("i")) {
                super.meet(node);
              }
              else {
                throw unsupported(node);
              }
View Full Code Here


    for (Var var : constructVars) {
      if (var.isAnonymous() && !extElemMap.containsKey(var)) {
        ValueExpr valueExpr = null;

        if (var.hasValue()) {
          valueExpr = new ValueConstant(var.getValue());
        }
        else if (explicit) {
          // only generate bnodes in case of an explicit constructor
          valueExpr = new BNodeGenerator();
        }
View Full Code Here

      try {
        for (ValueExpr arg : or.getArgs()) {
          if (isConstant(arg)) {
            if (strategy.isTrue(arg, EmptyBindingSet.getInstance())) {
              or.replaceWith(new ValueConstant(BooleanLiteralImpl.TRUE));
              return;
            }
            else {
              or.removeArg(arg);
            }
          }
        }
        if (or.getNumberOfArguments() == 0) {
          or.replaceWith(new ValueConstant(BooleanLiteralImpl.FALSE));
        }
        else if (or.getNumberOfArguments() == 1) {
          or.replaceWith(or.getArg(0));
        }
      }
View Full Code Here

          if (isConstant(arg)) {
            if (strategy.isTrue(arg, EmptyBindingSet.getInstance())) {
              and.removeArg(arg);
            }
            else {
              and.replaceWith(new ValueConstant(BooleanLiteralImpl.FALSE));
              return;
            }
          }
        }
        if (and.getNumberOfArguments() == 0) {
          and.replaceWith(new ValueConstant(BooleanLiteralImpl.TRUE));
        }
        else if (and.getNumberOfArguments() == 1) {
          and.replaceWith(and.getArg(0));
        }
      }
View Full Code Here

          return;
        }
      }
      try {
        Value value = strategy.evaluate(naryValueOp, EmptyBindingSet.getInstance());
        naryValueOp.replaceWith(new ValueConstant(value));
      }
      catch (ValueExprEvaluationException e) {
        // TODO: incompatible values types(?), remove the affected part of
        // the query tree
        logger.debug("Failed to optimize NaryValueOperator with constant argument(s)", e);
View Full Code Here

      // All arguments are constant

      try {
        Value value = strategy.evaluate(functionCall, EmptyBindingSet.getInstance());
        functionCall.replaceWith(new ValueConstant(value));
      }
      catch (ValueExprEvaluationException e) {
        // TODO: incompatible values types(?), remove the affected part of
        // the query tree
        logger.debug("Failed to optimize function call with constant argument(s)", e);
View Full Code Here

    {
      super.meet(bound);

      if (bound.getArg().hasValue()) {
        // variable is always bound
        bound.replaceWith(new ValueConstant(BooleanLiteralImpl.TRUE));
      }
    }
View Full Code Here

      if (contextID instanceof Var) {
        contextVar = (Var)contextID;
      }
      else if (contextID instanceof ValueConstant) {
        ValueConstant vc = (ValueConstant)contextID;
        contextVar = createConstantVar(vc.getValue());
      }
      else {
        throw new IllegalArgumentException("Unexpected contextID result type: " + contextID.getClass());
      }
    }
View Full Code Here

    if (arg instanceof Var) {
      return (Var)arg;
    }
    else if (arg instanceof ValueConstant) {
      ValueConstant vc = (ValueConstant)arg;
      return createConstantVar(vc.getValue());
    }
    else {
      throw new IllegalArgumentException("Unexpected edge argument type: " + arg.getClass());
    }
  }
View Full Code Here

    if (valueExpr instanceof Var) {
      return (Var)valueExpr;
    }
    else if (valueExpr instanceof ValueConstant) {
      ValueConstant vc = (ValueConstant)valueExpr;
      return createConstantVar(vc.getValue());
    }
    else {
      throw new IllegalArgumentException("Unexpected node element result type: " + valueExpr.getClass());
    }
  }
View Full Code Here

TOP

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

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.