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


Java TupleExpr.getBindingNames方法代码示例

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


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

示例1: getVars

import org.openrdf.query.algebra.TupleExpr; //导入方法依赖的package包/类
/**
 * Get the non-constant variables from a {@link TupleExpr}.
 *
 * @param node - The node to inspect for variables. (not null)
 * @return The non-constant variables that were part of the node.
 */
private Set<String> getVars(final TupleExpr node) {
    checkNotNull(node);

    final Set<String> vars = Sets.newHashSet();

    for(final String bindingName : node.getBindingNames()) {
        if(!bindingName.startsWith("-const-")) {
            vars.add(bindingName);
        }
    }

    return vars;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:20,代码来源:SparqlFluoQueryBuilder.java

示例2: getNonAggregationVariables

import org.openrdf.query.algebra.TupleExpr; //导入方法依赖的package包/类
public Set<String> getNonAggregationVariables(final String sparql) throws MalformedQueryException {
    final TupleExpr te = new SPARQLParser().parseQuery(sparql, null).getTupleExpr();
    bindingNames = te.getBindingNames();
    te.visit(this);
    return bindingNames;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:7,代码来源:AccumuloPeriodicQueryResultStorage.java

示例3: evaluate

import org.openrdf.query.algebra.TupleExpr; //导入方法依赖的package包/类
public CloseableIteration<BindingSet, QueryEvaluationException> evaluate(
			HashJoin join, BindingSet bindings) throws QueryEvaluationException {
		// eval query if all sub operators are applied on same source
		// TODO optimize with caching
		Set<Graph> sources = new SourceCollector().getSources(join);
		if (COLLECT_BGP_PATTERNS && sources.size() == 1)
			return sendSparqlQuery(join, sources, bindings);
	
//		assert join.getNumberOfArguments() > 0;
		
		// TODO: support different join strategies

		Set<String> resultVars = null;
		CloseableIteration<BindingSet, QueryEvaluationException> joinCursor = null;
		
		TupleExpr[] joinArgs = {join.getLeftArg(), join.getRightArg()};
		
		for (TupleExpr joinArg : joinArgs) {
			
			CloseableIteration<BindingSet, QueryEvaluationException> argCursor;
//			if (MULTI_THREADED) {
//				argCursor = fetchArgResults(joinArg, bindings); 
//			} else {
				argCursor = evaluate(joinArg, bindings);
//			}
			
			
			// init binding names if this is the first argument for the join
			if (joinCursor == null) {
				joinCursor = argCursor;
				resultVars = joinArg.getBindingNames();
				// TODO: can constants vars be removed here?
				if (LOGGER.isTraceEnabled())
					LOGGER.trace("pattern bindings: " + resultVars);
				continue;
			}
			
			// else create hash join (with left and right cursor and join vars)
			Set<String> joinVars = new HashSet<String>(resultVars);
			joinVars.retainAll(joinArg.getBindingNames());
			
			// check for B-Node joins
			for (String varName : joinVars) {
				if (varName.startsWith("-anon"))
					throw new UnsupportedOperationException("blank node joins are not supported");
			}
			
//			if (joinVars.size() == 0) {
//				for (TupleExpr arg : join.getArgs()) {
//					LOGGER.info("cross-prod ARG: " + OperatorTreePrinter.print(arg));					
//				}
//			}
//			
			joinCursor = new HashJoinCursor(joinCursor, argCursor, joinVars);
			resultVars.addAll(joinArg.getBindingNames());

			// TODO: can constants vars be removed here?
			if (LOGGER.isTraceEnabled())
				LOGGER.trace("argument bindings: " + joinVars + "; join bindings: " + resultVars);
		}

		return joinCursor;
	}
 
开发者ID:goerlitz,项目名称:rdffederator,代码行数:64,代码来源:FederationEvalStrategy.java


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