use of org.apache.jena.arq.querybuilder.rewriters.BuildElementVisitor in project jena by apache.
the class WhereQuadHolder method build.
/**
* @return Build the whereClause and return the element.
*/
public Element build() {
/*
* cleanup union-of-one and other similar issues.
*/
BuildElementVisitor visitor = new BuildElementVisitor();
whereClause.visit(visitor);
return whereClause;
}
use of org.apache.jena.arq.querybuilder.rewriters.BuildElementVisitor in project jena by apache.
the class WhereHandler method build.
@Override
public void build() {
/*
* cleanup union-of-one and other similar issues.
*/
BuildElementVisitor visitor = new BuildElementVisitor();
getElement().visit(visitor);
if (!valuesHandler.isEmpty()) {
if (visitor.getResult() instanceof ElementGroup) {
((ElementGroup) visitor.getResult()).addElement(valuesHandler.asElement());
;
} else {
ElementGroup eg = new ElementGroup();
eg.addElement(visitor.getResult());
eg.addElement(valuesHandler.asElement());
visitor.setResult(eg);
}
}
query.setQueryPattern(visitor.getResult());
}
Aggregations