final Statement st4 = vf.createStatement(uri1, uri2, litWithNewline);
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);
rdfWriter.handleStatement(st4);
rdfWriter.handleStatement(st5);
rdfWriter.handleStatement(st6);
rdfWriter.endRDF();
final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
final RDFParser rdfParser = rdfParserFactory.getParser();
final ParserConfig config = new ParserConfig();
config.set(BasicParserSettings.FAIL_ON_UNKNOWN_DATATYPES, true);