@Test public void wfdesc() throws Exception { io.writeBundle(localDependency, output, "text/vnd.wf4ever.wfdesc+turtle"); // FIXME: Update test to use Jena // Repository myRepository = new SailRepository(new MemoryStore()); // myRepository.initialize(); // RepositoryConnection con = myRepository.getConnection(); // String root = "app://f0b5fb9c-b180-45b3-afb4-8d70bbb27190/"; // //System.out.write(output.toByteArray()); // con.add(new ByteArrayInputStream(output.toByteArray()), root, RDFFormat.TURTLE); // // assertTrue(con.prepareBooleanQuery(QueryLanguage.SPARQL, // "PREFIX wfdesc: <http://purl.org/wf4ever/wfdesc#> " + // "PREFIX wf4ever: <http://purl.org/wf4ever/wf4ever#> " + // "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " + // "PREFIX roterms: <http://purl.org/wf4ever/roterms#> " + // "ASK { " + // "?wf a wfdesc:Workflow ;" + // " wfdesc:hasSubProcess ?beanshell . " + // "?beanshell a wfdesc:Process, wf4ever:BeanshellScript ;" + // " wf4ever:script ?script ; " + // " roterms:requiresSoftware ?sw . " + // "?sw rdfs:label \"hello.jar\" ; " + // " rdfs:comment \"JAR dependency\" ." + // "}").evaluate()); }
@Before public void loadDepdenency() throws Exception { InputStream localStream = getClass().getResourceAsStream("/" + LOCALDEPENDENCY); assertNotNull(localStream); localDependency = io.readBundle(localStream, "application/vnd.taverna.t2flow+xml"); assertNotNull(localDependency); }
@Before public void loadDepdenency() throws Exception { InputStream localStream = getClass().getResourceAsStream("/" + T3_1226); assertNotNull(localStream); workflow = io.readBundle(localStream, "application/vnd.taverna.t2flow+xml"); assertNotNull(workflow); }
private String guessMediaTypeForResource(String resource) throws IOException { byte[] firstBytes = new byte[1024]; InputStream s = getClass().getResourceAsStream(resource); assertNotNull("Could not find " + resource, s); try { s.read(firstBytes); } finally { s.close(); } return io.guessMediaTypeForSignature(firstBytes); }