org.eclipse.rdf4j.query.algebra.Group类的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.eclipse.rdf4j.query.algebra.Group类的一些代码示例,展示了Group类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group类的具体详情如下:
包路径:org.eclipse.rdf4j.query.algebra.Group
类名称:Group

Group介绍

[英]A tuple operator that groups tuples that have a specific set of equivalent variable bindings, and that can apply aggregate functions on the grouped results.
[中]一种元组运算符,用于对具有一组特定等效变量绑定的元组进行分组,并且可以对分组结果应用聚合函数。

代码示例

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

@Override
public Set<String> getAssuredBindingNames() {
  Set<String> bindingNames = new LinkedHashSet<String>();
  bindingNames.addAll(getGroupBindingNames());
  bindingNames.retainAll(getArg().getAssuredBindingNames());
  return bindingNames;
}

代码示例来源:origin: eclipse/rdf4j

@Override
public Group clone() {
  Group clone = (Group)super.clone();
  clone.groupBindings = new LinkedHashSet<>(getGroupBindingNames());
  clone.groupElements = new ArrayList<>(getGroupElements().size());
  for (GroupElem ge : getGroupElements()) {
    clone.addGroupElement(ge.clone());
  }
  return clone;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryparser-sparql

@Override
public Group visit(ASTGroupClause node, Object data)
  throws VisitorException
{
  TupleExpr tupleExpr = (TupleExpr)data;
  Group g = new Group(tupleExpr);
  int childCount = node.jjtGetNumChildren();
  List<String> groupBindingNames = new ArrayList<String>();
  for (int i = 0; i < childCount; i++) {
    String name = (String)node.jjtGetChild(i).jjtAccept(this, g);
    groupBindingNames.add(name);
  }
  g.setGroupBindingNames(groupBindingNames);
  return g;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

@Override
public Set<String> getBindingNames() {
  Set<String> bindingNames = new LinkedHashSet<String>();
  bindingNames.addAll(getGroupBindingNames());
  bindingNames.addAll(getAggregateBindingNames());
  return bindingNames;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

@Override
public boolean equals(Object other) {
  if (other instanceof Group && super.equals(other)) {
    Group o = (Group)other;
    return groupBindings.equals(o.getGroupBindingNames())
        && groupElements.equals(o.getGroupElements());
  }
  return false;
}

代码示例来源:origin: apache/incubator-rya

final TupleExpr child = group.getArg();
final String childNodeId = nodeIds.getOrMakeId( child );
if(!group.getGroupBindingNames().isEmpty()) {
  groupByVariableOrder = new VariableOrder(group.getGroupBindingNames());
} else {
  groupByVariableOrder = new VariableOrder();
for(final GroupElem groupElem : group.getGroupElements()) {

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryalgebra-evaluation

public Key(BindingSet bindingSet) {
  this.bindingSet = bindingSet;
  int nextHash = 0;
  for (String name : group.getGroupBindingNames()) {
    Value value = bindingSet.getValue(name);
    if (value != null) {
      nextHash ^= value.hashCode();
    }
  }
  this.hash = nextHash;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

TupleExpr arg = group.getArg();
  group.setArg(extension);

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

@Override
public void meet(Group node)
  throws RDFHandlerException
{
  // skip over GroupElem - leave this to the GroupVisitor later
  node.getArg().visit(this);
  hasGroup = true;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

group = new Group(result);
        group.addGroupElement(new GroupElem(alias, operator));
        extension.setArg(group);
        group.addGroupElement(new GroupElem(anonVar.getName(), operator));
for (ProjectionElem elem : projElemList.getElements()) {
  if (!elem.hasAggregateOperatorInExpression()) {
    Set<String> groupNames = group.getBindingNames();

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

projElem.setAggregateOperatorInExpression(true);
if (group == null) {
  group = new Group();
  group.addGroupElement(new GroupElem(projName, op));

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryalgebra-evaluation

private Map<String, Aggregate> getAggregates()
  throws ValueExprEvaluationException, QueryEvaluationException
{
  Map<String, Aggregate> result = aggregates;
  if (result == null) {
    synchronized (this) {
      result = aggregates;
      if (result == null) {
        result = aggregates = new LinkedHashMap<String, Aggregate>();
        for (GroupElem ge : group.getGroupElements()) {
          Aggregate create = create(ge.getOperator());
          if (create != null) {
            aggregates.put(ge.getName(), create);
          }
        }
      }
    }
  }
  return result;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-queryparser-sparql

if (group == null) {
  group = new Group(tupleExpr);
if (group == null) {
  group = new Group(tupleExpr);

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

group.addGroupElement(ge);

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

private void visitGroupBy(Resource groupby)
  throws RDF4JException
{
  if (group == null) {
    group = new Group();
  }
  Iteration<? extends Resource, QueryEvaluationException> iter = TripleSources.listResources(groupby,
      store);
  while (iter.hasNext()) {
    Resource r = iter.next();
    ValueExpr groupByExpr = visitExpression(r);
    if (!(groupByExpr instanceof Var)) {
      // TODO
      // have to create an intermediate Var/Extension for the
      // expression
      throw new UnsupportedOperationException("TODO!");
    }
    group.addGroupBindingName(((Var)groupByExpr).getName());
  }
}

代码示例来源:origin: eclipse/rdf4j

public Group(TupleExpr arg, Iterable<String> groupBindingNames) {
  this(arg);
  setGroupBindingNames(groupBindingNames);
}

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-spin

group.setArg(projection.getArg());
projection.setArg(group);

代码示例来源:origin: de.tudarmstadt.ukp.inception.rdf4j/rdf4j-queryalgebra-evaluation

public Key(BindingSet bindingSet) {
  this.bindingSet = bindingSet;
  int nextHash = 0;
  for (String name : group.getGroupBindingNames()) {
    Value value = bindingSet.getValue(name);
    if (value != null) {
      nextHash ^= value.hashCode();
    }
  }
  this.hash = nextHash;
}

代码示例来源:origin: eclipse/rdf4j

TupleExpr arg = group.getArg();
  group.setArg(extension);

代码示例来源:origin: eclipse/rdf4j

@Override
public boolean equals(Object other) {
  if (other instanceof Group && super.equals(other)) {
    Group o = (Group)other;
    return groupBindings.equals(o.getGroupBindingNames())
        && groupElements.equals(o.getGroupElements());
  }
  return false;
}

相关文章