com.hp.hpl.jena.query.Query.allocAggregate()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中com.hp.hpl.jena.query.Query.allocAggregate方法的一些代码示例,展示了Query.allocAggregate的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.allocAggregate方法的具体详情如下:
包路径:com.hp.hpl.jena.query.Query
类名称:Query
方法名:allocAggregate

Query.allocAggregate介绍

暂无

代码示例

代码示例来源:origin: com.hp.hpl.jena/arq

public void visit(OpGroup opGroup, Map<Var, Var> subs) {            
  List<ExprAggregator> a = opGroup.getAggregators();
  for (ExprAggregator ea : a) {
    // Substitute generated var for actual
    Var givenVar = ea.getAggVar().asVar();
    Var realVar = (subs.containsKey(givenVar))
    ? subs.get(givenVar)
    : givenVar;
    // Copy aggregator across (?)
    Expr myAggr = query.allocAggregate(ea.getAggregator());
    varExpression.put(realVar, myAggr);
    //query.addResultVar(realVar, myAggr);
  }
  VarExprList b = opGroup.getGroupVars();
  for (Var v : b.getVars()) {
    Expr e = b.getExpr(v);
    if (e != null) {
      query.addGroupBy(v, e);
    } else {
      query.addGroupBy(v);
    }
  }
  opGroup.getSubOp().visit(this);
}

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

@Override
public void visit(OpGroup opGroup) {               
  List<ExprAggregator> a = opGroup.getAggregators();
  
  // Aggregators are broken up in the algebra, split between a
  // group and an assignment (extend or assign) using a generated var.
  // We record them here and insert later.
  for (ExprAggregator ea : a) {
    // Substitute generated var for actual
    Var givenVar = ea.getAggVar().asVar();
    // Copy aggregator across (?)
    Expr myAggr = query.allocAggregate(ea.getAggregator());
    varExpression.put(givenVar, myAggr);
  }
  VarExprList b = opGroup.getGroupVars();
  for (Var v : b.getVars()) {
    Expr e = b.getExpr(v);
    if (e != null) {
      query.addGroupBy(v, e);
    } else {
      query.addGroupBy(v);
    }
  }
  groupDepth++;
  opGroup.getSubOp().visit(this);
  groupDepth--;
}

代码示例来源:origin: com.hp.hpl.jena/arq

throwParseException("Aggregate expression not legal at this point",
               t.beginLine, t.beginColumn) ;
 Expr exprAgg = getQuery().allocAggregate(agg) ;
 {if (true) return exprAgg ;}
throw new Error("Missing return statement in function");

代码示例来源:origin: com.hp.hpl.jena/arq

throwParseException("Aggregate expression not legal at this point",
               t.beginLine, t.beginColumn) ;
 Expr exprAgg = getQuery().allocAggregate(agg) ;
 {if (true) return exprAgg ;}
throw new Error("Missing return statement in function");

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

throwParseException("Aggregate expression not legal at this point",
               t.beginLine, t.beginColumn) ;
 Expr exprAgg = getQuery().allocAggregate(agg) ;
 {if (true) return exprAgg ;}
throw new Error("Missing return statement in function");

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

throwParseException("Aggregate expression not legal at this point",
               t.beginLine, t.beginColumn) ;
 Expr exprAgg = getQuery().allocAggregate(agg) ;
 {if (true) return exprAgg ;}
throw new Error("Missing return statement in function");

相关文章