private void writeModel(Workspace workspace, OntologyManager ontMgr,
KR2RMLMappingGenerator mappingGen, Worksheet worksheet, String modelFileLocalPath)
throws RepositoryException, FileNotFoundException,
UnsupportedEncodingException, JSONException {
File f = new File(modelFileLocalPath);
File parentDir = f.getParentFile();
parentDir.mkdirs();
PrintWriter writer = new PrintWriter(f, "UTF-8");
KR2RMLMappingWriter mappingWriter = new KR2RMLMappingWriter();
mappingWriter.addR2RMLMapping(mappingGen.getKR2RMLMapping(), worksheet, workspace);
mappingWriter.writeR2RMLMapping(writer);
mappingWriter.close();
writer.flush();
writer.close();
if(OSUtils.isWindows())
System.gc();
}