}
// Prepare required Karma objects
Workspace workspace = initializeWorkspace();
RepFactory factory = workspace.getFactory();
Worksheet wk = factory.createWorksheet(wkname, workspace, encoding);
List<String> headersList = addHeaders(wk, columnNames, factory);
int counter = 0;
ArrayList<String> rowValues = null;
while ((rowValues = dbUtil.parseResultSetRow(r)) != null) {
// Generate RDF and create a new worksheet for every DATABASE_TABLE_FETCH_SIZE rows
if(counter%DATABASE_TABLE_FETCH_SIZE == 0 && counter != 0) {
generateRDFFromWorksheet(wk, workspace, mapping, writers, baseURI);
logger.debug("Done for " + counter + " rows ..." );
removeWorkspace(workspace);
parserTest = new WorksheetR2RMLJenaModelParser(id);
mapping = parserTest.parse();
workspace = initializeWorkspace();
factory = workspace.getFactory();
wk = factory.createWorksheet(wkname, workspace, encoding);
headersList = addHeaders(wk, columnNames, factory);
}
/** Add the data **/