From 6147a54dc3017bca7ae1d65b1eadb502b4faafa8 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 14 Dec 2011 22:22:57 +0000 Subject: [PATCH] NIHVIVO-3512 added inference rebuild and scratchpad models to assertions-only filter block --- .../vitro/webapp/dao/jena/IndividualSDB.java | 17 ++++++----------- .../webapp/dao/jena/WebappDaoFactorySDB.java | 14 +++++++++++--- .../servlet/setup/SimpleReasonerSetup.java | 4 ++-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java index 14f8fd178..1dbbaa1a2 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/IndividualSDB.java @@ -429,8 +429,7 @@ public class IndividualSDB extends IndividualImpl implements Individual { webappDaoFactory.getObjectPropertyStatementDao() .fillExistingObjectPropertyStatements(this); } catch (Exception e) { - log.error(this.getClass().getName() + - " could not fill existing ObjectPropertyStatements for " + log.error("Could not fill existing ObjectPropertyStatements for " + this.getURI(), e); } return this.objectPropertyStatements; @@ -579,8 +578,7 @@ public class IndividualSDB extends IndividualImpl implements Individual { webappDaoFactory.getObjectPropertyDao() .fillObjectPropertiesForIndividual( this ); } catch (Exception e) { - log.error(this.getClass().getName() + - " could not fillEntityProperties for " + this.getURI()); + log.error("Could not fillEntityProperties for " + this.getURI(), e); } return this.propertyList; } @@ -623,9 +621,8 @@ public class IndividualSDB extends IndividualImpl implements Individual { webappDaoFactory.getDataPropertyStatementDao() .fillExistingDataPropertyStatementsForIndividual(this); } catch (Exception e) { - log.error(this.getClass().getName() + - " could not fill existing DataPropertyStatements for " - + this.getURI()); + log.error("Could not fill existing DataPropertyStatements for " + + this.getURI(), e); } return this.dataPropertyStatements; } @@ -639,8 +636,7 @@ public class IndividualSDB extends IndividualImpl implements Individual { webappDaoFactory.getDataPropertyDao() .fillDataPropertiesForIndividual( this ); } catch (Exception e) { - log.error(this.getClass().getName() + - " could not fill data properties for " + this.getURI()); + log.error("Could not fill data properties for " + this.getURI(), e); } return this.datatypePropertyList; } @@ -686,8 +682,7 @@ public class IndividualSDB extends IndividualImpl implements Individual { .getExternalIds(this.getURI(), null)); this.externalIds = dpsList; } catch (Exception e) { - log.error(this.getClass().getName() + - " could not fill external IDs for " + this.getURI()); + log.error("Could not fill external IDs for " + this.getURI(), e); } return this.externalIds; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactorySDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactorySDB.java index 14212f7ce..d79bb4af1 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactorySDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactorySDB.java @@ -21,6 +21,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VClassDao; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryConfig; import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase; +import edu.cornell.mannlib.vitro.webapp.servlet.setup.SimpleReasonerSetup; public class WebappDaoFactorySDB extends WebappDaoFactoryJena { @@ -138,10 +139,17 @@ public class WebappDaoFactorySDB extends WebappDaoFactoryJena { .append(graphVars[i]) .append(" != <") .append(JenaDataSourceSetupBase.JENA_INF_MODEL) - .append("> && ").append(graphVars[i]) - .append(" != <") + .append("> ") + .append("&& ").append(graphVars[i]).append(" != <") .append(JenaDataSourceSetupBase.JENA_TBOX_INF_MODEL) - .append(">) ) \n"); + .append(">") + .append("&& ").append(graphVars[i]).append(" != <") + .append(SimpleReasonerSetup.JENA_INF_MODEL_REBUILD) + .append(">") + .append("&& ").append(graphVars[i]).append(" != <") + .append(SimpleReasonerSetup.JENA_INF_MODEL_SCRATCHPAD) + .append(">") + .append(") ) \n"); break; case INFERENCES_ONLY : filterBlock.append("FILTER (") diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/SimpleReasonerSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/SimpleReasonerSetup.java index fb0a61b30..7352002e4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/SimpleReasonerSetup.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/SimpleReasonerSetup.java @@ -40,8 +40,8 @@ public class SimpleReasonerSetup implements ServletContextListener { public static final String FILE_OF_PLUGINS = "/WEB-INF/resources/reasoner_plugins.txt"; // Models used during a full recompute of the ABox - static final String JENA_INF_MODEL_REBUILD = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf-rebuild"; - static final String JENA_INF_MODEL_SCRATCHPAD = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf-scratchpad"; + public static final String JENA_INF_MODEL_REBUILD = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf-rebuild"; + public static final String JENA_INF_MODEL_SCRATCHPAD = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf-scratchpad"; @Override public void contextInitialized(ServletContextEvent sce) {