Package org.openrdf.sail.rdbms.algebra

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


  private SqlExpr effectiveBooleanValue(ValueExpr v)
    throws UnsupportedRdbmsOperatorException
  {
    String bool = XMLSchema.BOOLEAN.stringValue();
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(eq(type(v), str(bool)), eq(label(v), str("true")));
    sqlCase.when(simple(type(v)), not(eq(label(v), str(""))));
    sqlCase.when(isNotNull(numeric(v)), not(eq(numeric(v), num(0))));
    return sqlCase;
  }
View Full Code Here


  private SqlExpr equal(ValueExpr left, ValueExpr right)
    throws UnsupportedRdbmsOperatorException
  {
    SqlExpr bnodes = eq(bNode(left), bNode(right));
    SqlExpr uris = eq(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

  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(Lang node)
    throws UnsupportedRdbmsOperatorException
  {
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(isNotNull(lang(node.getArg())), lang(node.getArg()));
    sqlCase.when(isNotNull(createLabelExpr(node.getArg())), str(""));
    result = sqlCase;
  }
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

      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

  @Override
  public void meet(Lang node)
    throws UnsupportedRdbmsOperatorException
  {
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(isNotNull(lang(node.getArg())), lang(node.getArg()));
    sqlCase.when(isNotNull(createLabelExpr(node.getArg())), str(""));
    result = sqlCase;
  }
View Full Code Here

  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

  private SqlExpr effectiveBooleanValue(ValueExpr v)
    throws UnsupportedRdbmsOperatorException
  {
    String bool = XMLSchema.BOOLEAN.stringValue();
    SqlCase sqlCase = new SqlCase();
    sqlCase.when(eq(type(v), str(bool)), eq(label(v), str("true")));
    sqlCase.when(simple(type(v)), not(eq(label(v), str(""))));
    sqlCase.when(isNotNull(numeric(v)), not(eq(numeric(v), num(0))));
    return sqlCase;
  }
View Full Code Here

  private SqlExpr equal(ValueExpr left, ValueExpr right)
    throws UnsupportedRdbmsOperatorException
  {
    SqlExpr bnodes = eq(bNode(left), bNode(right));
    SqlExpr uris = eq(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

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.