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


Java ExprList.add方法代码示例

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


在下文中一共展示了ExprList.add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例4: transform

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

示例5: ExpressionList

import com.hp.hpl.jena.sparql.expr.ExprList; //导入方法依赖的package包/类
final public ExprList ExpressionList() throws ParseException {
                            Expr expr = null ; ExprList args = new ExprList() ;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case NIL:
    jj_consume_token(NIL);
    break;
  case LPAREN:
    jj_consume_token(LPAREN);
    expr = Expression();
                        args.add(expr) ;
    label_24:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case COMMA:
        ;
        break;
      default:
        jj_la1[98] = jj_gen;
        break label_24;
      }
      jj_consume_token(COMMA);
      expr = Expression();
                                   args.add(expr) ;
    }
    jj_consume_token(RPAREN);
    break;
  default:
    jj_la1[99] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
  }
  {if (true) return args ;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:KMax,项目名称:cqels,代码行数:35,代码来源:CQELSParser.java

示例6: ArgList

import com.hp.hpl.jena.sparql.expr.ExprList; //导入方法依赖的package包/类
final public ExprList ArgList() throws ParseException {
                     Expr expr ; boolean distinct = false ;
                    ExprList args = new ExprList() ; Token t ;
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case NIL:
    jj_consume_token(NIL);
    break;
  case LPAREN:
    jj_consume_token(LPAREN);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case DISTINCT:
      t = jj_consume_token(DISTINCT);
                      distinct = true ;
        if ( ! allowAggregatesInExpressions )
            throwParseException("Aggregate expression not legal at this point",
                               t.beginLine, t.beginColumn) ;
      break;
    default:
      jj_la1[95] = jj_gen;
      ;
    }
    expr = Expression();
                          args.add(expr) ;
    label_23:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case COMMA:
        ;
        break;
      default:
        jj_la1[96] = jj_gen;
        break label_23;
      }
      jj_consume_token(COMMA);
      expr = Expression();
                                   args.add(expr) ;
    }
    jj_consume_token(RPAREN);
    break;
  default:
    jj_la1[97] = jj_gen;
    jj_consume_token(-1);
    throw new ParseException();
  }
    {if (true) return args ;}
  throw new Error("Missing return statement in function");
}
 
开发者ID:KMax,项目名称:cqels,代码行数:48,代码来源:CQELSParser.java


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