Package org.openrdf.query.algebra

Examples of org.openrdf.query.algebra.Var


    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);

    for (ValueExpr object : objectList) {
      Var objVar = valueExpr2Var(object);
      graphPattern.addRequiredSP(subjVar, predVar, objVar);
    }

    ASTPropertyList nextPropList = propListNode.getNextPropertyList();
    if (nextPropList != null) {
View Full Code Here


  @Override
  public Var visit(ASTBlankNodePropertyList node, Object data)
    throws VisitorException
  {
    Var bnodeVar = createAnonVar(node.getVarName());
    super.visit(node, bnodeVar);
    return bnodeVar;
  }
View Full Code Here

  @Override
  public Var visit(ASTCollection node, Object data)
    throws VisitorException
  {
    String listVarName = node.getVarName();
    Var rootListVar = createAnonVar(listVarName);

    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;
      if (i == childCount - 1) {
        nextListVar = createConstVar(RDF.NIL);
      }
      else {
        nextListVar = createAnonVar(listVarName + "-" + (i + 1));
View Full Code Here

  @Override
  public ValueExpr visit(ASTBound node, Object data)
    throws VisitorException
  {
    Var var = (Var)node.getArg().jjtAccept(this, null);
    return new Bound(var);
  }
View Full Code Here

  @Override
  public Var visit(ASTVar node, Object data)
    throws VisitorException
  {
    Var var = new Var(node.getName());
    var.setAnonymous(node.isAnonymous());
    return var;
  }
View Full Code Here

  @Override
  public void meet(StatementPattern sp)
    throws RdbmsException
  {
    super.meet(sp);
    Var subjVar = sp.getSubjectVar();
    Var predVar = sp.getPredicateVar();
    Var objVar = sp.getObjectVar();
    Var ctxVar = sp.getContextVar();

    Value subjValue = getVarValue(subjVar, bindings);
    Value predValue = getVarValue(predVar, bindings);
    Value objValue = getVarValue(objVar, bindings);
    Value ctxValue = getVarValue(ctxVar, bindings);
View Full Code Here

    @Override
    public Scriptable getComponentState() {
        _logger.debug("> getComponentState");
        TupleQueryBuilder builder = new TupleQueryBuilder();
        Var itemVar = getCollection().getRestrictedItems(builder, null);

        String key = "tile-view-rendering:" + builder.getStringSerialization();
        _logger.debug("component: " + key);
        Scriptable result = (Scriptable)
          _context.getDatabase().cacheAndRun(key, new ViewRenderingCacheableQuery(builder, itemVar));
View Full Code Here

            _conditions.add(e);
        }
    }
   
    public Var makeVar(String prefix) {
        return new Var(prefix + _varCount++);
    }
View Full Code Here

    public Var makeVar(String prefix) {
        return new Var(prefix + _varCount++);
    }
   
    public Var makeVar(String prefix, Value value) {
        return new Var(prefix + _varCount++, value);
    }
View Full Code Here

        Database database,
        SailRepositoryConnection connection
    ) throws ExpressionException {
       
        TupleQueryBuilder builder = new TupleQueryBuilder();
        Var valueVar = builder.makeVar("value", value);
       
    ExpressionResult expressionResult = computeOutputOnItem(database, builder, valueVar);
        if (expressionResult.valueExpr instanceof Var) {
          Var resultVar = (Var) expressionResult.valueExpr;
         
            ProjectionElemList projectionElements = new ProjectionElemList();
            projectionElements.addElement(new ProjectionElem(resultVar.getName()));
           
            TupleExpr t = builder.makeFilterTupleExpr();
            if (t == null) {
              // TODO[dfhuynh]: This happens if the expression is just "value". I'm not sure what to do here.
              return null;
View Full Code Here

TOP

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

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.