final String inputstring = "{ \"@id\":\"http://nonexistent.com/abox#Document1823812\", \"@type\":\"http://nonexistent.com/tbox#Document\" }";
final String expectedString = "(http://nonexistent.com/abox#Document1823812, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, http://nonexistent.com/tbox#Document) [null]";
final Object input = JsonUtils.fromString(inputstring);
final Graph graph = new LinkedHashModel();
final ParseErrorCollector parseErrorListener = new ParseErrorCollector();
final ParserConfig parserConfig = new ParserConfig();
final SesameTripleCallback callback = new SesameTripleCallback(
new StatementCollector(graph), ValueFactoryImpl.getInstance(), parserConfig,
parseErrorListener);
JsonLdProcessor.toRDF(input, callback);
final Iterator<Statement> statements = graph.iterator();
// contains only one statement (type)
while (statements.hasNext()) {
final Statement stmt = statements.next();
System.out.println(stmt.toString());
assertEquals("Output was not as expected", stmt.toString(), expectedString);
}
assertEquals(0, parseErrorListener.getFatalErrors().size());
assertEquals(0, parseErrorListener.getErrors().size());
assertEquals(0, parseErrorListener.getWarnings().size());
}