From 90ac18e9f09e9a95ffa4ce02742a6734da0a6e26 Mon Sep 17 00:00:00 2001 From: bjl23 Date: Wed, 12 Jan 2011 15:09:43 +0000 Subject: [PATCH] improvement to initial SDB setup --- .../servlet/setup/JenaDataSourceSetupSDB.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupSDB.java index c84bb76a3..18da19e20 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupSDB.java @@ -142,16 +142,24 @@ public class JenaDataSourceSetupSDB extends JenaDataSourceSetupBase implements j readOntologyFilesInPathSet(SUBMODELS, sce.getServletContext(), submodels); Model tboxAssertions = SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_TBOX_ASSERTIONS_MODEL); - getTBoxModel(memModel, submodels, tboxAssertions); + // initially putting the results in memory so we have a + // cheaper way of computing the difference when we copy the ABox + Model memTboxAssertions = ModelFactory.createDefaultModel(); + getTBoxModel(memModel, submodels, memTboxAssertions); + tboxAssertions.add(memTboxAssertions); Model tboxInferences = SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_TBOX_INF_MODEL); - getTBoxModel(inferenceModel, submodels, tboxInferences); + // initially putting the results in memory so we have a + // cheaper way of computing the difference when we copy the ABox + Model memTboxInferences = ModelFactory.createDefaultModel(); + getTBoxModel(inferenceModel, submodels, memTboxInferences); + tboxInferences.add(memTboxInferences); Model aboxAssertions = SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_DB_MODEL); - copyDifference(memModel, tboxAssertions, aboxAssertions); + copyDifference(memModel, memTboxAssertions, aboxAssertions); Model aboxInferences = SDBFactory.connectNamedModel(store, JenaDataSourceSetupBase.JENA_INF_MODEL); - copyDifference(inferenceModel, tboxInferences, aboxInferences); + copyDifference(inferenceModel, memTboxInferences, aboxInferences); // The code below, which sets up the OntModelSelectors, controls whether each // model is maintained in memory, in the DB, or both while the application