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

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

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

Query.getGroupBy介绍

暂无

代码示例

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

@Override
public void visitGroupBy(Query query1)
{
  check("GROUP BY", query1.getGroupBy(), query2.getGroupBy()) ;
}

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

public void visitGroupBy(Query query1)
{
  check("GROUP BY", query1.getGroupBy(), query2.getGroupBy()) ;
}

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

@Override
public void visitGroupBy(Query query)
{
  if ( query.hasGroupBy() )
    x ^= query.getGroupBy().hashCode() ;
}

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

public void visitGroupBy(Query query)
{
  if ( query.hasGroupBy() )
    x ^= query.getGroupBy().hashCode() ;
}

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

@Override
public void visitGroupBy(Query query)
{
  if ( query.hasGroupBy() )
  {
    // Can have an empty GROUP BY list if the groupin gis implicit
    // by use of an aggregate in the SELECT clause.
    if ( ! query.getGroupBy().isEmpty() )
    {
      out.print("GROUP BY ") ;
      appendNamedExprList(query, out, query.getGroupBy()) ;
      out.println();
    }
  }
}

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

public void visitGroupBy(Query query)
{
  if ( query.hasGroupBy() )
  {
    // Can have an empty GROUP BY list if the groupin gis implicit
    // by use of an aggregate in the SELECT clause.
    if ( ! query.getGroupBy().isEmpty() )
    {
      out.print("GROUP BY ") ;
      appendNamedExprList(query, out, query.getGroupBy()) ;
      out.println();
    }
  }
}

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

public static void check(Query query)
{
  if ( query.getQueryPattern() == null )
    // DESCRIBE may not have a pattern
    return ;
  // And now check down the element for subqueries.
  LinkedHashSet<Var> queryVars = new LinkedHashSet<Var>() ;
  
  PatternVarsVisitorChecker visitor = new PatternVarsVisitorChecker(queryVars) ;
  PatternVars.vars(query.getQueryPattern(), visitor) ;
  queryVars.addAll(query.getGroupBy().getVars()) ;
  
  check(query, queryVars) ;
}

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

@Override
public void visit(ElementSubQuery el)
{
  el.getQuery().setResultVars() ;
  VarExprList x = el.getQuery().getProject() ;
  acc.addAll(x.getVars()) ;
  
  // And any GROUP BY 
  x = el.getQuery().getGroupBy() ;
  acc.addAll(x.getVars()) ;
  
}

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

VarExprList groupKey = query.getGroupBy() ;

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

VarExprList groupKey = query.getGroupBy() ;
List<Var> groupVars = groupKey.getVars() ;
VarExprList exprList = query.getProject() ;

代码示例来源:origin: Quetzal-RDF/quetzal

/**
 * returns all variables mentioned in a query
 * @param query
 * @return
 */
public static Set<Var> getAllVariables(Query query) {
    Set<Var> vars=  getAllVariables(query.getQueryPattern());
    if (query.hasGroupBy() && query.getGroupBy()!=null && query.getGroupBy().getExprs()!=null) {
      for (Map.Entry<Var, Expr> e: query.getGroupBy().getExprs().entrySet()) {
        vars.add(e.getKey());
        ExprVars.varsMentioned(vars, e.getValue());
      }
    }
    if (query.hasHaving() && query.getHavingExprs()!=null) {
      for (Expr e: query.getHavingExprs()) {
        ExprVars.varsMentioned(vars, e);
      }
    }
    
    if (query.hasAggregators() && query.getAggregators()!=null) {
      for (ExprAggregator e: query.getAggregators()) {
        ExprVars.varsMentioned(vars, e);
      }
    }
    for (String v: query.getResultVars()) {
      vars.add(Var.alloc(v));
    }
    return vars;
}

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

private static void check(Query query, Collection<Var> vars)
{
  // Check any expressions are assigned to fresh variables.
  checkExprListAssignment(vars, query.getProject()) ;
  
  // Check for SELECT * GROUP BY
  // Legal in ARQ, not in SPARQL 1.1
  if ( ! Syntax.syntaxARQ.equals(query.getSyntax()) )
  {
    if ( query.isQueryResultStar() && query.hasGroupBy() )
      throw new QueryParseException("SELECT * not legal with GROUP BY", -1 , -1) ;
  }
  
  // Check any variable in an expression is in scope (if GROUP BY) 
  checkExprVarUse(query) ;
  
  // Check GROUP BY AS 
  // ENABLE
  if ( false && query.hasGroupBy() )
  {
    VarExprList exprList2 = query.getGroupBy() ;
    checkExprListAssignment(vars, exprList2) ;
  // CHECK 
  }
  
}

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

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

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

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

相关文章