本文整理了Java中com.hp.hpl.jena.query.Query.allocInternVar
方法的一些代码示例,展示了Query.allocInternVar
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.allocInternVar
方法的具体详情如下:
包路径:com.hp.hpl.jena.query.Query
类名称: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) ;
}
内容来源于网络,如有侵权,请联系作者删除!