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

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

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

Query.allocInternVar介绍

暂无

代码示例

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

/** Add an to a SELECT query (a name will be created for it) */
public void addResultVar(Expr expr)
{
  _addVarExpr(projectVars, allocInternVar(), expr) ;
}

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

/** Add an to a SELECT query (a name will be created for it) */
public void addResultVar(Expr expr)
{
  _addVarExpr(projectVars, allocInternVar(), expr) ;
}

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

public Expr allocAggregate(Aggregator agg)
{
  // We need to track the aggregators in case one aggregator is used twice, e.g. in HAVING and in SELECT expression
  // (is is that much harm to do twice?  Yes, if distinct.)
  String key = agg.key() ;
  
  Var v = aggregatorsAllocated.get(key); 
  if ( v != null )
  {
    ExprAggregator eAgg = aggregatorsMap.get(v) ; 
    if ( ! agg.equals(eAgg.getAggregator()) )
      Log.warn(Query.class, "Internal inconsistency: Aggregator: "+agg) ;
    return eAgg ;
  }
  // Allocate.
  v = allocInternVar() ;
  ExprAggregator aggExpr = new ExprAggregator(v, agg) ;
  aggregatorsAllocated.put(key, v) ;
  aggregatorsMap.put(v, aggExpr) ;
  aggregators.add(aggExpr) ;
  return aggExpr ;
}

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

public Expr allocAggregate(Aggregator agg)
{
  // We need to track the aggregators in case one aggregator is used twice, e.g. in HAVING and in SELECT expression
  // (is that much harm to do twice?  Yes, if distinct.)
  String key = agg.key() ;
  
  Var v = aggregatorsAllocated.get(key); 
  if ( v != null )
  {
    ExprAggregator eAgg = aggregatorsMap.get(v) ; 
    if ( ! agg.equals(eAgg.getAggregator()) )
      Log.warn(Query.class, "Internal inconsistency: Aggregator: "+agg) ;
    return eAgg ;
  }
  // Allocate.
  v = allocInternVar() ;
  ExprAggregator aggExpr = new ExprAggregator(v, agg) ;
  aggregatorsAllocated.put(key, v) ;
  aggregatorsMap.put(v, aggExpr) ;
  aggregators.add(aggExpr) ;
  return aggExpr ;
}

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

/** Add a named expression to a SELECT query */
public void addResultVar(String varName, Expr expr)
{
  Var var = null ; 
  if ( varName == null )
    var = allocInternVar() ;
  else
  {
    varName = Var.canonical(varName) ;
    var = Var.alloc(varName) ;
  }
  _addVarExpr(projectVars, var, expr) ;
}

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

/** Add a named expression to a SELECT query */
public void addResultVar(String varName, Expr expr)
{
  Var var = null ; 
  if ( varName == null )
    var = allocInternVar() ;
  else
  {
    varName = Var.canonical(varName) ;
    var = Var.alloc(varName) ;
  }
  _addVarExpr(projectVars, var, expr) ;
}

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

public void addResultVar(Node v, Expr expr)
{
  Var var = null ; 
  if ( v == null )
    var = allocInternVar() ;
  else
  {
    if ( !v.isVariable() )
      throw new QueryException("Not a variable: "+v) ;
    var = Var.alloc(v) ;
  }
  _addVarExpr(projectVars, var, expr) ;
}

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

public void addResultVar(Node v, Expr expr)
{
  Var var = null ; 
  if ( v == null )
    var = allocInternVar() ;
  else
  {
    if ( !v.isVariable() )
      throw new QueryException("Not a variable: "+v) ;
    var = Var.alloc(v) ;
  }
  _addVarExpr(projectVars, var, expr) ;
}

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

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: org.apache.clerezza.ext/org.apache.jena.jena-arq

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) ;
}

相关文章