本文整理汇总了Java中org.openrdf.query.algebra.GroupElem类的典型用法代码示例。如果您正苦于以下问题:Java GroupElem类的具体用法?Java GroupElem怎么用?Java GroupElem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupElem类属于org.openrdf.query.algebra包,在下文中一共展示了GroupElem类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: make
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
/**
* Make an instance of {@link AggregationsEvaluator} based on a {@link Group} node.
*
* @param aggStateStore - The mechanism for storing aggregation state. (not null)
* @param aggNode - Defines which aggregation functions need to be performed.
* @param groupByVars - The names of the binding whose values are used to group aggregation results. (not null)
* @return The evaluator that handles the node's aggregations.
*/
public static AggregationsEvaluator make(final AggregationStateStore aggStateStore, final Group aggNode, final List<String> groupByVars) {
requireNonNull(aggStateStore);
requireNonNull(aggNode);
requireNonNull(groupByVars);
// The aggregations that need to be performed are the Group Elements.
final List<AggregationElement> aggregations = new ArrayList<>();
for(final GroupElem groupElem : aggNode.getGroupElements()) {
// Figure out the type of the aggregation.
final AggregateOperator operator = groupElem.getOperator();
final Optional<AggregationType> type = AggregationType.byOperatorClass( operator.getClass() );
// If the type is one we support, create the AggregationElement.
if(type.isPresent()) {
final String resultBindingName = groupElem.getName();
final AtomicReference<String> aggregatedBindingName = new AtomicReference<>();
groupElem.visitChildren(new QueryModelVisitorBase<RuntimeException>() {
@Override
public void meet(final Var node) {
aggregatedBindingName.set( node.getName() );
}
});
aggregations.add( new AggregationElement(type.get(), aggregatedBindingName.get(), resultBindingName) );
}
}
return new AggregationsEvaluator(aggStateStore, aggregations, groupByVars);
}
示例2: meet
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
@Override
public void meet(final GroupElem n) {
final ProjectionElem e = new ProjectionElem();
e.setTargetName(n.getName());
e.setSourceName(n.getName());
e.setSourceExpression(new ExtensionElem(n.getOperator(), n.getName()));
meet(e);
}
示例3: meet
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
@Override
public void meet(GroupElem node) throws RuntimeException {
setSeen(node);
super.meet(node);
}
示例4: meet
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
@Override
public void meet(GroupElem node) throws RuntimeException {
check(node);
super.meet(node);
}
示例5: meet
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
@Override
public void meet(GroupElem arg0) throws Exception {
arg0.visitChildren(this);
}
示例6: meet
import org.openrdf.query.algebra.GroupElem; //导入依赖的package包/类
@Override
public void meet(GroupElem arg0) throws SparqlParserException
{
// NO-OP
}