@Test public void OpenStream_with_Resource() throws IOException { assertTrue(new RDFSource("classpath:/test.ttl", Format.TURTLE, "test:context").openStream() != null); assertTrue(new RDFSource("file:src/test/resources/test.ttl", Format.TURTLE, "test:context").openStream() != null); assertTrue(new RDFSource("classpath:/tes.ttl", Format.TURTLE, "test:context").openStream() == null); }
ValueFactory vf = connection.getValueFactory(); for (RDFSource source : sources) { if (source.getResource() != null){ logger.info("loading " + source.getResource()); connection.add(source.openStream(), source.getContext(), FormatHelper.getFormat(source.getFormat()), vf.createURI(source.getContext()));
ValueFactory vf = connection.getValueFactory(); for (RDFSource source : sources) { if (source.getResource() != null) { logger.info("loading " + source.getResource()); connection.add(source.openStream(), source.getContext(), FormatHelper.getFormat(source.getFormat()), vf.createURI(source.getContext()));
ValueFactory vf = connection.getValueFactory(); for (RDFSource source : sources) { if (source.getResource() != null) { logger.info("loading " + source.getResource()); connection.add(source.openStream(), source.getContext(), FormatHelper.getFormat(source.getFormat()), vf.createURI(source.getContext()));
@Test public void OpenStream_with_Input() throws IOException { InputStream input = new ByteArrayInputStream("abc".getBytes("UTF-8")); RDFSource source = new RDFSource(input, Format.TURTLE, "test:context"); assertEquals("abc", new String(ByteStreams.toByteArray(source.openStream()), Charsets.UTF_8)); }