Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.ValueExpr


    throws RdbmsException
  {
    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


      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

       
        if (!(result.valueExpr instanceof Var)) {
            throw new ExpressionException("Facet expression does not evaluate to a Var");
        }
       
        ValueExpr input = result.valueExpr;
        ValueExpr condition = null;
       
        if (_selectMissing) {
            // what do we do???
        }
        for (String v : _selection) {
View Full Code Here

        }
        return result;
    }
   
    public ValueExpr joinConditions() {
        ValueExpr expr = null;
       
        for (ValueExpr ve : _conditions) {
            expr = (expr == null) ? ve : new And(expr, ve);
        }
       
View Full Code Here

        return expr;
    }
   
    public TupleExpr makeFilterTupleExpr() {
        TupleExpr tupleExprs = joinTupleExpressions();
        ValueExpr conditions = joinConditions();
       
        return (conditions == null) ?
                tupleExprs :
                new Filter(tupleExprs, conditions);
    }
View Full Code Here

        TupleQueryBuilder       builder,
        Map<String, ValueExpr>  variableValues,
        Map<String, String>     variableTypes
    ) throws ExpressionException {
        String      rootName = _rootVariable != null ? _rootVariable : "value";
        ValueExpr   valueExpr = variableValues.get(rootName);
        String      valueType = variableTypes.get(rootName);
        for (PathSegment segment : _segments) {
            if (valueExpr instanceof Var) {
                Var input = (Var) valueExpr;
               
View Full Code Here

    // Create BNodeGenerator's for all anonymous variables
    Map<Var, ExtensionElem> extElemMap = new HashMap<Var, ExtensionElem>();

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

        if (var.hasValue()) {
          valueExpr = new ValueConstant(var.getValue());
        }
        else if (explicit) {
View Full Code Here

    if (constraints.isEmpty()) {
      optTE = new OptionalTupleExpr(tupleExpr);
    }
    else {
      ValueExpr constraint = constraints.get(0);
      for (int i = 1; i < constraints.size(); i++) {
        constraint = new And(constraint, constraints.get(i));
      }

      optTE = new OptionalTupleExpr(tupleExpr, constraint);
View Full Code Here

    Extension extension = new Extension();
    ProjectionElemList projElemList = new ProjectionElemList();

    for (ASTProjectionElem projElemNode : node.getProjectionElemList()) {
      ValueExpr valueExpr = (ValueExpr)projElemNode.getValueExpr().jjtAccept(this, null);

      String alias = projElemNode.getAlias();
      if (alias != null) {
        // aliased projection element
        extension.addElement(new ExtensionElem(valueExpr, alias));
View Full Code Here

    StatementPattern.Scope scope = StatementPattern.Scope.DEFAULT_CONTEXTS;
    Var contextVar = null;

    if (node.hasContextID()) {
      scope = StatementPattern.Scope.NAMED_CONTEXTS;
      ValueExpr contextID = (ValueExpr)node.getContextID().jjtAccept(this, null);

      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());
      }
    }

    graphPattern.setStatementPatternScope(scope);
    graphPattern.setContextVar(contextVar);
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.