本文整理汇总了Java中org.apache.jena.sparql.expr.ExprList类的典型用法代码示例。如果您正苦于以下问题:Java ExprList类的具体用法?Java ExprList怎么用?Java ExprList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExprList类属于org.apache.jena.sparql.expr包,在下文中一共展示了ExprList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeIteratorPlan
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* Makes the plan for a SPARQL SELECTOR clause.
*
* @param elementIterator the SPARQL SELECTOR
* @return -
*/
static IteratorPlan makeIteratorPlan(
final ElementIterator elementIterator)
throws SPARQLGenerateException {
Objects.requireNonNull(elementIterator, "The Iterator must not be null");
Var var = elementIterator.getVar();
Expr expr = elementIterator.getExpr();
Objects.requireNonNull(var, "The variable of the Iterator must not be null");
Objects.requireNonNull(expr, "The Expr in the iterator must not be null");
checkIsTrue(expr.isFunction(), "Iterator should be a function:"
+ " <iri>(...) AS ?var");
ExprFunction function = expr.getFunction();
String iri = function.getFunctionIRI();
IteratorFunctionFactory factory = sr.get(iri);
if (factory == null) {
throw new SPARQLGenerateException("Unknown Iterator Function: " + iri);
}
IteratorFunction iterator = factory.create(iri);
ExprList exprList = new ExprList(function.getArgs());
iterator.build(exprList);
return new IteratorPlanImpl(iterator, exprList, var);
}
示例2: exec
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public void exec(
Binding binding, ExprList args, FunctionEnv env, Consumer<List<NodeValue>> nodeValuesStream) {
this.env = env;
if (args == null) {
throw new ARQInternalErrorException("IteratorFunctionBase:"
+ " Null args list");
}
List<NodeValue> evalArgs = new ArrayList<>();
for (Expr e : args) {
NodeValue x = e.eval(binding, env);
evalArgs.add(x);
}
exec(evalArgs, nodeValuesStream);
arguments = null;
}
示例3: normalize
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
private Expr normalize(ExprFunctionN func) {
ExprList args = new ExprList();
for (Expr expr : func.getArgs()) {
Expr arg = normalize(expr);
args.add(arg);
}
return func.copy(args);
}
示例4: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
if (args.size() != 1) {
throw new QueryBuildException("Selector '"
+ this.getClass().getName() + "' takes one argument");
}
}
示例5: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
if (args.size() != 3) {
throw new QueryBuildException("Selector '"
+ this.getClass().getName() + "' takes three arguments");
}
}
示例6: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
if (args.size() != 0) {
throw new QueryBuildException("Iterator function '"
+ this.getClass().getName() + "' takes no arguments");
}
}
示例7: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
if (args.size() != 5) {
throw new QueryBuildException("Selector '"
+ this.getClass().getName() + "' takes 5 arguments");
}
}
示例8: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
if (args.size() != 2) {
throw new QueryBuildException("Selector '"
+ this.getClass().getName() + "' takes two arguments");
}
}
示例9: executeBGP
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/** Execute a BGP (and filters) on a LDF graph, which may be in default storage or it may be a named graph */
private static QueryIterator executeBGP(LinkedDataFragmentGraph graph, OpBGP opBGP, QueryIterator input, ExprList exprs,
ExecutionContext execCxt)
{
// Execute a BGP on the real default graph
return optimizeExecuteTriples(graph, input, opBGP.getPattern(), exprs, execCxt) ;
}
示例10: accumulate
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/** Function called on each row in a group */
@Override
public void accumulate(Binding binding, FunctionEnv functionEnv) {
ExprList exprList = agg.getExprList() ;
for(Expr expr: exprList) {
try {
NodeValue nv = expr.eval(binding, functionEnv) ;
// Evaluation succeeded.
if ( nv.isLiteral())
count ++ ;
} catch (ExprEvalException ex) {}
}
}
示例11: exec
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public NodeValue exec(Binding binding, ExprList args, String uri, FunctionEnv env) {
if (args == null) {
throw new ARQInternalErrorException("ExpandPrefixFunction: Null args list");
}
if (args.size() != 1) {
throw new ExprEvalException("ExpandPrefixFunction: Wrong number of arguments: Wanted 1, got " + args.size());
}
return exec(args.get(0).eval(binding, env), env.getContext());
}
示例12: addExprToExprList
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
public boolean addExprToExprList() {
((ExprList) peek(1)).add((Expr) pop());
return true;
}
示例13: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public void checkBuild(String uri, ExprList args) {
if (args.size() != 6) {
throw new QueryBuildException("Function '" + Lib.className(this) + "' takes two arguments");
}
}
示例14: checkBuild
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void checkBuild(ExprList args) {
}
示例15: build
import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public void build(String uri, ExprList args) {
}