Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.TupleExpr


    @Override
    public void meet(Intersection intersection) {
      super.meet(intersection);

      TupleExpr leftArg = intersection.getLeftArg();
      TupleExpr rightArg = intersection.getRightArg();

      if (leftArg instanceof EmptySet) {
        intersection.replaceWith(leftArg);
      }
      else if (rightArg instanceof EmptySet) {
View Full Code Here


  @Override
  public void meet(LeftJoin node)
    throws RdbmsException
  {
    super.meet(node);
    TupleExpr l = node.getLeftArg();
    TupleExpr r = node.getRightArg();
    if (!(l instanceof SelectQuery && r instanceof SelectQuery)) {
      return;
    }
    SelectQuery left = (SelectQuery)l;
    SelectQuery right = (SelectQuery)r;
View Full Code Here

        return new Var(prefix + _varCount++, value);
    }
   
    public TupleExpr joinTupleExpressions() {
        Iterator<TupleExpr> i = _tupleExprs.iterator();
        TupleExpr result = i.hasNext() ? i.next() : null;
       
        while (i.hasNext()) {
            result = new Join(result, i.next());
        }
        return result;
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

          Var resultVar = (Var) expressionResult.valueExpr;
         
            ProjectionElemList projectionElements = new ProjectionElemList();
            projectionElements.addElement(new ProjectionElem(resultVar.getName()));
           
            TupleExpr t = builder.makeFilterTupleExpr();
            if (t == null) {
              // TODO[dfhuynh]: This happens if the expression is just "value". I'm not sure what to do here.
              return null;
            }
           
View Full Code Here

  }

  public GraphQueryResult evaluate()
    throws QueryEvaluationException
  {
    TupleExpr tupleExpr = getParsedQuery().getTupleExpr();

    try {
      SailConnection sailCon = getConnection().getSailConnection();
      CloseableIteration<? extends BindingSet, QueryEvaluationException> bindingsIter = sailCon.evaluate(
          tupleExpr, getActiveDataset(), getBindings(), getIncludeInferred());
View Full Code Here

  public boolean evaluate()
    throws QueryEvaluationException
  {
    ParsedBooleanQuery parsedBooleanQuery = getParsedQuery();
    TupleExpr tupleExpr = parsedBooleanQuery.getTupleExpr();
    Dataset dataset = getDataset();
    if (dataset == null) {
      // No external dataset specified, use query's own dataset (if any)
      dataset = parsedBooleanQuery.getDataset();
    }
View Full Code Here

    con.addStatement(foo, RDF.TYPE, bar);
    con.commit();

    ParsedTupleQuery query = QueryParserUtil.parseTupleQuery(QueryLanguage.SERQL,
        "SELECT X, P, Y FROM {X} P {Y}", null);
    TupleExpr tupleExpr = query.getTupleExpr();

    CloseableIteration<? extends BindingSet, QueryEvaluationException> iter = con.evaluate(tupleExpr, null,
        EmptyBindingSet.getInstance(), false);

    BindingSet bindingSet = iter.next();
View Full Code Here

  }

  public TupleQueryResult evaluate()
    throws QueryEvaluationException
  {
    TupleExpr tupleExpr = getParsedQuery().getTupleExpr();

    try {
      SailConnection sailCon = getConnection().getSailConnection();
      CloseableIteration<? extends BindingSet, QueryEvaluationException> bindingsIter = sailCon.evaluate(
          tupleExpr, getActiveDataset(), getBindings(), getIncludeInferred());

      return new TupleQueryResultImpl(new ArrayList<String>(tupleExpr.getBindingNames()), bindingsIter);
    }
    catch (SailException e) {
      throw new QueryEvaluationException(e.getMessage(), e);
    }
  }
View Full Code Here

  }

  private TupleExpr buildConstructor(TupleExpr bodyExpr, TupleExpr constructExpr, boolean explicit,
      boolean distinct)
  {
    TupleExpr result = bodyExpr;

    // Retrieve all StatementPattern's from the construct expression
    List<StatementPattern> statementPatterns = StatementPatternCollector.process(constructExpr);

    Set<Var> constructVars = getConstructVars(statementPatterns);
View Full Code Here

TOP

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

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.