org.apache.jena.query.Query.getAggregators()方法的使用及代码示例

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

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

Query.getAggregators介绍

暂无

代码示例

代码示例来源:origin: apache/tinkerpop

traversal = traversal.select(grpVar);
if (query.hasAggregators()) {
  final List<ExprAggregator> exprAgg = query.getAggregators();
  for (ExprAggregator expr : exprAgg) {
    if (expr.getAggregator().getName().contains("COUNT")) {

代码示例来源:origin: apache/jena

public boolean hasGroupBy()     { return ! groupVars.isEmpty() || getAggregators().size() > 0 ; }
public boolean hasHaving()      { return havingExprs != null && havingExprs.size() > 0 ; }

代码示例来源:origin: apache/jena

/**
 * Add all the aggregations from the other handler.
 * @param handler The other handler.
 * @return This handler for chaining.
 */
public AggregationHandler addAll(AggregationHandler handler)
{
  for (ExprAggregator agg : handler.query.getAggregators())
  {
    query.allocAggregate(agg.getAggregator());
  }
  for (Map.Entry<Var, ExprAggregator> entry : handler.aggMap.entrySet())
  {
    aggMap.put( entry.getKey(), entry.getValue());
  }
  return this;
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

/**
 * Add all the aggregations from the other handler.
 * @param handler The other handler.
 * @return This handler for chaining.
 */
public AggregationHandler addAll(AggregationHandler handler)
{
  for (ExprAggregator agg : handler.query.getAggregators())
  {
    query.allocAggregate(agg.getAggregator());
  }
  for (Map.Entry<Var, ExprAggregator> entry : handler.aggMap.entrySet())
  {
    aggMap.put( entry.getKey(), entry.getValue());
  }
  return this;
}

代码示例来源:origin: apache/jena

@Override
public void startVisit(Query query) {
  newQuery.setSyntax(query.getSyntax());
  if (query.explicitlySetBaseURI())
    newQuery.setBaseURI(query.getPrologue().getResolver());
  newQuery.setQueryResultStar(query.isQueryResultStar());
  if (query.hasDatasetDescription()) {
    DatasetDescription desc = query.getDatasetDescription();
    for (String x : desc.getDefaultGraphURIs())
      newQuery.addGraphURI(x);
    for (String x : desc.getDefaultGraphURIs())
      newQuery.addNamedGraphURI(x);
  }
  // Aggregators.
  newQuery.getAggregators().addAll(query.getAggregators());
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
public void startVisit(Query query) {
  newQuery.setSyntax(query.getSyntax()) ;
  if ( query.explicitlySetBaseURI() )
    newQuery.setBaseURI(query.getPrologue().getResolver()) ;
  newQuery.setQueryResultStar(query.isQueryResultStar()) ;
  if ( query.hasDatasetDescription() ) {
    DatasetDescription desc = query.getDatasetDescription() ;
    for (String x : desc.getDefaultGraphURIs())
      newQuery.addGraphURI(x) ;
    for (String x : desc.getDefaultGraphURIs())
      newQuery.addNamedGraphURI(x) ;
  }
  // Aggregators.
  newQuery.getAggregators().addAll(query.getAggregators()) ;
}

代码示例来源:origin: apache/jena

aggVarExprMap.put(v, eAgg) ;
}) ;
query.getAggregators().addAll(level.opGroup.getAggregators()) ;

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static long countQuery(Query query, QueryExecutionFactory qef) {
  boolean needsWrapping = !query.getGroupBy().isEmpty() || !query.getAggregators().isEmpty();

代码示例来源:origin: rdfhdt/hdt-java

public static Plan getPlan(HDTQueryEngine engine, Query query, DatasetGraph dataset, Binding input, Context context) {
  if(query.getAggregators().size()!=1)
    return null;	
  Aggregator ag = query.getAggregators().get(0).getAggregator();
  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;

代码示例来源:origin: apache/jena

op = OpGroup.create(op, query.getGroupBy(), query.getAggregators()) ;

相关文章