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


Java ExprList类代码示例

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


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

示例1: transform

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public Op transform(OpFilter opFilter, Op subOp) {
    if ( ! (subOp instanceof OpBGP) )
        return super.transform(opFilter, subOp);

    ExprList exprs = opFilter.getExprs();
    Op op = subOp;
    // Variables set
    Set<Var> patternVars = OpVars.visibleVars(op);

    // Any assignments must go inside filters so the filters see the assignments.
    ExprList exprs2 = new ExprList();

    for (  Expr e : exprs.getList() ) {
        Op op2 = processFilterWorker(e, op, patternVars);
        if ( op2 == null )
            exprs2.add(e);
        else
            op = op2;
    }

    // Place any filter expressions around the processed sub op.
    if ( exprs2.size() > 0 )
        op = OpFilter.filter(exprs2, op);
    return op;
}
 
开发者ID:aschaetzle,项目名称:S2RDF,代码行数:27,代码来源:TransformFilterVarEquality.java

示例2: transform

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public Op transform(OpFilter opFilter, Op subOp) {
	if ( ! (subOp instanceof OpBGP) )
		return super.transform(opFilter, subOp);

	ExprList exprs = opFilter.getExprs();
	Op op = subOp;
	// Variables set
	Set<Var> patternVars = OpVars.visibleVars(op);

	// Any assignments must go inside filters so the filters see the assignments.
	ExprList exprs2 = new ExprList();

	for (  Expr e : exprs.getList() ) {
		Op op2 = processFilterWorker(e, op, patternVars);
		if ( op2 == null )
			exprs2.add(e);
		else
			op = op2;
	}

	// Place any filter expressions around the processed sub op.
	if ( exprs2.size() > 0 )
		op = OpFilter.filter(exprs2, op);
	return op;
}
 
开发者ID:aschaetzle,项目名称:Sempala,代码行数:27,代码来源:TransformFilterVarEquality.java

示例3: createOpD2RQ

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的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

示例4: parseTemplate

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
public static E_StrConcatPermissive parseTemplate(String str) {
    ExprList args = new ExprList();

    while (!str.isEmpty()) {
        if (str.contains("{") && str.contains("}")) {
            int openIdx = str.indexOf('{');
            int closeIdx = str.indexOf('}');
            int strLen = str.length();

            if (openIdx > 0) {
                args.add(NodeValue.makeString(str.substring(0, openIdx)));
            }

            String varName = str.substring(openIdx+1, closeIdx);
            args.add(new ExprVar(Var.alloc(varName)));

            str = str.substring(closeIdx+1, strLen);

        } else {
            args.add(NodeValue.makeString(str));
            str = "";
        }
    }

    return new E_StrConcatPermissive(args);
}
 
开发者ID:AKSW,项目名称:sml-converters,代码行数:27,代码来源:RRUtils.java

示例5: filter

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public Table filter(ExprList expressions, Table table)
{
    if ( debug )
    {
    	Log.debug(this,"Restriction") ;
    	Log.debug(this,expressions.toString()) ;
        dump(table) ;
    }
    QueryIterator iter = table.iterator(execCxt) ;
    List<Binding> output = new ArrayList<Binding>() ;
    for ( ; iter.hasNext() ; )
    {
        Binding b = iter.nextBinding() ;
        if ( expressions.isSatisfied(b, execCxt) )
            output.add(b) ;
    }
    return new TableN(new QueryIterPlainWrapper(output.iterator(), execCxt)) ;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:20,代码来源:EvaluatorSimple.java

示例6: joinWorker

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
private Table joinWorker(Table tableLeft, Table tableRight, boolean leftJoin, ExprList conditions)
{
    // Conditional LeftJoin is (left, Filter(expr, Join(left, right)))
    // This is done in matchRightLeft

    // Have an iterator that yields one-by-one.
    QueryIterator left = tableLeft.iterator(execCxt) ;
    QueryIterConcat output = new QueryIterConcat(execCxt) ;
    for ( ; left.hasNext() ; )
    {
        Binding b = left.nextBinding() ;
        QueryIterator x = tableRight.matchRightLeft(b, leftJoin, conditions, execCxt) ;
        if ( x == null )
            continue ;
        output.add(x) ;
    }
    tableLeft.close() ;
    tableRight.close() ;
    return new TableN(output) ;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:21,代码来源:EvaluatorSimple.java

示例7: compileElementOptional

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的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

示例8: IRIrefOrFunction

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
final public Expr IRIrefOrFunction() throws ParseException {
                          String iri ; ExprList a = null ;
                          ExprList params = null ;
                          boolean distinct = false ;
  iri = IRIref();
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case LPAREN:
  case NIL:
    a = ArgList();
    break;
  default:
    jj_la1[163] = jj_gen;
    ;
  }
  if ( a == null )
     {if (true) return asExpr(createNode(iri)) ;}
  {if (true) return new E_Function(iri, a) ;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:KMax,项目名称:cqels,代码行数:20,代码来源:CQELSParser.java

示例9: VarOrFunction

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
final public Expr VarOrFunction() throws ParseException {
                       Var v ; ExprList a = null ;
  v = Var();
  Expr ev = new ExprVar(v) ;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case LPAREN:
  case NIL:
    a = ExpressionList();
    break;
  default:
    jj_la1[164] = jj_gen;
    ;
  }
  if ( a == null ) {if (true) return ev ;}
  {if (true) return new E_FunctionDynamic(ev, a) ;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:KMax,项目名称:cqels,代码行数:18,代码来源:CQELSParser.java

示例10: evaluateBlockFilter

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
protected QueryIterator evaluateBlockFilter(Node graphNode, BasicPattern bgp, ExprList exprs, QueryIterator input) {
    // XXX Do as quads.
    Graph graph ;
    // chooseGraph
    if ( graphNode == null ) 
        graph = dataset.getDefaultGraph() ;
    else if ( Var.isVar(graphNode) )
        throw new NotImplemented("OpExecutorMain.executeBlockFilter[Variable]") ;
    else if ( graphNode == Node.ANY )
        throw new NotImplemented("OpExecutorMain.executeBlockFilter[Node.ANY]") ;
    else
        graph = dataset.getGraph(graphNode) ;
    
    return evaluateBlockFilter(graph, bgp, exprs, input);
}
 
开发者ID:afs,项目名称:quack,代码行数:17,代码来源:OpExecutorRowsMain.java

示例11: evaluateBlockFilterSub

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
/** Execute for one input binding */  
protected QueryIterator evaluateBlockFilterSub(DatasetGraphTDB dsgtdb, Node graphNode, BasicPattern bgp, ExprList exprs, Binding input1) {
    Explain2.explain(Quack.quackExec, "%s, BGP =\n%s", graphNode, bgp) ;  
    PhysicalPlan<NodeId> plan = new PhysicalPlan<>() ;
    bgp = Substitute.substitute(bgp, input1) ;
    
    if ( exprs != null ) {
        Op op ;
        if ( graphNode == null )
            op = TransformFilterPlacement.transform(exprs, bgp) ;
        else
            op = TransformFilterPlacement.transform(exprs, graphNode, bgp) ;
        accumulatePlan(plan, graphNode, op);
    } else {
        accumulatePlan(plan, graphNode, bgp) ;
    }
    
    return executePlan$(plan, input1) ;
}
 
开发者ID:afs,项目名称:quack,代码行数:20,代码来源:OpExecutorQuackTDB.java

示例12: transform

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的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

示例13: wrapInFilter

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的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

示例14: transform

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
@Override
public Op transform(OpBGP opBGP) {
	if (transformFilters) {
		return opBGP;
	}
	return createOpD2RQ(opBGP, new ExprList());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:8,代码来源:TransformOpBGP.java

示例15: applyFilter

import com.hp.hpl.jena.sparql.expr.ExprList; //导入依赖的package包/类
private List<NodeRelation> applyFilter(
		List<NodeRelation> nodeRelations, Expr filter, ExprList allFilters) {
    List<NodeRelation> result = new ArrayList<NodeRelation>();
    boolean convertable = true;
    for (NodeRelation nodeRelation: nodeRelations) {
    	// TODO: The transformation from Expr to Expression should happen in NodeRelation.select()
        Expression expression = TransformExprToSQLApplyer.convert(filter, nodeRelation);
        if (expression == null) {
        	// the expression cannot be transformed to SQL
            convertable = false;
        } else if (expression.isTrue()) {
        	// keep as is
        } else if (expression.isFalse()) {
            continue;	// skip
        } else {
        	nodeRelation = nodeRelation.select(expression);
        	if (nodeRelation.baseRelation().condition().isFalse()) continue;
        }
        result.add(nodeRelation);
    }
    if (convertable) {
    	log.debug("Removing converted filter: " + filter);
        allFilters.getList().remove(filter);
    } else {
    	log.debug("Filter could not be fully converted and is kept: " + filter);
    }
    return result;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:29,代码来源:TransformOpBGP.java


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