@Override public void setParent(org.openprovenance.prov.model.Namespace parent) { super.setParent(parent); }
/** * 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); } } }
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); }
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); }
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); } }
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); } }
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); } }
Namespace ns = decodePrefixes(attributeMap); currentNamespace = ns; currentNamespace.setParent(documentNamespace);
Namespace ns = decodePrefixes(attributeMap); currentNamespace = ns; currentNamespace.setParent(documentNamespace);
localNamespace.setParent(namespace);
localNamespace.setParent(namespace);