当前位置: 首页>>代码示例>>Java>>正文


Java ExprList类代码示例

本文整理汇总了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);
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:32,代码来源:PlanFactory.java

示例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;
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:19,代码来源:IteratorStreamFunctionBase.java

示例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);
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:9,代码来源:ExprNormalizer.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:11,代码来源:IteratorStreamFunctionBase1.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:11,代码来源:IteratorFunctionBase3.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:11,代码来源:IteratorFunctionBase0.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:11,代码来源:IteratorStreamFunctionBase5.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:11,代码来源:IteratorStreamFunctionBase2.java

示例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) ;
}
 
开发者ID:LinkedDataFragments,项目名称:Client.Java,代码行数:8,代码来源:OpExecutorLDF.java

示例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) {}
    }
}
 
开发者ID:xcurator,项目名称:xcurator,代码行数:14,代码来源:CustomAggregate.java

示例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());
}
 
开发者ID:tarql,项目名称:tarql,代码行数:11,代码来源:ExpandPrefixFunction.java

示例12: addExprToExprList

import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
public boolean addExprToExprList() {
    ((ExprList) peek(1)).add((Expr) pop());
    return true;
}
 
开发者ID:IBCNServices,项目名称:OBEP,代码行数:5,代码来源:ParserUtils.java

示例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");
    }
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:7,代码来源:FUN_CustomCSV.java

示例14: checkBuild

import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void checkBuild(ExprList args) {
}
 
开发者ID:thesmartenergy,项目名称:sparql-generate,代码行数:7,代码来源:IteratorStreamFunctionBase4.java

示例15: build

import org.apache.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
   public void build(String uri, ExprList args) {
}
 
开发者ID:TopQuadrant,项目名称:shacl,代码行数:4,代码来源:AbstractFunction.java


注:本文中的org.apache.jena.sparql.expr.ExprList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。