incremental development for NIHVIVO-1286
This commit is contained in:
parent
46a17a9c46
commit
4c17c65019
2 changed files with 16 additions and 10 deletions
|
@ -421,11 +421,7 @@ public class ABoxUpdater {
|
||||||
Statement newStmt = ResourceFactory.createStatement(stmt.getObject().asResource(), addedProperty, stmt.getSubject());
|
Statement newStmt = ResourceFactory.createStatement(stmt.getObject().asResource(), addedProperty, stmt.getSubject());
|
||||||
additions.add(newStmt);
|
additions.add(newStmt);
|
||||||
} else {
|
} else {
|
||||||
logger.log("WARNING: expected the object of this statement to be a Resource, and it's not. No inverse has been asserted: " +
|
logger.log("WARNING: expected the object of this statement to be a Resource but it is not. No inverse has been asserted: " + stmtString(stmt));
|
||||||
" subject = " + stmt.getSubject().getURI() +
|
|
||||||
" property = " + stmt.getPredicate().getURI() +
|
|
||||||
" object = " + (stmt.getObject().isLiteral() ? ((Literal)stmt.getObject()).getLexicalForm()
|
|
||||||
: ((Resource)stmt.getObject()).getURI()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +434,7 @@ public class ABoxUpdater {
|
||||||
" with predicate " + addedProperty.getURI() + " " +
|
" with predicate " + addedProperty.getURI() + " " +
|
||||||
((additions.size() > 1) ? "were" : "was")
|
((additions.size() > 1) ? "were" : "was")
|
||||||
+ " added (as an inverse to existing " + inverseOfAddedProperty.getURI() +
|
+ " added (as an inverse to existing " + inverseOfAddedProperty.getURI() +
|
||||||
" assertions");
|
" assertions)");
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -114,11 +114,16 @@ public class DateTimeMigration {
|
||||||
record.recordRetractions(retractions);
|
record.recordRetractions(retractions);
|
||||||
aboxModel.add(additions);
|
aboxModel.add(additions);
|
||||||
record.recordAdditions(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 {
|
} finally {
|
||||||
aboxModel.leaveCriticalSection();
|
aboxModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -189,7 +194,12 @@ public class DateTimeMigration {
|
||||||
record.recordRetractions(retractions);
|
record.recordRetractions(retractions);
|
||||||
aboxModel.add(additions);
|
aboxModel.add(additions);
|
||||||
record.recordAdditions(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 {
|
} finally {
|
||||||
aboxModel.leaveCriticalSection();
|
aboxModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
@ -231,8 +241,8 @@ public class DateTimeMigration {
|
||||||
|
|
||||||
public static String stmtString(Statement statement) {
|
public static String stmtString(Statement statement) {
|
||||||
return " subject = " + statement.getSubject().getURI() +
|
return " subject = " + statement.getSubject().getURI() +
|
||||||
" property = " + statement.getPredicate().getURI() +
|
" property = " + statement.getPredicate().getURI() +
|
||||||
" object = " + (statement.getObject().isLiteral() ? ((Literal)statement.getObject()).getLexicalForm() + " (Literal)"
|
" object = " + (statement.getObject().isLiteral() ? ((Literal)statement.getObject()).getLexicalForm() + " (Literal)"
|
||||||
: ((Resource)statement.getObject()).getURI() + " (Resource)");
|
: ((Resource)statement.getObject()).getURI() + " (Resource)");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue