SpinRenderer { public SpinRenderer() { this(Output.TEXT_AND_RDF); } SpinRenderer();  SpinRenderer(Output output);  SpinRenderer(Output output, Function<String, IRI> wellKnownVarMapper,
			Function<String, IRI> wellKnownFuncMapper, ValueFactory vf); void render(ParsedOperation operation, RDFHandler handler); void render(ParsedQuery query, RDFHandler handler); void render(ParsedBooleanQuery query, RDFHandler handler); void render(ParsedTupleQuery query, RDFHandler handler); void render(ParsedDescribeQuery query, RDFHandler handler); void render(ParsedGraphQuery query, RDFHandler handler); void render(ParsedUpdate update, RDFHandler handler);  }
@Test public void testSpinRenderer() throws IOException, RDF4JException { StatementCollector expected = new StatementCollector(); RDFParser parser = Rio.createParser(RDFFormat.TURTLE); parser.setRDFHandler(expected); try (InputStream rdfStream = testURL.openStream()) { parser.parse(rdfStream, testURL.toString()); } String query = null; for (Statement stmt : expected.getStatements()) { if (SP.TEXT_PROPERTY.equals(stmt.getPredicate())) { query = stmt.getObject().stringValue(); break; } } assertNotNull(query); ParsedOperation parsedOp = QueryParserUtil.parseOperation(QueryLanguage.SPARQL, query, testURL.toString()); StatementCollector actual = new StatementCollector(); renderer.render(parsedOp, actual); Object operation = (parsedOp instanceof ParsedQuery) ? ((ParsedQuery) parsedOp).getTupleExpr() : ((ParsedUpdate) parsedOp).getUpdateExprs(); assertTrue("Operation was\n" + operation + "\nExpected\n" + toRDF(expected) + "\nbut was\n" + toRDF(actual), Models.isomorphic(actual.getStatements(), expected.getStatements())); }