/* Adapted from Sesame's RepositoryConnectionBase.addInputStreamOrReader() */
private void addData(Graph graph, InputStream is, RDFFormat dataFormat, String baseURI, Resource... contexts) throws RDFParseException, RDFHandlerException, IOException
{
OpenRDFUtil.verifyContextNotNull(contexts);
RDFParser rdfParser = Rio.createParser(dataFormat, graph.getValueFactory());
rdfParser.setVerifyData(true);
rdfParser.setStopAtFirstError(true);
rdfParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
RDFGraphInserter rdfInserter = new RDFGraphInserter(graph, contexts);
rdfParser.setRDFHandler(rdfInserter);
rdfParser.parse(is, baseURI);
}