本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}