public RdfWriter(RDFFormat format, OutputStream output) throws UnsupportedRDFormatException { this.writer = Rio.createWriter(format, output); }
@Override public void exportReadableToStream( PrintStream out ) throws IOException { RDFWriter rdfWriter = Rio.createWriter( RDFFormat.TRIG, out ); exportToWriter( rdfWriter ); }
@Override public void exportFormalToWriter( PrintWriter out ) throws IOException { RDFWriter rdfWriter = Rio.createWriter( RDFFormat.RDFXML, out ); exportToWriter( rdfWriter ); }
@Override public void exportFormalToWriter( PrintWriter out ) throws IOException { RDFWriter rdfWriter = Rio.createWriter( RDFFormat.RDFXML, out ); exportToWriter( rdfWriter ); }
@Override public void write(OutputStream outputStream) throws IOException, WebApplicationException { try { final RDFWriter writer = Rio.createWriter(format, outputStream); sparqlService.createServiceDescription(writer, request.getRequestURL().toString(), isUpdate); } catch (RDFHandlerException e) { log.warn("Could not send SpaqlServiceDescription", e); throw new NoLogWebApplicationException(e, Response.serverError().entity(e).build()); } } };
public static void exportRepoToN3(Repository rep, String filePath) throws RepositoryException, FileNotFoundException, RDFHandlerException{ File repoFile = new File(filePath); FileOutputStream fosRepo = new FileOutputStream(repoFile); RDFWriter repoWriter = Rio.createWriter(RDFFormat.N3, fosRepo); rep.getConnection().export(repoWriter); }
public static void exportRepoToN3(Repository rep, String filePath) throws RepositoryException, FileNotFoundException, RDFHandlerException{ File repoFile = new File(filePath); FileOutputStream fosRepo = new FileOutputStream(repoFile); RDFWriter repoWriter = Rio.createWriter(RDFFormat.N3, fosRepo); rep.getConnection().export(repoWriter); }
public static void exportRepoToN3(Repository rep, String filePath) throws RepositoryException, FileNotFoundException, RDFHandlerException{ File repoFile = new File(filePath); FileOutputStream fosRepo = new FileOutputStream(repoFile); RDFWriter repoWriter = Rio.createWriter(RDFFormat.N3, fosRepo); rep.getConnection().export(repoWriter); }
private static RDFWriter createWriter(RDFFormat format, OutputStream out) { if (format.equals(RDFFormat.RDFXML)) { return new RDFXMLPrettyWriter(out); } return Rio.createWriter(format, out); }
@Override public void writeTo(OutputStream stream, Syntax syntax) throws IOException, ModelRuntimeException { RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), stream); writeTo(rdfWriter); }
/** * Writes the whole ModelSet to the Writer. Depending on the Syntax the * context URIs might or might not be serialized. TriX should be able to * serialize contexts. */ @Override public void writeTo(Writer writer, Syntax syntax) throws IOException, ModelRuntimeException { RDFWriter rdfWriter = Rio.createWriter(RepositoryModel .getRDFFormat(syntax), writer); this.writeTo(rdfWriter); }
@Override public void writeTo(OutputStream stream, Syntax syntax) throws // interface allows it IOException, ModelRuntimeException { RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), stream); writeTo(rdfWriter); }
/** * Writes the whole ModelSet to the Writer. Depending on the Syntax the * context URIs might or might not be serialized. TriX should be able to * serialize contexts. */ @Override public void writeTo(Writer writer, Syntax syntax) throws IOException, ModelRuntimeException { RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), writer); this.writeTo(rdfWriter); }
private static RDFWriter createWriter(RDFFormat format, Writer writer) { if (format.equals(RDFFormat.RDFXML)) { return new RDFXMLPrettyWriter(writer); } return Rio.createWriter(format, writer); }
/** * Writes the whole ModelSet to the OutputStream. Depending on the Syntax * the context URIs might or might not be serialized. TriX should be able to * serialize contexts. */ @Override public void writeTo(OutputStream out, Syntax syntax) throws IOException, ModelRuntimeException { RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), out); this.writeTo(rdfWriter); }
private SeRQOBuilder createBuilder(Writer writer) { SeRQOBuilder builder = new SeRQOBuilder(); RDFWriter rdf = Rio.createWriter(format, writer); builder.setRDFHandler(rdf); return builder; }
public void writeTo(Writer writer, Syntax syntax) throws ModelRuntimeException { assertModel(); RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), writer); writeTo(rdfWriter); }
@Override public void writeTo(Writer writer, Syntax syntax) throws ModelRuntimeException { assertModel(); RDFWriter rdfWriter = Rio.createWriter(getRDFFormat(syntax), writer); writeTo(rdfWriter); }
@Test public void testWriterFactoryRegistered() { final RDFFormat fmt = Rio.getWriterFormatForMIMEType("application/rdf+json"); Assert.assertNotNull("Could not find the RDF/JSON RDFFormat instance", fmt); final RDFWriter writer = Rio.createWriter(fmt, new StringWriter()); Assert.assertTrue(writer instanceof RDFJSONWriter); }
@Test public void testWriterFactoryRegisteredAlternate() { final RDFFormat fmt = Rio.getWriterFormatForMIMEType("application/json"); Assert.assertNotNull("Could not find the RDF/JSON RDFFormat instance", fmt); final RDFWriter writer = Rio.createWriter(fmt, new StringWriter()); Assert.assertTrue(writer instanceof RDFJSONWriter); } }