本文整理汇总了Java中org.eclipse.rdf4j.query.BindingSet.size方法的典型用法代码示例。如果您正苦于以下问题:Java BindingSet.size方法的具体用法?Java BindingSet.size怎么用?Java BindingSet.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.rdf4j.query.BindingSet
的用法示例。
在下文中一共展示了BindingSet.size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatements
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public CloseableIteration<BindingSet, QueryEvaluationException> getStatements(
String preparedQuery, RepositoryConnection conn, final BindingSet bindings, final FilterValueExpr filterExpr)
throws RepositoryException, MalformedQueryException,
QueryEvaluationException {
TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, preparedQuery, null);
disableInference(query);
// evaluate the query
CloseableIteration<BindingSet, QueryEvaluationException> res = query.evaluate();
// apply filter and/or insert original bindings
if (filterExpr!=null) {
if (bindings.size()>0)
res = new FilteringInsertBindingsIteration(strategy, filterExpr, bindings, res);
else
res = new FilteringIteration(strategy, filterExpr, res);
if (!res.hasNext())
return new EmptyIteration<BindingSet, QueryEvaluationException>();
} else if (bindings.size()>0) {
res = new InsertBindingsIteration(res, bindings);
}
return res;
}
示例2: getStatements
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public CloseableIteration<BindingSet, QueryEvaluationException> getStatements(
String preparedQuery, RepositoryConnection conn, BindingSet bindings, FilterValueExpr filterExpr)
{
TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, preparedQuery, null);
//query.setMaxExecutionTime(10);
disableInference(query);
CloseableIteration<BindingSet, QueryEvaluationException> res=null;
try {
// evaluate the query
monitorRemoteRequest();
res = query.evaluate();
// apply filter and/or insert original bindings
if (filterExpr!=null) {
if (bindings.size()>0)
res = new FilteringInsertBindingsIteration(strategy, filterExpr, bindings, res);
else
res = new FilteringIteration(strategy, filterExpr, res);
if (!res.hasNext()) {
Iterations.closeCloseable(res);
return new EmptyIteration<BindingSet, QueryEvaluationException>();
}
} else if (bindings.size()>0) {
res = new InsertBindingsIteration(res, bindings);
}
// in order to avoid licking http route while iteration
return new BufferedCloseableIterator<BindingSet, QueryEvaluationException>(res);
} catch (QueryEvaluationException ex) {
Iterations.closeCloseable(res);
throw ExceptionUtil.traceExceptionSourceAndRepair(strategy.getFedXConnection().getEndpointManager(), conn, ex, "Subquery: " + preparedQuery);
}
}
示例3: convert
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
protected BindingSet convert(BindingSet bIn) throws QueryEvaluationException {
QueryBindingSet res = new QueryBindingSet(bindings.size() + bIn.size());
res.addAll(bindings);
res.addAll(bIn);
return res;
}