kb migration logging correction (rename --> remove)

This commit is contained in:
sjm222 2011-02-03 01:13:23 +00:00
parent 080f0a818c
commit 909f2b8670

View file

@ -177,11 +177,9 @@ public class ABoxUpdater {
//log summary of changes //log summary of changes
if (renameCount > 0) { if (renameCount > 0) {
logger.log("Changed " + renameCount + " subject reference" + ((renameCount > 1) ? "s" : "") + " from type" + oldClass.getURI() + " to type " + newClass.getURI()); logger.log("Changed " + renameCount + " subject reference" + ((renameCount > 1) ? "s" : "") + " from type" + oldClass.getURI() + " to type " + newClass.getURI());
//logger.log(renameCount + " subject reference" + ((renameCount > 1) ? "s" : "") + " to the " + oldClass.getURI() + " class " + ((renameCount > 1) ? "were" : "was") +" changed to " + newClass.getURI());
} }
if (removeCount > 0) { if (removeCount > 0) {
logger.log("Changed " + removeCount + " remaining subject reference" + ((removeCount > 1) ? "s" : "") + " to the " + oldClass.getURI() + " class"); logger.log("Removed " + removeCount + " remaining subject reference" + ((removeCount > 1) ? "s" : "") + " to the " + oldClass.getURI() + " class");
//logger.log(removeCount + " remaining subject reference" + ((removeCount > 1) ? "s" : "") + " to the " + oldClass.getURI() + " class " + ((removeCount > 1) ? "were" : "was") + "removed." );
} }
// Change class references in the objects of rdf:type statements // Change class references in the objects of rdf:type statements
@ -198,7 +196,6 @@ public class ABoxUpdater {
//log summary of changes //log summary of changes
if (renameCount > 0) { if (renameCount > 0) {
//logger.log(renameCount + " object reference" + ((renameCount > 1) ? "s" : "") + " to the " + oldClass.getURI() + " class " + ((renameCount > 1) ? "were" : "was") + " changed to " + newClass.getURI());
logger.log("Renamed " + renameCount + " object reference" + ((renameCount > 1) ? "s" : "") + " from type " + oldClass.getURI() + " to type " + newClass.getURI()); logger.log("Renamed " + renameCount + " object reference" + ((renameCount > 1) ? "s" : "") + " from type " + oldClass.getURI() + " to type " + newClass.getURI());
} }
@ -370,7 +367,6 @@ public class ABoxUpdater {
} }
if (count > 0) { if (count > 0) {
//logger.log(count + " subject reference" + ((count > 1) ? "s" : "") + " to the " + deletedClass.getURI() + " class " + ((count > 1) ? "were" : "was") + " removed.");
logger.log("Removed " + count + " subject reference" + ((count > 1) ? "s" : "") + " to the " + deletedClass.getURI() + " class"); logger.log("Removed " + count + " subject reference" + ((count > 1) ? "s" : "") + " to the " + deletedClass.getURI() + " class");
} }
} finally { } finally {
@ -396,7 +392,6 @@ public class ABoxUpdater {
//log summary of changes //log summary of changes
if (count > 0) { if (count > 0) {
//logger.log(count + " instance" + ((count > 1) ? "s" : "") + " of the " + deletedClass.getURI() + " class " + ((count > 1) ? "were" : "was") + " removed.");
logger.log("Removed " + count + " instance" + ((count > 1) ? "s" : "") + " of the " + deletedClass.getURI() + " class"); logger.log("Removed " + count + " instance" + ((count > 1) ? "s" : "") + " of the " + deletedClass.getURI() + " class");
} }
@ -422,7 +417,6 @@ public class ABoxUpdater {
//log summary of changes //log summary of changes
if (count > 0) { if (count > 0) {
//logger.log(count + " object reference" + ((count > 1) ? "s" : "") + " of the " + deletedClass.getURI() + " class " + ((count > 1) ? "were" : "was") + " removed.");
logger.log("Removed " + count + " object reference" + ((count > 1) ? "s" : "") + " to the " + deletedClass.getURI() + " class"); logger.log("Removed " + count + " object reference" + ((count > 1) ? "s" : "") + " to the " + deletedClass.getURI() + " class");
} }
@ -491,14 +485,6 @@ public class ABoxUpdater {
record.recordAdditions(additions); record.recordAdditions(additions);
if (additions.size() > 0) { if (additions.size() > 0) {
/*
logger.log(additions.size() + " statement" +
((additions.size() > 1) ? "s" : "") +
" with predicate " + addedProperty.getURI() + " " +
((additions.size() > 1) ? "were" : "was")
+ " added (as an inverse to existing " + inverseOfAddedProperty.getURI() +
" assertions)");
*/
logger.log("Added " + additions.size() + " statement" + logger.log("Added " + additions.size() + " statement" +
((additions.size() > 1) ? "s" : "") + ((additions.size() > 1) ? "s" : "") +
" with predicate " + addedProperty.getURI() + " with predicate " + addedProperty.getURI() +
@ -512,21 +498,6 @@ public class ABoxUpdater {
} }
/* OntProperty superProperty = addedProperty.getSuperProperty();
if (superProperty == null) {
return;
}
int count = aboxModel.listStatements(
(Resource) null, superProperty, (RDFNode) null).toSet().size();
if (count > 0) {
logger.log("The Property " + superProperty.getURI() +
" which occurs " + count + " time " + ((count > 1) ? "s" : "") + " in the database has " +
"a new subproperty " + propObj.getDestinationURI() +
" in the new ontology version. ");
logger.log("Please review uses of this property to see if " + propObj.getDestinationURI() + " is a more appropriate choice.");
}
*/
} }
private void deleteProperty(AtomicOntologyChange propObj) throws IOException{ private void deleteProperty(AtomicOntologyChange propObj) throws IOException{
@ -577,8 +548,6 @@ public class ABoxUpdater {
record.recordRetractions(deletePropModel); record.recordRetractions(deletePropModel);
boolean plural = (deletePropModel.size() > 1); boolean plural = (deletePropModel.size() > 1);
if (deletePropModel.size() > 0) { if (deletePropModel.size() > 0) {
//logger.log(deletePropModel.size() + " statement" + (plural ? "s" : "") + " with predicate " +
// propObj.getSourceURI() + " " + (plural ? "were" : "was") + " removed. ");
logger.log("Removed " + deletePropModel.size() + " statement" + (plural ? "s" : "") + " with predicate " + logger.log("Removed " + deletePropModel.size() + " statement" + (plural ? "s" : "") + " with predicate " +
propObj.getSourceURI()); propObj.getSourceURI());
} }
@ -630,14 +599,6 @@ public class ABoxUpdater {
record.recordRetractions(renamePropRetractModel); record.recordRetractions(renamePropRetractModel);
if (renamePropRetractModel.size() > 0) { if (renamePropRetractModel.size() > 0) {
/*
logger.log(renamePropRetractModel.size() + " statement" +
((renamePropRetractModel.size() > 1) ? "s" : "") +
" with predicate " + propObj.getSourceURI() + " " +
((renamePropRetractModel.size() > 1) ? "were" : "was")
+ " changed to use " +
propObj.getDestinationURI() + " instead.");
*/
logger.log("Changed " + renamePropRetractModel.size() + " statement" + logger.log("Changed " + renamePropRetractModel.size() + " statement" +
((renamePropRetractModel.size() > 1) ? "s" : "") + ((renamePropRetractModel.size() > 1) ? "s" : "") +
" with predicate " + propObj.getSourceURI() + " to use " + " with predicate " + propObj.getSourceURI() + " to use " +