From 4c17c6501949766aaebc09922533e3bff4f70f4c Mon Sep 17 00:00:00 2001 From: sjm222 Date: Tue, 4 Jan 2011 19:35:42 +0000 Subject: [PATCH] incremental development for NIHVIVO-1286 --- .../webapp/ontology/update/ABoxUpdater.java | 8 ++------ .../ontology/update/DateTimeMigration.java | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java index 505df5d9d..3222cb60c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java @@ -421,11 +421,7 @@ public class ABoxUpdater { Statement newStmt = ResourceFactory.createStatement(stmt.getObject().asResource(), addedProperty, stmt.getSubject()); additions.add(newStmt); } else { - logger.log("WARNING: expected the object of this statement to be a Resource, and it's not. No inverse has been asserted: " + - " subject = " + stmt.getSubject().getURI() + - " property = " + stmt.getPredicate().getURI() + - " object = " + (stmt.getObject().isLiteral() ? ((Literal)stmt.getObject()).getLexicalForm() - : ((Resource)stmt.getObject()).getURI())); + logger.log("WARNING: expected the object of this statement to be a Resource but it is not. No inverse has been asserted: " + stmtString(stmt)); } } @@ -438,7 +434,7 @@ public class ABoxUpdater { " with predicate " + addedProperty.getURI() + " " + ((additions.size() > 1) ? "were" : "was") + " added (as an inverse to existing " + inverseOfAddedProperty.getURI() + - " assertions"); + " assertions)"); } } finally { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/DateTimeMigration.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/DateTimeMigration.java index 438ee5fdf..606b9f4ea 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/DateTimeMigration.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/DateTimeMigration.java @@ -114,11 +114,16 @@ public class DateTimeMigration { record.recordRetractions(retractions); aboxModel.add(additions); record.recordAdditions(additions); - + + if (additions.size() > 0) { + long count = additions.size() / 2; + logger.log(count + "Academic Term and/or Year statement" + ((count > 1) ? "s" : "") + " were updated to use dateTimeInterval instead"); + } } finally { aboxModel.leaveCriticalSection(); } } + /** * * @@ -189,7 +194,12 @@ public class DateTimeMigration { record.recordRetractions(retractions); aboxModel.add(additions); record.recordAdditions(additions); - + + if (additions.size() > 0) { + logger.log(additions.size() + " date/time assertions" + + ((additions.size() > 1) ? "s" : "") + + " were updated to the 1.2 representation."); + } } finally { aboxModel.leaveCriticalSection(); } @@ -231,8 +241,8 @@ public class DateTimeMigration { public static String stmtString(Statement statement) { return " subject = " + statement.getSubject().getURI() + - " property = " + statement.getPredicate().getURI() + - " object = " + (statement.getObject().isLiteral() ? ((Literal)statement.getObject()).getLexicalForm() + " (Literal)" + " property = " + statement.getPredicate().getURI() + + " object = " + (statement.getObject().isLiteral() ? ((Literal)statement.getObject()).getLexicalForm() + " (Literal)" : ((Resource)statement.getObject()).getURI() + " (Resource)"); } } \ No newline at end of file