migration: fixing log message and commenting out obsolete display model migration code.

This commit is contained in:
stellamit 2011-10-27 21:26:41 +00:00
parent 9dcdd35e0d
commit a82f6e65e6
2 changed files with 6 additions and 10 deletions

View file

@ -373,7 +373,7 @@ public class ABoxUpdater {
//log summary of changes //log summary of changes
if (count > 0) { if (count > 0) {
logger.log("Removed " + count + " individual" + ((count > 1) ? "s" : "" + " of type " + deletedClass.getURI()) + " (refs = " + refCount + ")"); logger.log("Removed " + count + " individual" + (((count > 1) ? "s" : "") + " of type " + deletedClass.getURI()) + " (refs = " + refCount + ")");
} }
aboxModel.remove(retractions); aboxModel.remove(retractions);

View file

@ -7,10 +7,7 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextEvent;
@ -29,10 +26,7 @@ import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement; import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator; import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.shared.Lock; import com.hp.hpl.jena.shared.Lock;
import com.hp.hpl.jena.util.ResourceUtils;
import com.hp.hpl.jena.vocabulary.RDF;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
import edu.cornell.mannlib.vitro.webapp.dao.jena.ModelContext; import edu.cornell.mannlib.vitro.webapp.dao.jena.ModelContext;
import edu.cornell.mannlib.vitro.webapp.dao.jena.OntModelSelector; import edu.cornell.mannlib.vitro.webapp.dao.jena.OntModelSelector;
@ -116,9 +110,9 @@ public class UpdateKnowledgeBase implements ServletContextListener {
ctx.setAttribute(KBM_REQURIED_AT_STARTUP, Boolean.TRUE); ctx.setAttribute(KBM_REQURIED_AT_STARTUP, Boolean.TRUE);
//doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms); //doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms);
//reloadDisplayModel(ctx); //reloadDisplayModel(ctx);
log.info("Migrating display model"); log.info("Display model has not been migrated");
doMigrateDisplayModel(ctx); //doMigrateDisplayModel(ctx);
log.info("Display model migrated"); //log.info("Display model migrated");
ontologyUpdater.update(); ontologyUpdater.update();
} }
} catch (IOException ioe) { } catch (IOException ioe) {
@ -217,6 +211,7 @@ public class UpdateKnowledgeBase implements ServletContextListener {
} }
public static void migrateDisplayModel(Model displayModel) { public static void migrateDisplayModel(Model displayModel) {
/*
Resource indexRes = displayModel.getResource( Resource indexRes = displayModel.getResource(
DisplayVocabulary.DISPLAY_NS + "PrimaryLuceneIndex"); DisplayVocabulary.DISPLAY_NS + "PrimaryLuceneIndex");
ResourceUtils.renameResource( ResourceUtils.renameResource(
@ -268,6 +263,7 @@ public class UpdateKnowledgeBase implements ServletContextListener {
} }
} }
} }
*/
} }
private OntModel loadModelFromDirectory(String directoryPath) { private OntModel loadModelFromDirectory(String directoryPath) {