Package org.openrdf.sail.rdbms.algebra

Examples of org.openrdf.sail.rdbms.algebra.SqlCase$Entry


  private SqlExpr termsEqual(ValueExpr left, ValueExpr right)
    throws UnsupportedRdbmsOperatorException
  {
    SqlExpr bnodes = eqIfNotNull(bNode(left), bNode(right));
    SqlExpr uris = eqIfNotNull(uri(left), uri(right));
    SqlCase scase = new SqlCase();
    scase.when(or(isNotNull(bNode(left)), isNotNull(bNode(right))), bnodes);
    scase.when(or(isNotNull(uri(left)), isNotNull(uri(right))), uris);
    return literalEqual(left, right, scase);
  }
View Full Code Here


  @Override
  public void meet(Datatype node)
    throws UnsupportedRdbmsOperatorException
  {
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(isNotNull(type(node.getArg())), type(node.getArg()));
    sqlCase.when(and(isNull(lang(node.getArg())), isNotNull(label(node.getArg()))),
        str(XMLSchema.STRING.stringValue()));
    result = sqlCase;
  }
View Full Code Here

    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));
    result = sqlCase;
  }
View Full Code Here

  public static SqlExpr cmp(SqlExpr left, CompareOp op, SqlExpr right) {
    return new SqlCompare(left, op, right);
  }

  public static SqlExpr coalesce(SqlExpr... exprs) {
    SqlCase sqlCase = new SqlCase();
    for (SqlExpr expr : exprs) {
      sqlCase.when(isNotNull(expr.clone()), expr);
    }
    return sqlCase;
  }
View Full Code Here

      replace(node, new FalseValue());
    }
    else if (arg instanceof SqlCase) {
      SqlExpr rep = null;
      SqlExpr prev = null;
      SqlCase scase = (SqlCase)arg;
      for (Entry entry : scase.getEntries()) {
        SqlExpr condition = entry.getCondition();
        if (rep == null) {
          rep = and(condition.clone(), isNull(entry.getResult().clone()));
          prev = not(condition.clone());
        }
View Full Code Here

TOP

Related Classes of org.openrdf.sail.rdbms.algebra.SqlCase$Entry

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.