本文整理了Java中org.apache.jena.query.Query.setQuerySelectType
方法的一些代码示例,展示了Query.setQuerySelectType
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setQuerySelectType
方法的具体详情如下:
包路径:org.apache.jena.query.Query
类名称:Query
方法名:setQuerySelectType
暂无
代码示例来源:origin: apache/jena
/**
* Constructor.
*/
public SelectBuilder() {
super();
query.setQuerySelectType();
handlerBlock = new HandlerBlock(query);
}
代码示例来源:origin: org.apache.jena/jena-querybuilder
/**
* Constructor.
*/
public SelectBuilder() {
super();
query.setQuerySelectType();
handlerBlock = new HandlerBlock(query);
}
代码示例来源:origin: stackoverflow.com
Op op;
BasicPattern pat = new BasicPattern(); // Make a pattern
pat.add(pattern); // Add our pattern match
op = new OpBGP(pat); // Make a BGP from this pattern
op = OpFilter.filter(e, op); // Filter that pattern with our expression
op = new OpProject(op, Arrays.asList(Var.alloc("s"))); // Reduce to just ?s
Query q = OpAsQuery.asQuery(op); // Convert to a query
q.setQuerySelectType(); // Make is a select query
代码示例来源:origin: tarql/tarql
public void makeTest() {
for (Query q: queries) {
if (q.isConstructType()) {
q.setQuerySelectType();
}
q.setLimit(5);
}
}
}
代码示例来源:origin: apache/jena
private static Query toQuery(Element pattern) {
Query query = QueryFactory.make() ;
query.setQueryPattern(pattern) ;
query.setQuerySelectType() ;
query.setQueryResultStar(true) ;
return query ;
}
代码示例来源:origin: apache/jena
/**
* Process for a single pattern below the modifiers.
* Cleans up the ElementGroup produced.
*/
private void processQueryPattern(QueryLevelDetails level) {
Op op = level.pattern ;
op.visit(this) ;
ElementGroup eg = this.currentGroup ;
Element e = fixupGroupsOfOne(eg) ;
query.setQueryPattern(e) ;
query.setQuerySelectType() ;
}
代码示例来源:origin: apache/jena
protected Query elementToQuery(Element pattern) {
if ( pattern == null )
return null;
Query query = new Query();
query.setQueryPattern(pattern);
query.setQuerySelectType();
query.setQueryResultStar(true);
query.setResultVars();
return query;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query wrapAsSubQuery(Query query) {
Element esq = new ElementSubQuery(query);
Query result = new Query();
result.setQuerySelectType();
result.setQueryResultStar(true);
result.setQueryPattern(esq);
return result;
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-cache
public static Element limitElement(Element e, long limit) {
Query subQuery = new Query();
subQuery.setQuerySelectType();
subQuery.setQueryResultStar(true);
subQuery.setQueryPattern(e);
subQuery.setLimit(limit);
Element result = new ElementSubQuery(subQuery);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
default Query asQuery() {
Element e = getElement();
List<Var> vs = getVars();
Query result = new Query();
result.setQuerySelectType();
result.setQueryPattern(getElement());
result.setDistinct(true);
for(Var v : vs) {
result.getProjectVars().add(v);
}
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Element limitElement(Element e, long limit) {
Query subQuery = new Query();
subQuery.setQuerySelectType();
subQuery.setQueryResultStar(true);
subQuery.setQueryPattern(e);
subQuery.setLimit(limit);
Element result = new ElementSubQuery(subQuery);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query createSubQuery(Query query, Var var) {
Element esq = new ElementSubQuery(query);
Query result = new Query();
result.setQuerySelectType();
result.getProject().add(var);
result.setQueryPattern(esq);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query wrapAsSubQuery(Query query, Var v) {
Element esq = new ElementSubQuery(query);
Query result = new Query();
result.setQuerySelectType();
result.getProject().add(v);
result.setQueryPattern(esq);
return result;
}
代码示例来源:origin: apache/jena
private void processQueryPattern(Op op, List<OpExtend> assignments) {
op.visit(this) ;
ElementGroup eg = this.currentGroup ;
processExtends(assignments,(v,e)->eg.addElement(new ElementBind(v, e)) ) ;
Element e = fixupGroupsOfOne(eg) ;
query.setQueryPattern(e) ;
query.setQuerySelectType() ;
}
代码示例来源:origin: apache/jena
@Override
public void visitSelectResultForm(Query query) {
newQuery.setQuerySelectType();
newQuery.setDistinct(query.isDistinct());
VarExprList x = query.getProject();
for (Var v : x.getVars()) {
Expr expr = x.getExpr(v);
if (expr == null)
newQuery.addResultVar(v);
else
newQuery.addResultVar(v, expr);
}
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@Override
public void visitSelectResultForm(Query query) {
newQuery.setQuerySelectType() ;
newQuery.setDistinct(query.isDistinct()) ;
VarExprList x = query.getProject() ;
for (Var v : x.getVars()) {
Expr expr = x.getExpr(v) ;
if ( expr == null )
newQuery.addResultVar(v) ;
else
newQuery.addResultVar(v, expr) ;
}
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query createQueryCount(Var countVar, Element e, Long limit) {
if(limit != null) {
e = limitElement(e, limit);
}
Var tmpVar = Var.alloc(countVar.getName() + "_tmp_");
Query result = new Query();
result.setQuerySelectType();
result.getProject().add(countVar, new ExprAggregator(tmpVar, new AggCount()));
result.setQueryPattern(e);
return result;
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-cache
public static Query createQueryCount(Var countVar, Element e, Long limit) {
if(limit != null) {
e = limitElement(e, limit);
}
Var tmpVar = Var.alloc(countVar.getName() + "_tmp_");
Query result = new Query();
result.setQuerySelectType();
result.getProject().add(countVar, new ExprAggregator(tmpVar, new AggCount()));
result.setQueryPattern(e);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query createQueryList(UnaryRelation concept, Long limit, Long offset) {
Query result = new Query();
result.setQuerySelectType();
result.setDistinct(true);
result.setLimit(limit == null ? Query.NOLIMIT : limit);
result.setOffset(offset == null ? Query.NOLIMIT : offset);
result.getProject().add(concept.getVar());
Element e = concept.getElement();
if(e instanceof ElementSubQuery) {
e = ElementUtils.createElementGroup(e);
}
result.setQueryPattern(e);
// String str = result.toString();
// System.out.println(str);
return result;
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
public static Query createQueryCheckExistenceValues(Iterator<Quad> it) {
Tables tables = createTablesForQuads(it);
boolean useG = !tables.getNamedGraphTable().isEmpty();
Element element = createElement(tables);
Query result = new Query();
result.setQuerySelectType();
if(useG) {
result.getProject().add(Vars.g);
}
result.getProject().add(Vars.s);
result.getProject().add(Vars.p);
result.getProject().add(Vars.o);
result.setQueryPattern(element);
return result;
}
内容来源于网络,如有侵权,请联系作者删除!