org.eclipse.rdf4j.query.algebra.Extension.addElement()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(172)

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

Extension.addElement介绍

暂无

代码示例

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

public void addElements(ExtensionElem... elements) {
  for (ExtensionElem pe : elements) {
    addElement(pe);
  }
}

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

public void addElements(Iterable<ExtensionElem> elements) {
  for (ExtensionElem pe : elements) {
    addElement(pe);
  }
}

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

public void addElements(ExtensionElem... elements) {
  for (ExtensionElem pe : elements) {
    addElement(pe);
  }
}

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

public void addElements(Iterable<ExtensionElem> elements) {
  for (ExtensionElem pe : elements) {
    addElement(pe);
  }
}

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

@Override
  public Extension clone() {
    Extension clone = (Extension)super.clone();

    clone.elements = new ArrayList<>(getElements().size());
    for (ExtensionElem elem : getElements()) {
      clone.addElement(elem.clone());
    }

    return clone;
  }
}

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

@Override
  public Extension clone() {
    Extension clone = (Extension)super.clone();

    clone.elements = new ArrayList<ExtensionElem>(getElements().size());
    for (ExtensionElem elem : getElements()) {
      clone.addElement(elem.clone());
    }

    return clone;
  }
}

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

private void addSourceExpressions(UnaryTupleOperator op, Collection<ProjectionElem> elems) {
  Extension ext = null;
  for (ProjectionElem projElem : elems) {
    ExtensionElem extElem = projElem.getSourceExpression();
    if (extElem != null) {
      if (ext == null) {
        ext = new Extension(op.getArg());
        op.setArg(ext);
      }
      ext.addElement(extElem);
    }
  }
}

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

lostVar.setValue(value);
ext.addElement(new ExtensionElem(lostVar, name));

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

lostVar.setValue(value);
ext.addElement(new ExtensionElem(lostVar, name));

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

@Override
public TupleExpr visit(ASTDescribe node, Object data)
  throws VisitorException
{
  TupleExpr tupleExpr = (TupleExpr)data;
  if (tupleExpr == null) {
    tupleExpr = new SingletonSet();
  }
  Extension e = new Extension();
  ProjectionElemList projectionElements = new ProjectionElemList();
  for (int i = 0; i < node.jjtGetNumChildren(); i++) {
    ValueExpr resource = (ValueExpr)node.jjtGetChild(i).jjtAccept(this, null);
    if (resource instanceof Var) {
      projectionElements.addElement(new ProjectionElem(((Var)resource).getName()));
    }
    else {
      String alias = "_describe_" + UUID.randomUUID().toString().replaceAll("-", "_");
      ExtensionElem elem = new ExtensionElem(resource, alias);
      e.addElement(elem);
      projectionElements.addElement(new ProjectionElem(alias));
    }
  }
  if (!e.getElements().isEmpty()) {
    e.setArg(tupleExpr);
    tupleExpr = e;
  }
  Projection p = new Projection(tupleExpr, projectionElements);
  return new DescribeOperator(p);
}

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

@Override
public TupleExpr visit(ASTDescribe node, Object data)
  throws VisitorException
{
  TupleExpr tupleExpr = (TupleExpr)data;
  if (tupleExpr == null) {
    tupleExpr = new SingletonSet();
  }
  Extension e = new Extension();
  ProjectionElemList projectionElements = new ProjectionElemList();
  for (int i = 0; i < node.jjtGetNumChildren(); i++) {
    ValueExpr resource = (ValueExpr)node.jjtGetChild(i).jjtAccept(this, null);
    if (resource instanceof Var) {
      projectionElements.addElement(new ProjectionElem(((Var)resource).getName()));
    }
    else {
      String alias = "_describe_" + UUID.randomUUID().toString().replaceAll("-", "_");
      ExtensionElem elem = new ExtensionElem(resource, alias);
      e.addElement(elem);
      projectionElements.addElement(new ProjectionElem(alias));
    }
  }
  if (!e.getElements().isEmpty()) {
    e.setArg(tupleExpr);
    tupleExpr = e;
  }
  Projection p = new Projection(tupleExpr, projectionElements);
  return new DescribeOperator(p);
}

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

@Override
public TupleExpr visit(ASTDescribe node, Object data)
  throws VisitorException
{
  TupleExpr tupleExpr = (TupleExpr)data;
  if (tupleExpr == null) {
    tupleExpr = new SingletonSet();
  }
  Extension e = new Extension();
  ProjectionElemList projectionElements = new ProjectionElemList();
  for (int i = 0; i < node.jjtGetNumChildren(); i++) {
    ValueExpr resource = (ValueExpr)node.jjtGetChild(i).jjtAccept(this, null);
    if (resource instanceof Var) {
      projectionElements.addElement(new ProjectionElem(((Var)resource).getName()));
    }
    else {
      String alias = "_describe_" + UUID.randomUUID().toString().replaceAll("-", "_");
      ExtensionElem elem = new ExtensionElem(resource, alias);
      e.addElement(elem);
      projectionElements.addElement(new ProjectionElem(alias));
    }
  }
  if (!e.getElements().isEmpty()) {
    e.setArg(tupleExpr);
    tupleExpr = e;
  }
  Projection p = new Projection(tupleExpr, projectionElements);
  return new DescribeOperator(p);
}

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

private void renameVar(Var oldVar, Var newVar, Filter filter) {
  filter.getArg().visit(new VarRenamer(oldVar, newVar));
  // TODO: skip this step if old variable name is not used
  // Replace SameTerm-filter with an Extension, the old variable name
  // might still be relevant to nodes higher in the tree
  Extension extension = new Extension(filter.getArg());
  extension.addElement(new ExtensionElem(new Var(newVar.getName()), oldVar.getName()));
  filter.replaceWith(extension);
}

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

private void renameVar(Var oldVar, Var newVar, Filter filter) {
  filter.getArg().visit(new VarRenamer(oldVar, newVar));
  // TODO: skip this step if old variable name is not used
  // Replace SameTerm-filter with an Extension, the old variable name
  // might still be relevant to nodes higher in the tree
  Extension extension = new Extension(filter.getArg());
  extension.addElement(new ExtensionElem(new Var(newVar.getName()), oldVar.getName()));
  filter.replaceWith(extension);
}

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

if (alias != null) {
  extension.addElement(new ExtensionElem(valueExpr, alias));
  projElemList.addElement(new ProjectionElem(alias));

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

extension.addElement(pe);

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

extension.addElement(pe);

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

extension.addElement(elem);

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

extension.addElement(elem);

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

extension.addElement(pe);

相关文章