final Statement st5 = vf.createStatement(uri1, uri2, litWithSingleQuotes);
final Statement st6 = vf.createStatement(uri1, uri2, litWithDoubleQuotes);
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final RDFWriter rdfWriter = rdfWriterFactory.getWriter(out);
final WriterConfig writerConfig = rdfWriter.getWriterConfig();
writerConfig.set(BasicWriterSettings.RDF_LANGSTRING_TO_LANG_LITERAL, true);
writerConfig.set(BasicWriterSettings.XSD_STRING_TO_PLAIN_LITERAL, true);
rdfWriter.handleNamespace("ex", ex);
rdfWriter.startRDF();
rdfWriter.handleStatement(st1);
rdfWriter.handleStatement(st2);
rdfWriter.handleStatement(st3);