本文整理了Java中org.apache.jena.query.Query.getHavingExprs
方法的一些代码示例,展示了Query.getHavingExprs
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getHavingExprs
方法的具体详情如下:
包路径:org.apache.jena.query.Query
类名称:Query
方法名:getHavingExprs
暂无
代码示例来源:origin: apache/jena
@Override
public void visitHaving(Query query1)
{
check("HAVING", query1.getHavingExprs(), query2.getHavingExprs()) ;
}
代码示例来源:origin: apache/jena
@Override
public void visitHaving(Query query)
{
if ( query.hasHaving() )
x ^= query.getHavingExprs().hashCode() ;
}
代码示例来源:origin: apache/jena
@Override
public void visitHaving(Query query) {
if (query.hasHaving()) {
for (Expr expr : query.getHavingExprs())
newQuery.addHavingCondition(expr);
}
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@Override
public void visitHaving(Query query) {
if ( query.hasHaving() ) {
for (Expr expr : query.getHavingExprs())
newQuery.addHavingCondition(expr) ;
}
}
代码示例来源:origin: apache/jena
/**
* Copy all the modifications from the Solution Modifier argument
* @param solutionModifier The solution modifier to copy from.
*/
public void addAll(SolutionModifierHandler solutionModifier) {
List<SortCondition> lst = solutionModifier.query.getOrderBy();
if (lst != null) {
for (SortCondition sc : lst) {
query.addOrderBy(sc);
}
}
query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
query.setLimit(solutionModifier.query.getLimit());
query.setOffset(solutionModifier.query.getOffset());
}
代码示例来源:origin: TopQuadrant/shacl
ElementTransform eltrans = new ElementTransformSubst(substitutions) ;
ExprTransform exprTrans = new ExprTransformNodeElement(nodeTransform, eltrans) ;
List<Expr> havingExprs = result.getHavingExprs();
for(int i = 0; i < havingExprs.size(); i++) {
Expr old = havingExprs.get(i);
代码示例来源:origin: ch.epfl.bluebrain.nexus.org.topbraid/shacl
ElementTransform eltrans = new ElementTransformSubst(substitutions) ;
ExprTransform exprTrans = new ExprTransformNodeElement(nodeTransform, eltrans) ;
List<Expr> havingExprs = result.getHavingExprs();
for(int i = 0; i < havingExprs.size(); i++) {
Expr old = havingExprs.get(i);
代码示例来源:origin: org.apache.jena/jena-querybuilder
/**
* Copy all the modifications from the Solution Modifier argument
* @param solutionModifier The solution modifier to copy from.
*/
public void addAll(SolutionModifierHandler solutionModifier) {
List<SortCondition> lst = solutionModifier.query.getOrderBy();
if (lst != null) {
for (SortCondition sc : lst) {
query.addOrderBy(sc);
}
}
query.getGroupBy().addAll(solutionModifier.query.getGroupBy());
query.getHavingExprs().addAll(solutionModifier.query.getHavingExprs());
query.setLimit(solutionModifier.query.getLimit());
query.setOffset(solutionModifier.query.getOffset());
}
代码示例来源:origin: apache/jena
@Override
public void setVars(Map<Var, Node> values) {
if (values.isEmpty()) {
return;
}
ExprRewriter exprRewriter = new ExprRewriter(values);
ExprList having = exprRewriter.rewrite(new ExprList(query
.getHavingExprs()));
List<SortCondition> orderBy = exprRewriter
.rewriteSortConditionList(query.getOrderBy());
VarExprList groupBy = exprRewriter.rewrite(query.getGroupBy());
query.getHavingExprs().clear();
query.getHavingExprs().addAll(having.getList());
if (orderBy != null) {
if (query.getOrderBy() == null) {
for (SortCondition sc : orderBy) {
query.addOrderBy(sc);
}
} else {
query.getOrderBy().clear();
query.getOrderBy().addAll(orderBy);
}
}
query.getGroupBy().clear();
query.getGroupBy().addAll(groupBy);
}
代码示例来源:origin: org.apache.jena/jena-querybuilder
@Override
public void setVars(Map<Var, Node> values) {
if (values.isEmpty()) {
return;
}
ExprRewriter exprRewriter = new ExprRewriter(values);
ExprList having = exprRewriter.rewrite(new ExprList(query
.getHavingExprs()));
List<SortCondition> orderBy = exprRewriter
.rewriteSortConditionList(query.getOrderBy());
VarExprList groupBy = exprRewriter.rewrite(query.getGroupBy());
query.getHavingExprs().clear();
query.getHavingExprs().addAll(having.getList());
if (orderBy != null) {
if (query.getOrderBy() == null) {
for (SortCondition sc : orderBy) {
query.addOrderBy(sc);
}
} else {
query.getOrderBy().clear();
query.getOrderBy().addAll(orderBy);
}
}
query.getGroupBy().clear();
query.getGroupBy().addAll(groupBy);
}
代码示例来源:origin: apache/jena
@Override
public void visitHaving(Query query)
{
if ( query.hasHaving() )
{
out.print("HAVING") ;
for (Expr expr : query.getHavingExprs())
{
out.print(" ") ;
fmtExpr.format(expr) ;
}
out.println() ;
}
}
代码示例来源:origin: apache/jena
level.opHaving.getExprs().getList().forEach(expr -> {
expr = rewrite(expr, varToExpr) ;
query.getHavingExprs().add(expr) ;
}) ;
代码示例来源:origin: apache/jena
/** Transform a query using {@link ElementTransform} and {@link ExprTransform}.
* It is the responsibility of these transforms to transform to a legal SPARQL query.
*/
public static Query transform(Query query, ElementTransform transform, ExprTransform exprTransform) {
Query q2 = QueryTransformOps.shallowCopy(query);
// "Shallow copy with transform."
transformVarExprList(q2.getProject(), exprTransform);
transformVarExprList(q2.getGroupBy(), exprTransform);
transformExprList(q2.getHavingExprs(), exprTransform);
if (q2.getOrderBy() != null) {
transformSortConditions(q2.getOrderBy(), exprTransform);
}
// ?? DOES NOT WORK: transformExprListAgg(q2.getAggregators(), exprTransform) ; ??
// if ( q2.hasHaving() ) {}
// if ( q2.hasAggregators() ) {}
Element el = q2.getQueryPattern();
Element el2 = ElementTransformer.transform(el, transform, exprTransform);
// Top level is always a group.
if (!(el2 instanceof ElementGroup)) {
ElementGroup eg = new ElementGroup();
eg.addElement(el2);
el2 = eg;
}
q2.setQueryPattern(el2);
return q2;
}
代码示例来源:origin: apache/jena
for (Expr expr : query.getHavingExprs())
代码示例来源:origin: rdfhdt/hdt-java
if(ag==null || !query.getHavingExprs().isEmpty() || !query.getGroupBy().isEmpty() || query.hasLimit() || query.hasOffset() || !( (ag instanceof AggCount) || (ag instanceof AggCountVar) || (ag instanceof AggCountDistinct) || (ag instanceof AggCountVarDistinct)) ) {
return null;
内容来源于网络,如有侵权,请联系作者删除!