logging improvement
This commit is contained in:
parent
c27938d19b
commit
c88b321c08
2 changed files with 8 additions and 1 deletions
|
@ -282,10 +282,12 @@ public class KnowledgeBaseUpdater {
|
|||
* needs to be updated to conform to a new ontology version
|
||||
*/
|
||||
public boolean updateRequired() throws IOException {
|
||||
|
||||
String sparqlQueryStr = loadSparqlQuery(settings.getAskQueryFile());
|
||||
if (sparqlQueryStr == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Model m = settings.getOntModelSelector().getApplicationMetadataModel();
|
||||
Query query = QueryFactory.create(sparqlQueryStr);
|
||||
QueryExecution qexec = QueryExecutionFactory.create(query, m);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.ontology.update;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hp.hpl.jena.ontology.OntModel;
|
||||
|
@ -340,10 +341,14 @@ public void updateAnnotationModel() throws IOException {
|
|||
Statement stmt = iter.next();
|
||||
|
||||
if (!newTboxAnnotationsModel.contains(stmt) && !usesGroup(siteModel, stmt.getSubject())) {
|
||||
long pre = retractions.size();
|
||||
retractions.add(siteModel.listStatements(stmt.getSubject(),(Property) null,(RDFNode)null));
|
||||
long post = retractions.size();
|
||||
if ((post - pre) > 0) {
|
||||
logger.log("Removed the " + stmt.getSubject().getURI() + " ClassGroup from the annotations model.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (retractions.size() > 0) {
|
||||
siteModel.remove(retractions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue