RDFParser rdfxmlParser = createRDFParser();
rdfxmlParser.setValueFactory(new CanonXMLValueFactory());
rdfxmlParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
Set<Statement> inputCollection = new LinkedHashSet<Statement>();
StatementCollector inputCollector = new StatementCollector(inputCollection);
rdfxmlParser.setRDFHandler(inputCollector);
InputStream in = resolveURL(inputURL).openStream();
rdfxmlParser.parse(in, base(inputURL));
in.close();
// Parse expected output data
NTriplesParser ntriplesParser = new NTriplesParser();
ntriplesParser.setValueFactory(new CanonXMLValueFactory());
ntriplesParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
Set<Statement> outputCollection = new LinkedHashSet<Statement>();
StatementCollector outputCollector = new StatementCollector(outputCollection);
ntriplesParser.setRDFHandler(outputCollector);
in = resolveURL(outputURL).openStream();
ntriplesParser.parse(in, base(inputURL));
in.close();