本文整理了Java中org.apache.jena.query.Query.addGroupBy
方法的一些代码示例,展示了Query.addGroupBy
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.addGroupBy
方法的具体详情如下:
包路径:org.apache.jena.query.Query
类名称:Query
方法名:addGroupBy
暂无
代码示例来源:origin: apache/jena
/**
* Add an expression to the group by clause.
* @param expr The expression to add.
*/
public void addGroupBy(Expr expr) {
query.addGroupBy(expr);
}
代码示例来源:origin: apache/jena
/**
* Add a node to the group by clause.
* @param var The variable to add.
*/
public void addGroupBy(Var var) {
query.addGroupBy(var);
}
代码示例来源:origin: org.apache.jena/jena-querybuilder
/**
* Add a node to the group by clause.
* @param var The variable to add.
*/
public void addGroupBy(Var var) {
query.addGroupBy(var);
}
代码示例来源:origin: apache/jena
/**
* Add var and expression to the group by clause.
* @param var The variable to add.
* @param expr The expression to add.
*/
public void addGroupBy(Var var, Expr expr) {
query.addGroupBy(var, expr);
}
代码示例来源:origin: org.apache.jena/jena-querybuilder
/**
* Add var and expression to the group by clause.
* @param var The variable to add.
* @param expr The expression to add.
*/
public void addGroupBy(Var var, Expr expr) {
query.addGroupBy(var, expr);
}
代码示例来源:origin: org.apache.jena/jena-querybuilder
/**
* Add an expression to the group by clause.
* @param expr The expression to add.
*/
public void addGroupBy(Expr expr) {
query.addGroupBy(expr);
}
代码示例来源:origin: apache/jena
public void addGroupBy(Expr expr) { addGroupBy(null, expr) ; }
代码示例来源:origin: apache/jena
public void addGroupBy(String varName)
{
varName = Var.canonical(varName) ;
addGroupBy(Var.alloc(varName)) ;
}
代码示例来源:origin: apache/jena
@Override
public void visitGroupBy(Query query) {
if (query.hasGroupBy()) {
VarExprList x = query.getGroupBy();
for (Var v : x.getVars()) {
Expr expr = x.getExpr(v);
if (expr == null)
newQuery.addGroupBy(v);
else
newQuery.addGroupBy(v, expr);
}
}
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@Override
public void visitGroupBy(Query query) {
if ( query.hasGroupBy() ) {
VarExprList x = query.getGroupBy() ;
for (Var v : x.getVars()) {
Expr expr = x.getExpr(v) ;
if ( expr == null )
newQuery.addGroupBy(v) ;
else
newQuery.addGroupBy(v, expr) ;
}
}
}
代码示例来源:origin: apache/jena
public void addGroupBy(Var v, Expr expr)
{
if ( v == null )
v = allocInternVar() ;
if ( expr.isVariable() && v.isAllocVar() )
{
// It was (?x) with no AS - keep the name by adding by variable.
addGroupBy(expr.asVar()) ;
return ;
}
groupVars.add(v, expr) ;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@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);
}
}
opGroup.getSubOp().visit(this);
}
代码示例来源:origin: apache/jena
case SHA512:
expr = BuiltInCall();
getQuery().addGroupBy((Var)null, expr) ;
break;
case IRIref:
case PNAME_LN:
expr = FunctionCall();
getQuery().addGroupBy((Var)null, expr) ;
break;
case LPAREN:
getQuery().addGroupBy(v ,expr) ;
break;
case VAR1:
case VAR2:
v = Var();
getQuery().addGroupBy(v) ;
break;
default:
代码示例来源:origin: apache/jena
case SHA512:
expr = BuiltInCall();
getQuery().addGroupBy((Var)null, expr) ;
break;
case IRIref:
case PNAME_LN:
expr = FunctionCall();
getQuery().addGroupBy((Var)null, expr) ;
break;
case LPAREN:
getQuery().addGroupBy(v ,expr) ;
break;
case VAR1:
case VAR2:
v = Var();
getQuery().addGroupBy(v) ;
break;
default:
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
pa.add(cnta, new ExprAggregator(Vars.x, new AggCountVar(targetEv)));
qa.setQueryPattern(roleElement);
qa.addGroupBy(sourceVar);
qb.addGroupBy(sourceVar);
qb.addGroupBy(targetVar);
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
pa.add(cnta, new ExprAggregator(Vars.x, new AggCountVar(targetEv)));
qa.setQueryPattern(roleElement);
qa.addGroupBy(sourceVar);
qb.addGroupBy(sourceVar);
内容来源于网络,如有侵权,请联系作者删除!