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


Java BindingSet.size方法代码示例

本文整理汇总了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;
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:27,代码来源:SailTripleSource.java

示例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);			
	}
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:39,代码来源:SparqlTripleSource.java

示例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;
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:8,代码来源:InsertBindingsIteration.java


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