Namespace.withThreadNamespace
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.openprovenance.prov.model.Namespace.withThreadNamespace (Showing top 20 results out of 315)

origin: lucmoreau/ProvToolbox

public void prepareNamespaces(Marshaller m, Document document) throws PropertyException {
final Namespace superNamespace = NamespaceGatherer.accumulateAllNamespaces(document);
configurePrefixes(m,superNamespace);
Namespace.withThreadNamespace(superNamespace);
}
origin: org.openprovenance.prov/prov-model

public Document doAction(Document doc) {
List<Bundle> bRecords = new LinkedList<Bundle>();
List<Statement> sRecords = new LinkedList<Statement>();

Namespace docNamespace=doc.getNamespace();
  Namespace.withThreadNamespace(docNamespace);
  c.startDocument(doc.getNamespace());
for (Statement s : u.getStatement(doc)) {
  sRecords.add((Statement) u.doAction(s, this));
}
for (Bundle bu : u.getNamedBundle(doc)) {
  Namespace.withThreadNamespace(new Namespace(docNamespace));
  Bundle o = doAction(bu,u);
  if (o != null)
  bRecords.add(o);
}
return c.newDocument(doc.getNamespace(), sRecords, bRecords);
}
origin: lucmoreau/ProvToolbox

public Document doAction(Document doc) {
List<Bundle> bRecords = new LinkedList<Bundle>();
List<Statement> sRecords = new LinkedList<Statement>();

Namespace docNamespace=doc.getNamespace();
  Namespace.withThreadNamespace(docNamespace);
  c.startDocument(doc.getNamespace());
for (Statement s : u.getStatement(doc)) {
  sRecords.add((Statement) u.doAction(s, this));
}
for (Bundle bu : u.getNamedBundle(doc)) {
  Namespace.withThreadNamespace(new Namespace(docNamespace));
  Bundle o = doAction(bu,u);
  if (o != null)
  bRecords.add(o);
}
return c.newDocument(doc.getNamespace(), sRecords, bRecords);
}
origin: lucmoreau/ProvToolbox

public void writeDocument(org.openprovenance.prov.model.Document doc,
       String file) {
Namespace.withThreadNamespace(doc.getNamespace());
System.out.println("saving document ... ");
@SuppressWarnings("unused")
Document doc2 = u.persist((org.openprovenance.prov.sql.Document) doc);
dbKeys.put(file, ((org.openprovenance.prov.sql.Document) doc).getPk());
System.out.println("saved document "
  + ((org.openprovenance.prov.sql.Document) doc).getPk()
  + " for " + file);
}

origin: lucmoreau/ProvToolbox

public void writeXMLDocument(Document doc, String file) throws JAXBException {
ProvSerialiser serial = ProvSerialiser.getThreadProvSerialiser();
  Namespace.withThreadNamespace(doc.getNamespace());
serial.serialiseDocument(new File(file), doc, true);
StringWriter sw = new StringWriter();
serial.serialiseDocument(sw, doc, true);
}
origin: lucmoreau/ProvToolbox

public void writeXMLDocument(Document doc, String file) throws JAXBException {
  
ProvSerialiser serial = ProvSerialiser.getThreadProvSerialiser();
Namespace.withThreadNamespace(doc.getNamespace());
serial.serialiseDocument(new File(file), (org.openprovenance.prov.sql.Document)doc, true);
StringWriter sw = new StringWriter();
serial.serialiseDocument(sw, (org.openprovenance.prov.sql.Document)doc, true);
//System.out.println(sw.toString());
  }
@Override
origin: lucmoreau/ProvToolbox

public void writeDocument(Document doc, String file2) {
  Namespace.withThreadNamespace(doc.getNamespace());
  try {
    writeXMLDocument(doc, file2);
  } catch (JAXBException e) {
    throw new UncheckedTestException(e);
  }
}
origin: lucmoreau/ProvToolbox

@Override
public void writeDocument(Document doc, String file) {
  Namespace.withThreadNamespace(doc.getNamespace());
  String s = u.convertBeanToASN(doc,pFactory);
  u.writeTextToFile(s, file);
}
origin: lucmoreau/ProvToolbox

@Override
public void writeDocument(Document doc, String file) {
Namespace.withThreadNamespace(doc.getNamespace());
String s = u.convertBeanToASN(doc,pFactory);
u.writeTextToFile(s, file);
}
origin: lucmoreau/ProvToolbox

public void writeDocument(Document doc, String file2) {
  Namespace.withThreadNamespace(doc.getNamespace());
  try {
    writeXMLDocument(doc, file2);
  } catch (JAXBException e) {
    throw new UncheckedTestException(e);
  }
}
origin: lucmoreau/ProvToolbox

public void writeDocument(Document doc, String file2) {
Namespace.withThreadNamespace(doc.getNamespace());
  try {
    writeXMLDocument(doc, file2);
  } catch (JAXBException e) {
    throw new UncheckedTestException(e);
  }
}

origin: lucmoreau/ProvToolbox

public void writeDocument(Document doc, String file2) {
  Namespace.withThreadNamespace(doc.getNamespace());
  try {
    writeXMLDocument(doc, file2);
  } catch (JAXBException e) {
    throw new UncheckedTestException(e);
  }
}
origin: lucmoreau/ProvToolbox

@Override
public void writeDocument(Document doc, String file) {
Namespace.withThreadNamespace(doc.getNamespace());
String s = u.convertBeanToASN(doc,pFactory);
u.writeTextToFile(s, file);
}
origin: lucmoreau/ProvToolbox

@Override
public void writeDocument(Document doc, String file) {
Namespace.withThreadNamespace(doc.getNamespace());
String s = u.convertBeanToASN(doc,pFactory);
u.writeTextToFile(s, file);
}
origin: lucmoreau/ProvToolbox

public void testPC1SpecFull() throws JAXBException {
Document graph = makePC1GraphAndSpecialization(pFactory);
ProvSerialiser serial = ProvSerialiser.getThreadProvSerialiser();
  Namespace.withThreadNamespace(graph.getNamespace());
serial.serialiseDocument(new File("target/pc1-spec.xml"), graph, true);
graph1 = graph;
//System.out.println("PC1Full Test asserting True");
assertTrue(true);
}
origin: lucmoreau/ProvToolbox

public void subtestPC1Full() throws JAXBException {
Document graph = makePC1FullGraph(pFactory);
ProvSerialiser serial = ProvSerialiser.getThreadProvSerialiser();
  Namespace.withThreadNamespace(graph.getNamespace());
serial.serialiseDocument(new File("target/pc1-full.xml"), graph, true);
graph1 = graph;
//System.out.println("PC1Full Test asserting True");
assertTrue(true);
}
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 void fileToDot(String asnFile, String xmlFile, String dotFile, String pdfFile, String title)
  throws java.io.FileNotFoundException,  java.io.IOException, JAXBException, Throwable {
  Utility u=new Utility();
  ProvFactory pFactory=ProvFactory.getFactory();
  Document o= (Document) u.convertASNToJavaBean(asnFile,pFactory);
Namespace.withThreadNamespace(o.getNamespace());
System.out.println("ns is " + o.getNamespace());
  ProvSerialiser serial=ProvSerialiser.getThreadProvSerialiser();
  
  serial.serialiseDocument(new File(xmlFile),o,true);
  ProvToDot toDot=new ProvToDot("src/main/resources/defaultConfigWithRoleNoLabel.xml"); 
  
  toDot.convert(o,dotFile,pdfFile,title);
}
origin: lucmoreau/ProvToolbox

public void sculptureToDot(String asnFile, String xmlFile, String dotFile, String pdfFile, String title) 
  throws java.io.FileNotFoundException,  java.io.IOException, JAXBException, Throwable {
  Utility u=new Utility();
  ProvFactory pFactory=ProvFactory.getFactory();
  Document o= (Document) u.convertASNToJavaBean(asnFile,pFactory);
  Namespace.withThreadNamespace(o.getNamespace());
  ProvSerialiser serial=ProvSerialiser.getThreadProvSerialiser();
  
  serial.serialiseDocument(new File(xmlFile),o,true);
  ProvToDot toDot=new ProvToDot("src/main/resources/defaultConfigWithRoleNoLabel.xml"); 
  
  toDot.convert(o,dotFile,pdfFile,title);
}
origin: lucmoreau/ProvToolbox

public void testReadASNSaveXML(String file, String file2) throws java.io.IOException, java.lang.Throwable {
  Utility u=new Utility();
  CommonTree tree = u.convertASNToTree(file);
  Object o2=u.convertTreeToJavaBean(tree,pFactory);
  graph1=(Document)o2;
  graph1.setNamespace(Namespace.gatherNamespaces(graph1));
  try {
    ProvSerialiser serial=ProvSerialiser.getThreadProvSerialiser();
    Namespace.withThreadNamespace(graph1.getNamespace());
    serial.serialiseDocument(new File(file2),(Document)o2,true);
    assertTrue(true);
  } catch (JAXBException e) {
    e.printStackTrace();
  }
}
org.openprovenance.prov.modelNamespacewithThreadNamespace

Popular methods of Namespace

  • <init>
  • getDefaultNamespace
  • getPrefixes
  • gatherNamespaces
  • register
  • setParent
  • stringToQualifiedName
  • getNamespaces
  • addKnownNamespaces
  • qualifiedNameToString
  • registerDefault
  • extendWith
    Extends this Namespace with all the prefix/namespace registration of the Namespace received as argum
  • registerDefault,
  • extendWith,
  • getParent,
  • getThreadNamespace,
  • newPrefix,
  • qualifiedNameToStringWithNamespace,
  • setDefaultNamespace,
  • check,
  • qualifiedName

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
  • Option (scala)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)