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 || rightArg instanceof EmptySet) {
        intersection.replaceWith(leftArg);
      }
    }
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

    throws VisitorException
  {
    // Start with building the graph pattern
    graphPattern = new GraphPattern();
    node.getWhereClause().jjtAccept(this, null);
    TupleExpr tupleExpr = graphPattern.buildTupleExpr();

    // Apply result ordering
    ASTOrderClause orderNode = node.getOrderClause();
    if (orderNode != null) {
      List<OrderElem> orderElemements = (List<OrderElem>)orderNode.jjtAccept(this, null);
View Full Code Here

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

    ProjectionElemList projElemList = new ProjectionElemList();

    for (int i = 0; i < node.jjtGetNumChildren(); i++) {
      Var projVar = (Var)node.jjtGetChild(i).jjtAccept(this, null);
View Full Code Here

    throws VisitorException
  {
    // Start with building the graph pattern
    graphPattern = new GraphPattern();
    node.getWhereClause().jjtAccept(this, null);
    TupleExpr tupleExpr = graphPattern.buildTupleExpr();

    // Apply result ordering
    ASTOrderClause orderNode = node.getOrderClause();
    if (orderNode != null) {
      List<OrderElem> orderElemements = (List<OrderElem>)orderNode.jjtAccept(this, null);
View Full Code Here

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

    // Collect construct triples
    graphPattern = new GraphPattern();
    super.visit(node, null);
    TupleExpr constructExpr = graphPattern.buildTupleExpr();

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

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

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

    if (node.getWhereClause() != null) {
      // Start with building the graph pattern
      graphPattern = new GraphPattern();
      node.getWhereClause().jjtAccept(this, null);
View Full Code Here

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

    // Create a graph query that produces the statements that have the
    // requests resources as subject or object
    Var subjVar = createAnonVar("-descr-subj");
    Var predVar = createAnonVar("-descr-pred");
View Full Code Here

  {
    graphPattern = new GraphPattern();

    super.visit(node, null);

    TupleExpr tupleExpr = graphPattern.buildTupleExpr();
    tupleExpr = new Slice(tupleExpr, 0, 1);

    return tupleExpr;
  }
View Full Code Here

    super.visit(node, null);

    // Optional constraints also apply to left hand side of operator
    List<ValueExpr> constraints = graphPattern.removeAllConstraints();

    TupleExpr leftArg = parentGP.buildTupleExpr();
    TupleExpr rightArg = graphPattern.buildTupleExpr();

    LeftJoin leftJoin;

    if (constraints.isEmpty()) {
      leftJoin = new LeftJoin(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.