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


Java BindingSet.iterator方法代码示例

本文整理汇总了Java中org.eclipse.rdf4j.query.BindingSet.iterator方法的典型用法代码示例。如果您正苦于以下问题:Java BindingSet.iterator方法的具体用法?Java BindingSet.iterator怎么用?Java BindingSet.iterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.rdf4j.query.BindingSet的用法示例。


在下文中一共展示了BindingSet.iterator方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: select

import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public CloseableIteration<BindingSet, QueryEvaluationException> select(Service service, Set<String> projectionVars, BindingSet bindings, String baseUri) throws QueryEvaluationException {
	RepositoryConnection conn = endpoint.getConn();
	try {
		TupleQuery query = conn.prepareTupleQuery(QueryLanguage.SPARQL, service.getSelectQueryString(projectionVars), baseUri);
		Iterator<Binding> bIter = bindings.iterator();
		while (bIter.hasNext()) {
			Binding b = bIter.next();
			if (service.getServiceVars().contains(b.getName()))
				query.setBinding(b.getName(), b.getValue());
		}
		TupleQueryResult qRes = query.evaluate();
		return new InsertBindingsIteration(qRes, bindings);
	} catch(Throwable e) {
		throw new QueryEvaluationException(e);
	} finally {
		conn.close();
	}
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:20,代码来源:SAILFederatedService.java

示例2: ask

import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public boolean ask(Service service, BindingSet bindings, String baseUri) throws QueryEvaluationException {
	RepositoryConnection conn = endpoint.getConn();
	try {
		BooleanQuery query = conn.prepareBooleanQuery(QueryLanguage.SPARQL, service.getAskQueryString(), baseUri);
		Iterator<Binding> bIter = bindings.iterator();
		while (bIter.hasNext()) {
			Binding b = bIter.next();
			if (service.getServiceVars().contains(b.getName()))
				query.setBinding(b.getName(), b.getValue());
		}
		return query.evaluate();
	} catch(Throwable e) {
		throw new QueryEvaluationException(e);
	} finally {
		conn.close();
	}
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:19,代码来源:SAILFederatedService.java

示例3: convert

import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
protected BindingSet convert(BindingSet bIn) {
	int bIndex = -1;
	Iterator<Binding> bIter = bIn.iterator();
	while (bIter.hasNext()) {
		Binding b = bIter.next();
		String name = b.getName();
		bIndex = Integer.parseInt(name.substring(name.lastIndexOf("_")+1));
	}
	return bindings.get(bIndex);
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:12,代码来源:GroupedCheckConversionIteration.java

示例4: convert

import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
protected BindingSet convert(BindingSet bIn) throws QueryEvaluationException {
	QueryBindingSet res = new QueryBindingSet();
	int bIndex = Integer.parseInt(bIn.getBinding(INDEX_BINDING_NAME).getValue().stringValue());
	Iterator<Binding> bIter = bIn.iterator();
	while (bIter.hasNext()) {
		Binding b = bIter.next();
		if (b.getName().equals(INDEX_BINDING_NAME))
			continue;
		res.addBinding(b);
	}
	for (Binding bs : bindings.get(bIndex))
		res.setBinding(bs);
	return res;
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:16,代码来源:BoundJoinVALUESConversionIteration.java

示例5: convert

import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
protected BindingSet convert(BindingSet bIn) {
	QueryBindingSet res = new QueryBindingSet();
	int bIndex = -1;
	Iterator<Binding> bIter = bIn.iterator();
	while (bIter.hasNext()) {
		Binding b = bIter.next();
		String name = b.getName();
		bIndex = Integer.parseInt(name.substring(name.lastIndexOf("_")+1));
		res.addBinding(name.substring(0, name.lastIndexOf("_")), b.getValue());
	}
	res.addAll( bindings.get(bIndex));
	return res;
}
 
开发者ID:dice-group,项目名称:CostFed,代码行数:15,代码来源:BoundJoinConversionIteration.java


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