本文整理汇总了Java中org.eclipse.rdf4j.query.algebra.ProjectionElemList类的典型用法代码示例。如果您正苦于以下问题:Java ProjectionElemList类的具体用法?Java ProjectionElemList怎么用?Java ProjectionElemList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProjectionElemList类属于org.eclipse.rdf4j.query.algebra包,在下文中一共展示了ProjectionElemList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: selectQueryStringBoundCheck
import org.eclipse.rdf4j.query.algebra.ProjectionElemList; //导入依赖的package包/类
/**
* Construct a SELECT query for a grouped bound check.
*
* Pattern:
*
* SELECT DISTINCT ?o_1 .. ?o_N WHERE { { s1 p1 ?o_1 FILTER ?o_1=o1 } UNION ... UNION { sN pN ?o_N FILTER ?o_N=oN }}
*
* @param stmt
* @param unionBindings
* @return
*/
public static TupleExpr selectQueryStringBoundCheck(StatementPattern stmt, List<BindingSet> unionBindings) {
Set<String> varNames = new HashSet<String>();
Union union = new Union();
union.setLeftArg(constructStatementCheckId(stmt, 0, varNames, unionBindings.get(0)) );
Union tmp = union;
int idx;
for (idx=1; idx<unionBindings.size()-1; idx++) {
Union _u = new Union();
_u.setLeftArg( constructStatementCheckId(stmt, idx, varNames, unionBindings.get(idx)) );
tmp.setRightArg(_u);
tmp = _u;
}
tmp.setRightArg( constructStatementCheckId(stmt, idx, varNames, unionBindings.get(idx) ));
ProjectionElemList projList = new ProjectionElemList();
for (String var : varNames)
projList.addElement( new ProjectionElem(var));
Projection proj = new Projection(union, projList);
return proj;
}
示例2: selectQueryBoundUnion
import org.eclipse.rdf4j.query.algebra.ProjectionElemList; //导入依赖的package包/类
/**
* Construct a SELECT query expression for a bound union.
*
* Pattern:
*
* SELECT ?v_1 ?v_2 ?v_N WHERE { { ?v_1 p o } UNION { ?v_2 p o } UNION ... }
*
* Note that the filterExpr is not evaluated at the moment.
*
* @param stmt
* @param unionBindings
* @param filterExpr
* @param evaluated
* parameter can be used outside this method to check whether FILTER has been evaluated, false in beginning
*
* @return
*/
public static TupleExpr selectQueryBoundUnion( StatementPattern stmt, List<BindingSet> unionBindings, FilterValueExpr filterExpr, Boolean evaluated) {
// TODO add FILTER expressions
Set<String> varNames = new HashSet<String>();
Union union = new Union();
union.setLeftArg(constructStatementId(stmt, Integer.toString(0), varNames, unionBindings.get(0)) );
Union tmp = union;
int idx;
for (idx=1; idx<unionBindings.size()-1; idx++) {
Union _u = new Union();
_u.setLeftArg( constructStatementId(stmt, Integer.toString(idx), varNames, unionBindings.get(idx)) );
tmp.setRightArg(_u);
tmp = _u;
}
tmp.setRightArg( constructStatementId(stmt, Integer.toString(idx), varNames, unionBindings.get(idx) ));
ProjectionElemList projList = new ProjectionElemList();
for (String var : varNames)
projList.addElement( new ProjectionElem(var));
Projection proj = new Projection(union, projList);
return proj;
}
示例3: ProjectionWithBindings
import org.eclipse.rdf4j.query.algebra.ProjectionElemList; //导入依赖的package包/类
public ProjectionWithBindings(TupleExpr arg, ProjectionElemList elements, List<Binding> additionalBindings) {
super(arg, elements);
this.additionalBindings = additionalBindings;
}