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


Java OpFilter类代码示例

本文整理汇总了Java中com.hp.hpl.jena.sparql.algebra.op.OpFilter的典型用法代码示例。如果您正苦于以下问题:Java OpFilter类的具体用法?Java OpFilter怎么用?Java OpFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OpFilter类属于com.hp.hpl.jena.sparql.algebra.op包,在下文中一共展示了OpFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
/**
 * When visiting an OpFilter, all its filterconditions are collected during
 * the top-down-stepping. During the bottom-up-stepping all filterconditions
 * which were moved down, are removed
 */
public void visit(final OpFilter opFilter) {
	filterExpr.addAll(opFilter.getExprs().getList());
	Op subOp = null;
	if (opFilter.getSubOp() != null) {
		opFilter.getSubOp().visit(this);
		subOp = stack.pop();
	}
	opFilter.getExprs().getList().removeAll(filterExpr);
	// remove the filter if it has no expressions
	if (opFilter.getExprs().isEmpty()) {
		stack.push(subOp);
	} else {
		stack.push(opFilter);
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:21,代码来源:PushDownOpFilterVisitor.java

示例2: createOpD2RQ

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public Op createOpD2RQ(OpBGP opBGP, ExprList filters) {
    List<NodeRelation> tables = new GraphPatternTranslator(
    		opBGP.getPattern().getList(), mapping.compiledPropertyBridges(), 
    		useAllOptimizations).translate();
    
    if (useAllOptimizations) {
    	log.debug("NodeRelations before applying filters: " + tables.size());
    	ExprList copy = new ExprList(filters);
    	for (Expr filter: copy) {
    		tables = applyFilter(tables, filter, filters);
    	}
    	if (log.isDebugEnabled()) {
    		log.debug("NodeRelations after applying filters: " + tables.size());
    	}
    }
    
    Op op = OpUnionTableSQL.create(tables);
    if (!filters.isEmpty()) {
        op = OpFilter.filter(filters, op);
    }
    return op;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:23,代码来源:TransformOpBGP.java

示例3: compileElementOptional

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
protected Op compileElementOptional(ElementOptional eltOpt, Op current) {
    Element subElt = eltOpt.getOptionalElement();
    Op op = compileElement(subElt);
    
    ExprList exprs = null;
    if (op instanceof OpFilter) {
        OpFilter f = (OpFilter)op;
        //f = OpFilter.tidy(f) ;  // Collapse filter(filter(..))
        Op sub = f.getSubOp();
        if (sub instanceof OpFilter)
            broken("compile/Optional/nested filters - unfinished") ; 
        exprs = f.getExprs();
        op = sub;
    }
    current = OpLeftJoin.create(current, op, exprs);
    return current;
}
 
开发者ID:KMax,项目名称:cqels,代码行数:18,代码来源:LogicCompiler.java

示例4: execute

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
protected QueryIterator execute(OpFilter opFilter, QueryIterator input)
{
    if ( ! isForThisExecutor )
        return super.execute(opFilter, input) ;
    
    Op sub = opFilter.getSubOp() ;
    
    // (filter (bgp ...))
    if ( OpBGP.isBGP(sub) )
    {
        OpBGP opBGP = (OpBGP)sub ;
        return evaluateBlockFilter(execCxt.getActiveGraph(), opBGP.getPattern(), opFilter.getExprs(), input) ;
    }
    
    // (filter (quadpattern ...))
    if ( sub instanceof OpQuadPattern )
    {
        OpQuadPattern quadPattern = (OpQuadPattern)sub ;
        return evaluateBlockFilter(quadPattern.getGraphNode(), quadPattern.getBasicPattern(), opFilter.getExprs(), input) ;
    }
    
    // TODO OpTable.
    return super.execute(opFilter, input) ;
}
 
开发者ID:afs,项目名称:quack,代码行数:26,代码来源:OpExecutorBlockFilter.java

示例5: SparkFilter

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public SparkFilter(OpFilter op, PrefixMapping prefixes) {
this.op = op;
expressions = new HashSet<>();

Iterator<Expr> iterator = op.getExprs().iterator();
while (iterator.hasNext()) {
    Expr current = iterator.next();
    ExprCompiler translator = new ExprCompiler(prefixes);
    expressions.add(translator.translate(current));
}
   }
 
开发者ID:aschaetzle,项目名称:S2X,代码行数:12,代码来源:SparkFilter.java

示例6: transform

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public Op transform(OpFilter opFilter, Op subOp) { 
	ExprList exprList = ExprList.splitConjunction(opFilter.getExprs());
	ExprList cnfExprList = ExprList.splitConjunction(
			TransformFilterCNF.translateFilterExpressionsToCNF(opFilter));
	if (cnfExprList.size() > exprList.size()) {
		return OpFilter.filter(cnfExprList, subOp);
	}
	return OpFilter.filter(exprList, subOp);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:10,代码来源:TransformFilterCNF.java

示例7: wrapInFilter

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
private void wrapInFilter(Op op, List<Expr> filters) {
	if (filterExpr.isEmpty()) {
		stack.push(op);
	} else {
		stack.push(OpFilter.filter(new ExprList(filters), op));
	}
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:PushDownOpFilterVisitor.java

示例8: transform

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
public Op transform(OpFilter opFilter, Op subOp) {
	if (!transformFilters || !(opFilter.getSubOp() instanceof OpBGP)) {
		return super.transform(opFilter, subOp);
	}
	return createOpD2RQ((OpBGP) subOp, opFilter.getExprs());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:TransformOpBGP.java

示例9: transform

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
public Op transform(OpFilter opFilter, Op subOp) {

	ExprList substitutedExprList = new ExprList();
	
	for (Expr expr: opFilter.getExprs().getList()){
		Map<String, Expr> substitutions = new HashMap<String, Expr>();
		//for each expression see if it contains variables that are not mentioned within this clause
		for (Var var: expr.getVarsMentioned()){
			QueryVar mentionedQueryVar=this.mentionedVars.get(var);
			if (mentionedQueryVar==null) {
				//No mentioned variables so filter not relevant
				return subOp;
			}else
			{
				//Mentioned so add the new name to the substitutions set.
				Var substitutedVar = Var.alloc(mentionedQueryVar.getLinkedName(this.queryClause.getDataset()));
				substitutions.put(var.getName(), new ExprVar(substitutedVar));
			}
		}
		//Only get here if all vars mentioned in expression are within clause
	
		ExprTransformSubstitute exprTransformSubstitute = new ExprTransformSubstitute(	substitutions );
		Expr substitutedExpression = (Expr) ExprTransformer.transform(exprTransformSubstitute, expr);
		substitutedExprList.add(substitutedExpression);
	}
	return OpFilter.filter(substitutedExprList, subOp);
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:29,代码来源:Substituter.java

示例10: visitFilter

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
   protected void visitFilter(OpFilter op) {
if (op.getSubOp() != null)
    op.getSubOp().visit(this);
op.visit(visitor);
   }
 
开发者ID:aschaetzle,项目名称:S2X,代码行数:7,代码来源:AlgebraWalker.java

示例11: visit

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
   public void visit(OpFilter opFilter) {
executionQueue.add(new SparkFilter(opFilter, prefixes));
addExpressionsToBGP(opFilter.getExprs());
   }
 
开发者ID:aschaetzle,项目名称:S2X,代码行数:6,代码来源:AlgebraTranslator.java

示例12: visit

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
@Override
public void visit(OpFilter opFilter) {
    SqlOp subOp = stack.pop();
    stack.push(new SqlFilter(opFilter, subOp, prefixes));
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:6,代码来源:AlgebraTransformer.java

示例13: SqlFilter

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public SqlFilter(OpFilter _opFilter, SqlOp _subOp,
		PrefixMapping _prefixes) {
	super(_subOp, _prefixes);
	opFilter = _opFilter;
	resultName = Tags.FILTER;
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:7,代码来源:SqlFilter.java

示例14: visit

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public void visit(OpFilter opFilter) {
	filter = opFilter.toString();
}
 
开发者ID:tf-dbis-uni-freiburg,项目名称:PRoST,代码行数:4,代码来源:QueryVisitor.java

示例15: PigFilter

import com.hp.hpl.jena.sparql.algebra.op.OpFilter; //导入依赖的package包/类
public PigFilter(OpFilter _opFilter, PigOp _subOp, PrefixMapping _prefixes) {
    super(_subOp, _prefixes);
    opFilter = _opFilter;
    resultName = Tags.FILTER;
}
 
开发者ID:aschaetzle,项目名称:PigSPARQL,代码行数:6,代码来源:PigFilter.java


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