From 3822b6a1134e5a8b7fa2ffc3023402d2950c2d20 Mon Sep 17 00:00:00 2001 From: Nikolaos Konstantinou Date: Thu, 31 Oct 2013 16:53:31 +0200 Subject: [PATCH] bugfixing --- dspace/dspace-mapping.rdf | 2 +- src/main/java/gr/seab/r2rml/beans/Generator.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dspace/dspace-mapping.rdf b/dspace/dspace-mapping.rdf index e02f344..71df36c 100644 --- a/dspace/dspace-mapping.rdf +++ b/dspace/dspace-mapping.rdf @@ -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"}'; ]; diff --git a/src/main/java/gr/seab/r2rml/beans/Generator.java b/src/main/java/gr/seab/r2rml/beans/Generator.java index 703f888..ca7bb03 100644 --- a/src/main/java/gr/seab/r2rml/beans/Generator.java +++ b/src/main/java/gr/seab/r2rml/beans/Generator.java @@ -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; @@ -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; @@ -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; } @@ -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; } @@ -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) { @@ -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();