bw.write(jsonContext);
bw.close();
GenericRDFGenerator rdfGen = new GenericRDFGenerator(null);
// Add the models in;
R2RMLMappingIdentifier modelIdentifier = new R2RMLMappingIdentifier(
"generic-model", new URL(r2rmlURI));
rdfGen.addModel(modelIdentifier);
//String filename = "context/events.json";
//String contextName = "context/events_context.json";
logger.info("Loading json file: " + jsonContext);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
//File contextFile = new File(getTestResource(contextName).toURI()); GIVE FUCKS LATER
JSONTokener token = new JSONTokener(IOUtils.toInputStream(jsonContext)); //PERFECCT
//logger.info(new JSONObject(token).getString("@context"));
ContextIdentifier contextId = new ContextIdentifier("generic-context", contextFile.toURI().toURL());
JSONKR2RMLRDFWriter writer = new JSONKR2RMLRDFWriter(pw);
writer.setGlobalContext(new JSONObject(token), contextId);
RDFGeneratorRequest request = new RDFGeneratorRequest("generic-model", "whatsinthename");
request.setInputStream(dataStream); //DOUBLE PERFECCT;input json take care of
request.setAddProvenance(false);
request.setDataType(InputType.JSON);
request.addWriter(writer);
rdfGen.generateRDF(request);
String rdf = sw.toString();
return rdf;
}