Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.TupleExpr


  @Override
  public TupleExpr visit(ASTTupleIntersect node, Object data)
    throws VisitorException
  {
    TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null);
    TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null);

    return new Intersection(leftArg, rightArg);
  }
View Full Code Here


  @Override
  public TupleExpr visit(ASTGraphUnion node, Object data)
    throws VisitorException
  {
    TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null);
    TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null);

    TupleExpr result = new Union(leftArg, rightArg);

    if (node.isDistinct()) {
      result = new Distinct(result);
    }
View Full Code Here

  @Override
  public TupleExpr visit(ASTGraphMinus node, Object data)
    throws VisitorException
  {
    TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null);
    TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null);

    return new Difference(leftArg, rightArg);
  }
View Full Code Here

  @Override
  public TupleExpr visit(ASTGraphIntersect node, Object data)
    throws VisitorException
  {
    TupleExpr leftArg = (TupleExpr)node.getLeftArg().jjtAccept(this, null);
    TupleExpr rightArg = (TupleExpr)node.getRightArg().jjtAccept(this, null);

    return new Intersection(leftArg, rightArg);
  }
View Full Code Here

  @Override
  public TupleExpr visit(ASTSelectQuery node, Object data)
    throws VisitorException
  {
    TupleExpr tupleExpr;

    ASTQueryBody queryBodyNode = node.getQueryBody();

    if (queryBodyNode != null) {
      // Build tuple expression for query body
View Full Code Here

  @Override
  public TupleExpr visit(ASTSelect node, Object data)
    throws VisitorException
  {
    TupleExpr result = (TupleExpr)data;

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

    for (ASTProjectionElem projElemNode : node.getProjectionElemList()) {
View Full Code Here

  @Override
  public TupleExpr visit(ASTConstructQuery node, Object data)
    throws VisitorException
  {
    TupleExpr tupleExpr;

    if (node.hasQueryBody()) {
      // Build tuple expression for query body
      tupleExpr = (TupleExpr)node.getQueryBody().jjtAccept(this, null);
    }
    else {
      tupleExpr = new SingletonSet();
    }

    // Create constructor
    ConstructorBuilder cb = new ConstructorBuilder();
    ASTConstruct constructNode = node.getConstructClause();

    if (!constructNode.isWildcard()) {
      TupleExpr constructExpr = (TupleExpr)constructNode.jjtAccept(this, null);
      tupleExpr = cb.buildConstructor(tupleExpr, constructExpr, constructNode.isDistinct());
    }
    else if (node.hasQueryBody()) {
      tupleExpr = cb.buildConstructor(tupleExpr, constructNode.isDistinct());
    }
View Full Code Here

  @Override
  public CompareAny visit(ASTCompareAny node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    TupleExpr tupleExpr = (TupleExpr)node.getRightOperand().jjtAccept(this, null);
    CompareOp op = node.getOperator().getValue();

    return new CompareAny(valueExpr, tupleExpr, op);
  }
View Full Code Here

  }

  public TupleExpr optimize(TupleExpr expr, Dataset dataset, BindingSet bindings, EvaluationStrategy strategy)
  {
    // Clone the tuple expression to allow for more aggressive optimisations
    TupleExpr tupleExpr = expr.clone();

    if (!(tupleExpr instanceof QueryRoot)) {
      // Add a dummy root node to the tuple expressions to allow the
      // optimisers to modify the actual root node
      tupleExpr = new QueryRoot(tupleExpr);
View Full Code Here

  protected CloseableIteration<BindingSet, QueryEvaluationException> evaluateInternal(
      TupleExpr expr, Dataset dataset, BindingSet bindings,
      boolean includeInferred) throws SailException {
    triples.flush();
    try {
      TupleExpr tupleExpr;
      EvaluationStrategy strategy;
      strategy = factory.createRdbmsEvaluation(dataset);
      tupleExpr = optimizer.optimize(expr, dataset, bindings, strategy);
      return strategy.evaluate(tupleExpr, bindings);
    } catch (QueryEvaluationException e) {
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.