ROEvoSerializer { public void workflowHistory(Workflow mainWorkflow, OutputStream output) throws WriterException { OntModel model = ModelFactory.createOntologyModel(); Revision revision = mainWorkflow.getCurrentRevision(); Revision previous = revision.getPreviousRevision(); addRevision(model, revision); while (previous != null) { addRevision(model, previous); addPrevious(model, revision, previous); revision = previous; previous = revision.getPreviousRevision(); } java.net.URI baseURI = Workflow.WORKFLOW_ROOT; model.setNsPrefix("roevo", "http: model.setNsPrefix("prov", "http: model.setNsPrefix("rdfs", "http: model.write(output, "Turtle", baseURI.toASCIIString()); }  void workflowHistory(Workflow mainWorkflow, OutputStream output);  }
@Test public void workflowUUIDs() throws Exception { ByteArrayOutputStream os = new ByteArrayOutputStream(); roEvo.workflowHistory(helloWorld.getMainWorkflow(), os); System.out.write(os.toByteArray()); assertTrue(500 < os.size()); String ttl = os.toString("UTF-8"); assertTrue(ttl.contains("01348671-5aaa-4cc2-84cc-477329b70b0d")); assertTrue(ttl.contains("VersionableResource")); assertTrue(ttl.contains("Entity")); OntModel m = ModelFactory.createOntologyModel(); m.read(new ByteArrayInputStream(os.toByteArray()), "http: Resource mainWf = m.getResource(helloWorld.getMainWorkflow().getIdentifier().toASCIIString()); Resource older = mainWf.getProperty(prov.wasRevisionOf).getResource(); Resource oldest = older.getProperty(prov.wasRevisionOf).getResource(); assertNull(oldest.getProperty(prov.wasRevisionOf)); }