Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.ValueExpr


    throws QueryEvaluationException
  {
    if (operator instanceof Count) {
      Count countOp = (Count)operator;

      ValueExpr arg = countOp.getArg();

      if (arg != null) {
        Set<Value> values = makeValueSet(arg, bindingSets);
        return new LiteralImpl(Integer.toString(values.size()), XMLSchema.INTEGER);
      }
View Full Code Here


  @Override
  public void meet(Str str)
    throws UnsupportedRdbmsOperatorException
  {
    ValueExpr arg = str.getArg();
    result = coalesce(uri(arg), createLabelExpr(arg));
  }
View Full Code Here

  @Override
  public void meet(Compare compare)
    throws UnsupportedRdbmsOperatorException
  {
    ValueExpr left = compare.getLeftArg();
    ValueExpr right = compare.getRightArg();
    CompareOp op = compare.getOperator();
    switch (op) {
      case EQ:
        if (isTerm(left) && isTerm(right)) {
          result = termsEqual(left, right);
View Full Code Here

  @Override
  public void meet(LangMatches node)
    throws UnsupportedRdbmsOperatorException
  {
    ValueExpr left = node.getLeftArg();
    ValueExpr right = node.getRightArg();
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(eq(label(right), str("*")), neq(label(left), str("")));
    SqlExpr pattern = concat(lowercase(label(right)), str("%"));
    sqlCase.when(new TrueValue(), like(label(left), pattern));
    result = sqlCase;
View Full Code Here

  @Override
  public void meet(SameTerm node)
    throws UnsupportedRdbmsOperatorException
  {
    ValueExpr left = node.getLeftArg();
    ValueExpr right = node.getRightArg();
    boolean leftIsVar = left instanceof Var;
    boolean rightIsVar = right instanceof Var;
    boolean leftIsConst = left instanceof ValueConstant;
    boolean rightIsConst = right instanceof ValueConstant;
    if (leftIsVar && rightIsVar) {
View Full Code Here

  @Override
  public void meet(MathExpr node)
    throws UnsupportedRdbmsOperatorException
  {
    boolean divide = node.getParentNode().equals(MathExpr.MathOp.DIVIDE);
    ValueExpr left = node.getLeftArg();
    ValueExpr right = node.getRightArg();
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(in(str(DOUBLE), type(left), type(right)), str(DOUBLE));
    sqlCase.when(in(str(FLOAT), type(left), type(right)), str(FLOAT));
    sqlCase.when(in(str(DECIMAL), type(left), type(right)), str(DECIMAL));
    sqlCase.when(new TrueValue(), divide ? str(DECIMAL) : str(INTEGER));
View Full Code Here

    @Override
    public void meet(Compare compare) {
      super.meet(compare);

      if (compare.getOperator() == CompareOp.EQ) {
        ValueExpr leftArg = compare.getLeftArg();
        ValueExpr rightArg = compare.getRightArg();

        boolean leftIsVar = isVar(leftArg);
        boolean rightIsVar = isVar(rightArg);
        boolean leftIsResource = isResource(leftArg);
        boolean rightIsResource = isResource(rightArg);
View Full Code Here

          @Override
          public void meet(Regex node)
            throws UnsupportedRdbmsOperatorException
          {
            ValueExpr flagsArg = node.getFlagsArg();
            if (flagsArg == null) {
              super.meet(node);
            }
            else if (flagsArg instanceof ValueConstant) {
              ValueConstant flags = (ValueConstant)flagsArg;
View Full Code Here

    throws RuntimeException
  {
    super.meet(node);
    if (node.getArg() instanceof SelectQuery) {
      SelectQuery query = (SelectQuery)node.getArg();
      ValueExpr condition = null;
      for (ValueExpr expr : flatten(node.getCondition())) {
        try {
          query.addFilter(sql.createBooleanExpr(expr));
        }
        catch (UnsupportedRdbmsOperatorException e) {
View Full Code Here

    if (!(node.getArg() instanceof SelectQuery))
      return;
    SelectQuery query = (SelectQuery)node.getArg();
    try {
      for (OrderElem e : node.getElements()) {
        ValueExpr expr = e.getExpr();
        boolean asc = e.isAscending();
        query.addOrder(sql.createBNodeExpr(expr), asc);
        query.addOrder(sql.createUriExpr(expr), asc);
        query.addOrder(sql.createNumericExpr(expr), asc);
        query.addOrder(sql.createDatatypeExpr(expr), asc);
View Full Code Here

TOP

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

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.