org.openprovenance.prov.model.Namespace.setParent()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(154)

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

Namespace.setParent介绍

暂无

代码示例

代码示例来源:origin: lucmoreau/ProvToolbox

@Override
public void setParent(org.openprovenance.prov.model.Namespace parent) {
 super.setParent(parent);
}

代码示例来源:origin: lucmoreau/ProvToolbox

/**
 * After reading a document, this method should be called to ensure that Namespaces are properly chained.
 * @param document a {@link Document} to update
 */
public void updateNamespaces(Document document) {
Namespace rootNamespace = Namespace.gatherNamespaces(document);
document.setNamespace(rootNamespace);
for (org.openprovenance.prov.model.Bundle bu: utils.getBundle(document)) {
  Namespace ns=bu.getNamespace();
  if (ns!=null) {
  ns.setParent(rootNamespace);
  } else {
  ns=new Namespace();
  ns.setParent(rootNamespace);
  bu.setNamespace(ns);
  }
}
}

代码示例来源:origin: org.openprovenance.prov/prov-model

public Bundle doAction(Bundle b, ProvUtilities u) {
List<Statement> sRecords = new LinkedList<Statement>();
QualifiedName bundleId=b.getId();

   Namespace old=Namespace.getThreadNamespace();
Namespace bundleNamespace;
if (b.getNamespace()!=null) {
  bundleNamespace=new Namespace(b.getNamespace());
} else {
  bundleNamespace=new Namespace();
}
bundleNamespace.setParent(new Namespace(old)); //ensure to make a copy of old, since setting might otherwise create a loop
Namespace.withThreadNamespace(bundleNamespace);
  c.startBundle(bundleId, b.getNamespace());
  
for (Statement s : u.getStatement(b)) {
  sRecords.add((Statement) u.doAction(s, this));
}
return c.newNamedBundle(bundleId, b.getNamespace(), sRecords);
}

代码示例来源:origin: lucmoreau/ProvToolbox

public Bundle doAction(Bundle b, ProvUtilities u) {
List<Statement> sRecords = new LinkedList<Statement>();
QualifiedName bundleId=b.getId();

   Namespace old=Namespace.getThreadNamespace();
Namespace bundleNamespace;
if (b.getNamespace()!=null) {
  bundleNamespace=new Namespace(b.getNamespace());
} else {
  bundleNamespace=new Namespace();
}
bundleNamespace.setParent(new Namespace(old)); //ensure to make a copy of old, since setting might otherwise create a loop
Namespace.withThreadNamespace(bundleNamespace);
  c.startBundle(bundleId, b.getNamespace());
  
for (Statement s : u.getStatement(b)) {
  sRecords.add((Statement) u.doAction(s, this));
}
return c.newNamedBundle(bundleId, b.getNamespace(), sRecords);
}

代码示例来源:origin: lucmoreau/ProvToolbox

public void makeDocAndTest(Statement[] stment, Bundle[] bundles,
              String file, Statement[] opt, boolean check) {
  Document doc = pFactory.newDocument();
  for (int i = 0; i < stment.length; i++) {
    doc.getStatementOrBundle().add(stment[i]);
  }
  if (bundles != null) {
    for (int j = 0; j < bundles.length; j++) {
      doc.getStatementOrBundle().add(bundles[j]);
    }
  }
  updateNamespaces(doc);
  
  if (bundles!=null) {
    for (int j = 0; j < bundles.length; j++) {
      bundles[j].getNamespace().setParent(doc.getNamespace());
    }
  }
  String file1 = (opt == null) ? file : file + "-S";
  compareDocAndFile(doc, file1, check);
  if ((opt != null) && doOptional(opt)) {
    String file2 = file + "-M";
    doc.getStatementOrBundle().addAll(Arrays.asList(opt));
    compareDocAndFile(doc, file2, check);
  }
}

代码示例来源:origin: lucmoreau/ProvToolbox

public void makeDocAndTest(Statement[] stment, Bundle[] bundles,
              String file, Statement[] opt, boolean check) {
  Document doc = pFactory.newDocument();
  for (int i = 0; i < stment.length; i++) {
    doc.getStatementOrBundle().add(stment[i]);
  }
  if (bundles != null) {
    for (int j = 0; j < bundles.length; j++) {
      doc.getStatementOrBundle().add(bundles[j]);
    }
  }
  updateNamespaces(doc);
  
  if (bundles!=null) {
    for (int j = 0; j < bundles.length; j++) {
      bundles[j].getNamespace().setParent(doc.getNamespace());
    }
  }
  String file1 = (opt == null) ? file : file + "-S";
  compareDocAndFile(doc, file1, check);
  if ((opt != null) && doOptional(opt)) {
    String file2 = file + "-M";
    doc.getStatementOrBundle().addAll(Arrays.asList(opt));
    compareDocAndFile(doc, file2, check);
  }
}

代码示例来源:origin: lucmoreau/ProvToolbox

public void makeDocAndTest(Statement[] stment, Bundle[] bundles,
              String file, Statement[] opt, boolean check) {
  Document doc = pFactory.newDocument();
  for (int i = 0; i < stment.length; i++) {
    doc.getStatementOrBundle().add(stment[i]);
  }
  if (bundles != null) {
    for (int j = 0; j < bundles.length; j++) {
      doc.getStatementOrBundle().add(bundles[j]);
    }
  }
  updateNamespaces(doc);
  
  if (bundles!=null) {
    for (int j = 0; j < bundles.length; j++) {
      bundles[j].getNamespace().setParent(doc.getNamespace());
    }
  }
  String file1 = (opt == null) ? file : file + "-S";
  compareDocAndFile(doc, file1, check);
  if ((opt != null) && doOptional(opt)) {
    String file2 = file + "-M";
    doc.getStatementOrBundle().addAll(Arrays.asList(opt));
    compareDocAndFile(doc, file2, check);
  }
}

代码示例来源:origin: org.openprovenance.prov/prov-json

Namespace ns = decodePrefixes(attributeMap);
currentNamespace = ns;
currentNamespace.setParent(documentNamespace);

代码示例来源:origin: lucmoreau/ProvToolbox

Namespace ns = decodePrefixes(attributeMap);
currentNamespace = ns;
currentNamespace.setParent(documentNamespace);

代码示例来源:origin: org.openprovenance.prov/prov-n

localNamespace.setParent(namespace);

代码示例来源:origin: lucmoreau/ProvToolbox

localNamespace.setParent(namespace);

相关文章