Examples of Join


Examples of org.openrdf.query.algebra.Join

      if (attributes == null || attributes.size() == 0) {
        return;
      }

      // join of the attribute match expressions.
      Join joinOfAttributePatterns = new Join();

      URI inheritanceProp = getInheritanceProperty();
      Var inheritPredVar = new Var("-acl_inherit_pred", inheritanceProp);

      int i = 0;

      List<Var> attributeVars = new ArrayList<Var>();
      for (URI attribute : attributes) {
        Var attributeVar = new Var("-acl_attr_" + i++);
        attributeVars.add(attributeVar);

        Var attributePredVar = new Var("-acl_attr_pred_" + i, attribute);

        // SP(?subject, accessAttr_i, ?accessAttrValue_i)
        StatementPattern attributePattern = new StatementPattern(subjectVar, attributePredVar,
            attributeVar);

        if (inheritanceProp != null) {
          // create a union expression for this attribute.
          Union union = new Union();
          union.addArg(attributePattern);

          // the join for checking if the access attribute is inherited.
          Join inheritJoin = new Join();
          Var inheritVar = new Var("-acl_inherited_value" + i);
          // SP (?subject, inheritProp, ?S_i)
          StatementPattern inheritPattern = new StatementPattern(subjectVar, inheritPredVar, inheritVar);
          inheritJoin.addArg(inheritPattern);
          // SP (?S_i, accessAttr_i, ?accessAttrValue_i)
          StatementPattern inheritAttrPattern = new StatementPattern(inheritVar, attributePredVar,
              attributeVar);
          inheritJoin.addArg(inheritAttrPattern);

          union.addArg(inheritJoin);

          joinOfAttributePatterns.addArg(union);
        }
View Full Code Here

Examples of org.openrdf.query.algebra.Join

    }
    else if (requiredTEs.size() == 1) {
      result = requiredTEs.get(0);
    }
    else {
      result = new Join(requiredTEs);
    }

    for (TupleExpr optTE : optionalTEs) {
      result = new LeftJoin(result, optTE);
    }
View Full Code Here

Examples of org.openrdf.query.algebra.Join

          boundVars.addAll(tupleExpr.getBindingNames());
        }

        // Build new join hierarchy
        TupleExpr replacement = new Join(orderedJoinArgs);

        // Replace old join hierarchy
        node.replaceWith(replacement);
      }
      finally {
View Full Code Here

Examples of org.openrdf.query.algebra.Join

      }
    }

    protected <L extends List<TupleExpr>> L getJoinArgs(TupleExpr tupleExpr, L joinArgs) {
      if (tupleExpr instanceof Join) {
        Join join = (Join)tupleExpr;
        for (TupleExpr arg : join.getArgs()) {
          getJoinArgs(arg, joinArgs);
        }
      }
      else {
        joinArgs.add(tupleExpr);
View Full Code Here

Examples of org.openrdf.query.algebra.Join

    }
    else if (requiredTEs.size() == 1) {
      result = requiredTEs.get(0);
    }
    else {
      result = new Join(requiredTEs);
    }

    for (OptionalTupleExpr optTE : optionalTEs) {
      if (optTE.hasConstraint()) {
        result = new LeftJoin(result, optTE.getTupleExpr(), optTE.getConstraint());
View Full Code Here

Examples of org.openrdf.query.algebra.Join

    if (result == null) {
      result = sp;
    }
    else {
      result = new Join(result, sp);
    }

    List<SameTerm> sameTerms = new ArrayList<SameTerm>(2 * node.jjtGetNumChildren());

    for (int i = 0; i < node.jjtGetNumChildren(); i++) {
View Full Code Here

Examples of org.teiid.language.Join

        assertEquals(Join.JoinType.LEFT_OUTER_JOIN, example(JoinType.JOIN_LEFT_OUTER).getJoinType());
        assertEquals(Join.JoinType.RIGHT_OUTER_JOIN, example(JoinType.JOIN_RIGHT_OUTER).getJoinType());
    }

    public void testGetCriteria() throws Exception {
        Join join = example(JoinType.JOIN_INNER);
        assertTrue(join.getCondition() instanceof Comparison);
    }
View Full Code Here

Examples of org.teiid.language.Join

            joinType = Join.JoinType.FULL_OUTER_JOIN;
        } else if(join.getJoinType().equals(JoinType.JOIN_CROSS)) {
            joinType = Join.JoinType.CROSS_JOIN;
        }
       
        return new Join(translate(join.getLeftClause()),
                            translate(join.getRightClause()),
                            joinType,
                            translate(crit));
    }
View Full Code Here

Examples of org.teiid.language.Join

    return super.translate(obj, context);
  }

  public static void convertCrossJoinToInner(LanguageObject obj, LanguageFactory lf) {
    if (obj instanceof Join) {
      Join join = (Join)obj;
      if (join.getJoinType() == JoinType.CROSS_JOIN) {
        Literal one = lf.createLiteral(1, TypeFacility.RUNTIME_TYPES.INTEGER);
        join.setCondition(lf.createCompareCriteria(Operator.EQ, one, one));
        join.setJoinType(JoinType.INNER_JOIN);
      }
    }
  }
View Full Code Here

Examples of other.greeting.eventlisteners.Join

        return "other.greeting";
    }

    @Override
    protected void setCommands() {
        this.addEventListener(new Join(this));

        this.addMessageListener(new SetGreetingMessage(this));
        this.addMessageListener(new RemoveGreetingMessage(this));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.