Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.ValueExpr


      if (sameTerm.getParentNode() instanceof Filter) {
        // SameTerm applies to the filter's argument
        Filter filter = (Filter)sameTerm.getParentNode();

        ValueExpr leftArg = sameTerm.getLeftArg();
        ValueExpr rightArg = sameTerm.getRightArg();

        // Verify that vars are bound by filterArg
        Set<String> bindingNames = filter.getArg().getBindingNames();

        if (leftArg instanceof Var && !bindingNames.contains(((Var)leftArg).getName())
View Full Code Here


    public void meet(LeftJoin leftJoin) {
      super.meet(leftJoin);

      TupleExpr leftArg = leftJoin.getLeftArg();
      TupleExpr rightArg = leftJoin.getRightArg();
      ValueExpr condition = leftJoin.getCondition();

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

    // Create BNodeGenerator's for all anonymous variables
    Map<Var, ExtensionElem> extElemMap = new HashMap<Var, ExtensionElem>();

    for (Var var : constructVars) {
      if (var.isAnonymous() && !extElemMap.containsKey(var)) {
        ValueExpr valueExpr;

        if (var.hasValue()) {
          valueExpr = new ValueConstant(var.getValue());
        }
        else {
View Full Code Here

    }

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

    for (int i = 0; i < node.jjtGetNumChildren(); i++) {
      ValueExpr resource = (ValueExpr)node.jjtGetChild(i).jjtAccept(this, null);

      sameTerms.add(new SameTerm(subjVar.clone(), resource));
      sameTerms.add(new SameTerm(objVar.clone(), resource));
    }

    ValueExpr constraint = sameTerms.get(0);
    for (int i = 0; i < sameTerms.size(); i++) {
      constraint = new Or(constraint, sameTerms.get(i));
    }

    result = new Filter(result, constraint);
View Full Code Here

  @Override
  public OrderElem visit(ASTOrderCondition node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)node.jjtGetChild(0).jjtAccept(this, null);
    return new OrderElem(valueExpr, node.isAscending());
  }
View Full Code Here

    if (constraints.isEmpty()) {
      leftJoin = new LeftJoin(leftArg, rightArg);
    }
    else {
      ValueExpr constraint = constraints.get(0);
      for (int i = 1; i < constraints.size(); i++) {
        constraint = new And(constraint, constraints.get(i));
      }

      leftJoin = new LeftJoin(leftArg, rightArg, constraint);
View Full Code Here

    throws VisitorException
  {
    Var oldContext = graphPattern.getContextVar();
    Scope oldScope = graphPattern.getStatementPatternScope();

    ValueExpr newContext = (ValueExpr)node.jjtGetChild(0).jjtAccept(this, null);

    graphPattern.setContextVar(valueExpr2Var(newContext));
    graphPattern.setStatementPatternScope(Scope.NAMED_CONTEXTS);

    node.jjtGetChild(1).jjtAccept(this, null);
View Full Code Here

  @Override
  public Object visit(ASTPropertyList propListNode, Object data)
    throws VisitorException
  {
    ValueExpr subject = (ValueExpr)data;
    ValueExpr predicate = (ValueExpr)propListNode.getVerb().jjtAccept(this, null);
    @SuppressWarnings("unchecked")
    List<ValueExpr> objectList = (List<ValueExpr>)propListNode.getObjectList().jjtAccept(this, null);

    Var subjVar = valueExpr2Var(subject);
    Var predVar = valueExpr2Var(predicate);
View Full Code Here

    Var listVar = rootListVar;

    int childCount = node.jjtGetNumChildren();
    for (int i = 0; i < childCount; i++) {
      ValueExpr childValue = (ValueExpr)node.jjtGetChild(i).jjtAccept(this, null);

      Var childVar = valueExpr2Var(childValue);
      graphPattern.addRequiredSP(listVar, createConstVar(RDF.FIRST), childVar);

      Var nextListVar;
View Full Code Here

  @Override
  public Object visit(ASTConstraint node, Object data)
    throws VisitorException
  {
    ValueExpr valueExpr = (ValueExpr)super.visit(node, null);
    graphPattern.addConstraint(valueExpr);

    return null;
  }
View Full Code Here

TOP

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

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.