Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.TupleExpr


    return Collections.unmodifiableList(requiredTEs);
  }

  public void addOptionalTE(GraphPattern gp) {
    List<ValueExpr> constraints = gp.removeAllConstraints();
    TupleExpr tupleExpr = gp.buildTupleExpr();

    OptionalTupleExpr optTE;

    if (constraints.isEmpty()) {
      optTE = new OptionalTupleExpr(tupleExpr);
View Full Code Here


   * constraints in this graph pattern.
   *
   * @return A tuple expression for this graph pattern.
   */
  public TupleExpr buildTupleExpr() {
    TupleExpr result;

    if (requiredTEs.isEmpty()) {
      result = new SingletonSet();
    }
    else {
View Full Code Here

      StringEscapesProcessor.process(qc);
      BaseDeclProcessor.process(qc, baseURI);
      Map<String, String> prefixes = PrefixDeclProcessor.process(qc);
      WildcardProjectionProcessor.process(qc);
      BlankNodeVarProcessor.process(qc);
      TupleExpr tupleExpr = buildQueryModel(qc);

      ParsedQuery query;

      ASTQuery queryNode = qc.getQuery();
      if (queryNode instanceof ASTSelectQuery) {
View Full Code Here

      super.meet(filter);

      List<ValueExpr> conjunctiveConstraints = new ArrayList<ValueExpr>(16);
      getConjunctiveConstraints(filter.getCondition(), conjunctiveConstraints);

      TupleExpr filterArg = filter.getArg();

      for (int i = conjunctiveConstraints.size() - 1; i >= 1; i--) {
        Filter newFilter = new Filter(filterArg, conjunctiveConstraints.get(i));
        filterArg = newFilter;
      }
View Full Code Here

  @Override
  public CompareAll visit(ASTCompareAll 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 CompareAll(valueExpr, tupleExpr, op);
  }
View Full Code Here

  @Override
  public In visit(ASTIn node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.getLeftOperand().jjtAccept(this, null);
    TupleExpr tupleExpr = (TupleExpr)node.getRightOperand().jjtAccept(this, null);
    return new In(valueExpr, tupleExpr);
  }
View Full Code Here

      qc.jjtAccept(new ProjectionAliasProcessor(), null);
      qc.jjtAccept(new AnonymousVarGenerator(), null);

      // TODO: check use of unbound variables?

      TupleExpr tupleExpr = QueryModelBuilder.buildQueryModel(qc, new ValueFactoryImpl());

      ASTQuery queryNode = qc.getQuery();
      ParsedQuery query;
      if (queryNode instanceof ASTTupleQuery) {
        query = new ParsedTupleQuery(tupleExpr);
View Full Code Here

    con.addStatement(picasso, paints, guernica, context1);
    con.commit();

    ParsedTupleQuery tupleQuery = QueryParserUtil.parseTupleQuery(QueryLanguage.SERQL,
        "select X from {X} rdf:type {Y} rdf:type {rdfs:Class}", null);
    TupleExpr tupleExpr = tupleQuery.getTupleExpr();

    MapBindingSet bindings = new MapBindingSet(1);

    CloseableIteration<? extends BindingSet, QueryEvaluationException> iter;
    iter = con.evaluate(tupleExpr, null, bindings, false);
View Full Code Here

  @Override
  public TupleExpr visit(ASTTupleUnion 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(ASTTupleMinus 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

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.