// Parse input data
TurtleParser turtleParser = new TurtleParser();
turtleParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
Set<Statement> inputCollection = new LinkedHashSet<Statement>();
StatementCollector inputCollector = new StatementCollector(inputCollection);
turtleParser.setRDFHandler(inputCollector);
InputStream in = inputURL.openStream();
turtleParser.parse(in, baseURL);
in.close();
// Parse expected output data
NTriplesParser ntriplesParser = new NTriplesParser();
ntriplesParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
Set<Statement> outputCollection = new LinkedHashSet<Statement>();
StatementCollector outputCollector = new StatementCollector(outputCollection);
ntriplesParser.setRDFHandler(outputCollector);
in = outputURL.openStream();
ntriplesParser.parse(in, baseURL);
in.close();