Skip to content

Commit

Permalink
bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
nkons committed Oct 31, 2013
1 parent fca3903 commit 3822b6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dspace/dspace-mapping.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ map:dc-format-medium
#map:dc-format-mimetype

map:dc-identifier
rr:logicalTable <#dc-identifier-uri-view>;
rr:logicalTable <#dc-identifier-view>;
rr:subjectMap [
rr:template 'http://data.example.org/repository/item/{"handle"}';
];
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/gr/seab/r2rml/beans/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public void createTriples(MappingDocument mappingDocument) {
try {
resultModel.read(isMap, null, "N-TRIPLE");
} catch (Exception e) {
log.error(e.toString());
log.error("Error reading last run model. Cannot proceed with incremental, going for a full run."); // Please change property default.incremental in file r2rml.properties to false.
resultModel.setNsPrefixes(mappingDocument.getPrefixes());
incremental = false;
Expand All @@ -120,6 +121,7 @@ public void createTriples(MappingDocument mappingDocument) {
logModel.read(isMapLog, properties.getProperty("default.namespace"), properties.getProperty("mapping.file.type"));
if (incremental) log.info("Going to dump incrementally, based on log file " + properties.getProperty("default.log"));
} catch (Exception e) {
log.error(e.toString());
log.error("Error reading log. Cannot proceed with incremental, going for a full run."); //Please change property default.incremental in file r2rml.properties to false.
incremental = false;
writeReifiedModel = true;
Expand Down Expand Up @@ -155,6 +157,7 @@ public void createTriples(MappingDocument mappingDocument) {
}
rsIter.close();
} catch (Exception e) {
log.error(e.toString());
log.error("Error trying to read destination file. Forcing full mapping.");
executeAllMappings = true;
}
Expand All @@ -176,6 +179,7 @@ public void createTriples(MappingDocument mappingDocument) {
executeAllMappings = true;
}
} catch (Exception e) {
log.error(e.toString());
log.error("Error trying to read log file. Forcing full mapping.");
executeAllMappings = true;
}
Expand Down Expand Up @@ -406,7 +410,7 @@ public void createTriples(MappingDocument mappingDocument) {
BaseDatatype xsdDataType = findFieldDataType(field, rs);
predicateObjectMap.setDataType(xsdDataType);
} catch (Exception e) {
log.error(e.getMessage());
log.error(e.toString());
}

if (test != null) {
Expand Down Expand Up @@ -712,7 +716,7 @@ public void createTriples(MappingDocument mappingDocument) {
Literal oFileSize = logModel.createLiteral(String.valueOf(fileSize));
logModel.add(logModel.createResource(logNs + "destinationFile"), pFileSize, oFileSize);

if (incremental) {
if (writeReifiedModel) {
if (verbose) log.info("Logging reified model file size");
Property pReifiedModelFileSize = logModel.createProperty(logNs + "reifiedModelFileSize");
long reifiedModelfileSize = new File(reifiedModelFileName).length();
Expand Down

0 comments on commit 3822b6a

Please sign in to comment.