"Please align the worksheet before generating RDF!"));
}
// Generate the KR2RML data structures for the RDF generation
final ErrorReport errorReport = new ErrorReport();
KR2RMLMappingGenerator mappingGen = null;
String url = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(Property.modelUrl);
String modelContext = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(Property.modelContext);
TripleStoreUtil utilObj = new TripleStoreUtil();
String modelRepoUrl = worksheet.getMetadataContainer().getWorksheetProperties().getPropertyValue(Property.modelRepository);
modelRepoUrl = modelRepoUrl == null || modelRepoUrl.isEmpty()? TripleStoreUtil.defaultModelsRepoUrl : modelRepoUrl;
Map<String, String> bloomfilterMapping = new HashMap<String, String>();
boolean result = true;
try{
mappingGen = new KR2RMLMappingGenerator(workspace, worksheet,
alignment, worksheet.getSemanticTypes(), rdfSourcePrefix, rdfSourceNamespace,
Boolean.valueOf(addInverseProperties), errorReport);
}
catch (KarmaException e)
{
logger.error("Error occured while generating RDF!", e);
return new UpdateContainer(new ErrorUpdate("Error occured while generating RDF: " + e.getMessage()));
}
KR2RMLMapping mapping = mappingGen.getKR2RMLMapping();
if (url != null && !url.trim().isEmpty() && modelContext != null && !modelContext.trim().isEmpty() && generateBloomFilters && utilObj.testURIExists(modelRepoUrl, "", url)) {
try {
File tmp = new File("tmp");
PrintWriter pw = new PrintWriter(tmp);
pw.println(utilObj.getMappingFromTripleStore(modelRepoUrl, modelContext, url));