### Question:
Rdf4jRdfParser implements RdfParser { @Override public void importRdf(CachedLog input, String baseUri, String defaultGraph, RdfProcessor rdfProcessor) throws RdfProcessingFailedException, RdfProcessingParseException { try { RDFFormat format = Rio.getParserFormatForMIMEType(input.getMimeType().toString()) .orElseThrow( () -> new UnsupportedRDFormatException(input.getMimeType() + " is not a supported rdf type.") ); RDFParser rdfParser = Rio.createParser(format); rdfParser.setPreserveBNodeIDs(true); rdfParser.setRDFHandler(new TimRdfHandler(rdfProcessor, baseUri, defaultGraph, input.getFile().getName())); rdfParser.parse(input.getReader(), baseUri); } catch (IOException | UnsupportedRDFormatException e) { throw new RdfProcessingFailedException(e); } catch (RDFParseException e) { throw new Rdf4jRdfProcessingParseException(e, input); } catch (RDFHandlerException e) { if (e.getCause() instanceof RdfProcessingFailedException) { throw (RdfProcessingFailedException) e.getCause(); } else { throw new RdfProcessingFailedException(e); } } }  @Override void importRdf(CachedLog input, String baseUri, String defaultGraph, RdfProcessor rdfProcessor);  }### Answer:
@Test public void supportsNQuadsUdDeletions() throws Exception { RDFParserRegistry.getInstance().add(new NquadsUdParserFactory()); RdfProcessor rdfProcessor = mock(RdfProcessor.class); StringReader reader = new StringReader("-<http: Rdf4jRdfParser instance = new Rdf4jRdfParser(); instance.importRdf(rdfPatchLog(reader, File.createTempFile("test", "rdf")), "", "", rdfProcessor); verify(rdfProcessor).onQuad( DELETE, "http: "http: "12", "http: null, "http: ); }
@Test public void handlesBlankNodeSubjectProperly() throws Exception { RDFParserRegistry.getInstance().add(new NquadsUdParserFactory()); RdfProcessor rdfProcessor = mock(RdfProcessor.class); StringReader reader = new StringReader("+_:alice <http: Rdf4jRdfParser instance = new Rdf4jRdfParser(); File tempFile = File.createTempFile("test", "rdf"); instance.importRdf(rdfPatchLog(reader, tempFile), "http: verify(rdfProcessor).onQuad( ADD, "http: "http: "12", "http: null, "http: ); }
@Test public void handlesBlankNodeObjectProperly() throws Exception { RDFParserRegistry.getInstance().add(new NquadsUdParserFactory()); RdfProcessor rdfProcessor = mock(RdfProcessor.class); StringReader reader = new StringReader("+_:alice <http: Rdf4jRdfParser instance = new Rdf4jRdfParser(); File tempFile = File.createTempFile("test", "rdf"); instance.importRdf(rdfPatchLog(reader, tempFile), "http: verify(rdfProcessor).onQuad( ADD, "http: "http: "http: null, null, "http: ); }