Package de.fuberlin.wiwiss.d2rq.expr

Examples of de.fuberlin.wiwiss.d2rq.expr.Expression


  {
    logger.debug("convertLang " + expr.toString());
   
    expr.getArg().visit(this);
   
    Expression arg = expression.pop();
   
    if (arg instanceof AttributeExprEx) {
      AttributeExprEx variable = (AttributeExprEx) arg;
      NodeMaker nm = variable.getNodeMaker();
      DetermineNodeType filter = new DetermineNodeType();
View Full Code Here


  {
    logger.debug("convertDataType " + expr.toString());
   
    expr.getArg().visit(this);
   
    Expression arg = expression.pop();
   
    if (arg instanceof AttributeExprEx) {
      AttributeExprEx variable = (AttributeExprEx) arg;
      NodeMaker nm = variable.getNodeMaker();
      DetermineNodeType filter = new DetermineNodeType();
View Full Code Here

  {
    logger.debug("convertSameTerm " + expr.toString());
   
    expr.getArg1().visit(this);
    expr.getArg2().visit(this);
    Expression e2 = expression.pop();
    Expression e1 = expression.pop();
   
    // TODO Expression.FALSE and Expression.TRUE are not constants
    if (e1.equals(Expression.FALSE))
      e1 = CONSTANT_FALSE;
    else if (e1.equals(Expression.TRUE))
      e1 = CONSTANT_TRUE;
    if (e2.equals(Expression.FALSE))
      e2 = CONSTANT_FALSE;
    else if (e2.equals(Expression.TRUE))
      e2 = CONSTANT_TRUE;
View Full Code Here

  {
    logger.debug("convertLangMatches " + expr.toString());
   
    expr.getArg1().visit(this);
    expr.getArg2().visit(this);
    Expression e2 = expression.pop();
    Expression e1 = expression.pop();
   
    if (e1 instanceof ConstantEx && e2 instanceof ConstantEx) {
      ConstantEx lang1 = (ConstantEx) e1;
      ConstantEx lang2 = (ConstantEx) e2;
      NodeValue nv1 = NodeValue.makeString(lang1.getNode().getLiteral().getLexicalForm());
View Full Code Here

    }
    String value = this.nodeType.extractValue(node);
    if (value == null) {
      return NodeMaker.EMPTY;
    }
    Expression expr = valueMaker.valueExpression(value);
    if (expr.isFalse()) {
      sideEffects.select(Expression.FALSE);
      return NodeMaker.EMPTY;
    }
    sideEffects.select(expr);
    return new FixedNodeMaker(node, isUnique());
View Full Code Here

      Attribute attribute = SQL.parseAttribute(attributeName);
      expressions.add(Equality.create(
          new AttributeExpr(attribute),
          new Constant(attributeValue, attribute)));
    }
    Expression expr = Conjunction.create(expressions);
    assertEquals(expr, pattern.valueExpression(value));
  }
View Full Code Here

    }
   
    if (expression.size() != 1)
      throw new IllegalStateException("something is seriously wrong");
   
    Expression result = expression.pop();
    logger.debug("Resulting filter = " + result);
    return result;
  }
View Full Code Here

          if (projectionSpec instanceof Attribute) {
            result.add(new AttributeExprEx((Attribute) projectionSpec, nodeMaker));
          } else {
            // projectionSpec is a ExpressionProjectionSpec
            ExpressionProjectionSpec expressionProjectionSpec = (ExpressionProjectionSpec) projectionSpec;
            Expression expression = expressionProjectionSpec.toExpression();
            if (expression instanceof SQLExpression)
              result.add(((SQLExpression)expression));
            else
              return Collections.emptyList();
          }
View Full Code Here

      convert((E_UnaryPlus) expr);
    } else if (expr instanceof E_UnaryMinus) {
      convert((E_UnaryMinus) expr);
    } else if (extensionSupports(expr)) {
      expr.getArg(1).visit(this) ;
      Expression e1 = expression.pop();
      List<Expression> args = Collections.singletonList(e1);
      extensionConvert(expr, args);
    } else {
      conversionFailed(expr);
    }
View Full Code Here

    logger.debug("convertFunction " + expr.toString());
   
    if (expr instanceof E_LogicalOr) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(e1.or(e2));
    } else if (expr instanceof E_LessThan) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new LessThan(e1, e2));
    } else if (expr instanceof E_LessThanOrEqual) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new LessThanOrEqual(e1, e2));
    } else if (expr instanceof E_GreaterThan) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new GreaterThan(e1, e2));
    } else if (expr instanceof E_GreaterThanOrEqual) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new GreaterThanOrEqual(e1, e2));
    } else if (expr instanceof E_Add) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new Add(e1, e2));
    } else if (expr instanceof E_Subtract) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new Subtract(e1, e2));
    } else if (expr instanceof E_Multiply) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new Multiply(e1, e2));
    } else if (expr instanceof E_Divide) {
      expr.getArg1().visit(this) ;
      expr.getArg2().visit(this) ;
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
      expression.push(new Divide(e1, e2));
    } else if (expr instanceof E_Equals) {
      convertEquals((E_Equals) expr);
    } else if (expr instanceof E_NotEquals) {
      convertNotEquals((E_NotEquals) expr);
    } else if (expr instanceof E_LangMatches) {
      convertLangMatches((E_LangMatches) expr);
    } else if (expr instanceof E_SameTerm) {
      convertSameTerm((E_SameTerm) expr);
    } else if (extensionSupports(expr)) {
      expr.getArg(1).visit(this);
      expr.getArg(2).visit(this);
      Expression e2 = expression.pop();
      Expression e1 = expression.pop();
     
      List<Expression> args = new ArrayList<Expression>(2);
     
      args.add(e1);
      args.add(e2);
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.expr.Expression

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.