From c149bc77d63d81e80636b7c4acb7eaf91a3add2e Mon Sep 17 00:00:00 2001 From: bjl23 Date: Mon, 22 Nov 2010 19:46:38 +0000 Subject: [PATCH] merging SDB import/export changes to trunk with backward compatibility code --- .../vitro/webapp/controller/VitroRequest.java | 8 ++ .../controller/jena/JenaExportController.java | 70 +++++++------- .../controller/jena/RDFUploadController.java | 41 +++++--- .../vitro/webapp/dao/jena/JenaModelUtils.java | 93 ++++++++++++++----- .../webapp/filters/VitroRequestPrep.java | 14 +++ .../filters/WebappDaoFactorySDBPrep.java | 38 ++++---- .../servlet/setup/JenaDataSourceSetup.java | 2 + .../setup/JenaDataSourceSetupBase.java | 10 +- 8 files changed, 183 insertions(+), 93 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/VitroRequest.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/VitroRequest.java index 7c0f508fc..aa90a482b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/VitroRequest.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/VitroRequest.java @@ -131,6 +131,14 @@ public class VitroRequest implements HttpServletRequest { } return jenaOntModel; } + + public OntModel getInferenceOntModel() { + OntModel jenaOntModel = (OntModel)_req.getSession().getAttribute( JenaBaseDao.INFERENCE_ONT_MODEL_ATTRIBUTE_NAME ); + if ( jenaOntModel == null ) { + jenaOntModel = (OntModel)_req.getSession().getServletContext().getAttribute( JenaBaseDao.INFERENCE_ONT_MODEL_ATTRIBUTE_NAME ); + } + return jenaOntModel; + } public Portal getPortal(){ return(Portal) getAttribute("portalBean"); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaExportController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaExportController.java index 25bb0353c..5a875f8c5 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaExportController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/JenaExportController.java @@ -14,13 +14,20 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.ontology.OntModelSpec; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.QueryExecutionFactory; +import com.hp.hpl.jena.query.QueryFactory; import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.shared.Lock; +import com.hp.hpl.jena.vocabulary.RDFS; import edu.cornell.mannlib.vedit.controller.BaseEditController; import edu.cornell.mannlib.vitro.webapp.controller.Controllers; import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.jena.JenaModelUtils; public class JenaExportController extends BaseEditController { @@ -75,6 +82,7 @@ public class JenaExportController extends BaseEditController { } private void outputRDF( VitroRequest vreq, HttpServletResponse response ) { + Dataset dataset = vreq.getDataset(); JenaModelUtils xutil = new JenaModelUtils(); String formatParam = vreq.getParameter("format"); String subgraphParam = vreq.getParameter("subgraph"); @@ -94,43 +102,33 @@ public class JenaExportController extends BaseEditController { for(int i =0; i < uri.length-1;i++) ontologyURI = ontologyURI + uri[i]; } - if ( "inferred".equals(assertedOrInferredParam) ) { - limitToInferred = true; - inferenceModel = getOntModelFromAttribute( INFERENCES_ONT_MODEL_ATTR, vreq ); - model = inferenceModel; - } else if ( "full".equals(assertedOrInferredParam) ) { - model = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq ); - } else { // default - model = getOntModelFromAttribute( ASSERTIONS_ONT_MODEL_ATTR, vreq ); - } - if ( "abox".equals(subgraphParam) ) { - if (limitToInferred) { - Model fullModel = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq ); - model = xutil.extractABox( fullModel ); - try { - inferenceModel.enterCriticalSection(Lock.READ); - model = model.intersection(inferenceModel); - } finally { - inferenceModel.leaveCriticalSection(); - } - } else { - model = xutil.extractABox( model ); + + if( "abox".equals(subgraphParam)){ + model = ModelFactory.createDefaultModel(); + if("inferred".equals(assertedOrInferredParam)){ + model = xutil.extractABox(dataset, INFERENCE_GRAPH); } - } else if ( "tbox".equals(subgraphParam) ) { - if (limitToInferred) { - Model fullModel = getOntModelFromAttribute( FULL_ONT_MODEL_ATTR, vreq ); - model = xutil.extractTBox( fullModel, ontologyURI ); - try { - inferenceModel.enterCriticalSection(Lock.READ); - model = model.intersection(inferenceModel); - } finally { - inferenceModel.leaveCriticalSection(); - } - } else { - model = xutil.extractTBox( model, ontologyURI ); + else if("full".equals(assertedOrInferredParam)){ + model = xutil.extractABox(dataset, FULL_GRAPH); } - } + else{ + model = xutil.extractABox(dataset, ASSERTIONS_GRAPH); + } + + } + else if("tbox".equals(subgraphParam)){ + if("inferred".equals(assertedOrInferredParam)){ + model = xutil.extractTBox(dataset, ontologyURI,INFERENCE_GRAPH); + } + else if("full".equals(assertedOrInferredParam)){ + model = xutil.extractTBox(dataset, ontologyURI, FULL_GRAPH); + } + else{ + model = xutil.extractTBox(dataset, ontologyURI, ASSERTIONS_GRAPH); + } + + } if ( formatParam == null ) { formatParam = "RDF/XML-ABBREV"; // default @@ -178,6 +176,7 @@ public class JenaExportController extends BaseEditController { } private OntModel getOntModelFromAttribute( String attributeName, VitroRequest vreq ) { + Object o = vreq.getAttribute( attributeName ); if ( (o != null) && (o instanceof OntModel) ) { return (OntModel) o; @@ -194,6 +193,9 @@ public class JenaExportController extends BaseEditController { static final String FULL_ONT_MODEL_ATTR = "jenaOntModel"; static final String ASSERTIONS_ONT_MODEL_ATTR = "baseOntModel"; static final String INFERENCES_ONT_MODEL_ATTR = "inferenceOntModel"; + static final String FULL_GRAPH = "?g"; + static final String ASSERTIONS_GRAPH = ""; + static final String INFERENCE_GRAPH = ""; static Map formatToExtension; static Map formatToMimetype; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java index 7ed6abf9d..e19f398ba 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/jena/RDFUploadController.java @@ -152,23 +152,42 @@ public class RDFUploadController extends BaseEditController { } } /* ********** Do the model changes *********** */ - long stmtCount = 0L; + long tboxstmtCount = 0L; + long aboxstmtCount = 0L; if( tempModel != null ){ - OntModel memModel=null; + JenaModelUtils xutil = new JenaModelUtils(); + OntModel tboxModel=null; + OntModel aboxModel=null; + OntModel tboxChangeModel=null; + Model aboxChangeModel=null; + try { - memModel = ((OntModelSelector) request.getSession() - .getAttribute("unionOntModelSelector")).getABoxModel(); + tboxModel = ((OntModelSelector) request.getSession() + .getAttribute("baseOntModelSelector")).getTBoxModel(); + aboxModel = ((OntModelSelector) request.getSession() + .getAttribute("baseOntModelSelector")).getABoxModel(); + } catch (Exception e) {} - if (memModel==null) { - memModel = ((OntModelSelector) getServletContext() - .getAttribute("unionOntModelSelector")).getABoxModel(); + if (tboxModel==null) { + tboxModel = ((OntModelSelector) getServletContext() + .getAttribute("baseOntModelSelector")).getTBoxModel(); } - if (memModel != null) { - stmtCount = operateOnModel(request.getFullWebappDaoFactory(), memModel,tempModel,remove,makeClassgroups,portalArray,loginBean.getUserURI()); - } + if (aboxModel==null) { + aboxModel = ((OntModelSelector) getServletContext() + .getAttribute("baseOntModelSelector")).getABoxModel(); + } + if (tboxModel != null) { + tboxChangeModel = xutil.extractTBox(tempModel); + tboxstmtCount = operateOnModel(request.getFullWebappDaoFactory(), tboxModel,tboxChangeModel,remove,makeClassgroups,portalArray,loginBean.getUserURI()); + } + if (aboxModel != null) { + aboxChangeModel = tempModel.remove(tboxChangeModel); + aboxstmtCount = operateOnModel(request.getFullWebappDaoFactory(), aboxModel,aboxChangeModel,remove,makeClassgroups,portalArray,loginBean.getUserURI()); + } + } - request.setAttribute("uploadDesc", uploadDesc + ". " + verb + " " + stmtCount + " statements."); + request.setAttribute("uploadDesc", uploadDesc + ". " + verb + " " + (tboxstmtCount + aboxstmtCount) + " statements."); RequestDispatcher rd = request.getRequestDispatcher(Controllers.BASIC_JSP); request.setAttribute("bodyJsp","/templates/edit/specific/upload_rdf_result.jsp"); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/JenaModelUtils.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/JenaModelUtils.java index 7f666fd3d..a12ebd871 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/JenaModelUtils.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/JenaModelUtils.java @@ -16,6 +16,8 @@ import com.hp.hpl.jena.ontology.Individual; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntModelSpec; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.DatasetFactory; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; @@ -145,38 +147,40 @@ public class JenaModelUtils { private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM; - public OntModel extractTBox( Model inputModel ) { - return extractTBox( inputModel, null ); + public OntModel extractTBox( Model inputModel) { + Dataset dataset = DatasetFactory.create(inputModel); + return extractTBox( dataset,null,null ); } - public OntModel extractTBox( Model inputModel, String namespace ) { - + public OntModel extractTBox( Dataset dataset, String namespace, String graphURI ) { + System.out.println(namespace); + System.out.println(graphURI); OntModel tboxModel = ModelFactory.createOntologyModel(DEFAULT_ONT_MODEL_SPEC); List queryStrList = new LinkedList(); // Use SPARQL DESCRIBE queries to extract the RDF for named ontology entities - queryStrList.add( makeDescribeQueryStr( OWL.Class.getURI(), namespace ) ); - queryStrList.add( makeDescribeQueryStr( OWL.ObjectProperty.getURI(), namespace ) ); - queryStrList.add( makeDescribeQueryStr( OWL.DatatypeProperty.getURI(), namespace ) ); + queryStrList.add( makeDescribeQueryStr( OWL.Class.getURI(), namespace, graphURI ) ); + queryStrList.add( makeDescribeQueryStr( OWL.ObjectProperty.getURI(), namespace, graphURI ) ); + queryStrList.add( makeDescribeQueryStr( OWL.DatatypeProperty.getURI(), namespace, graphURI ) ); // if we're using to a hash namespace, the URI of the Ontology resource will be // that namespace minus the final hash mark. if ( namespace != null && namespace.endsWith("#") ) { - queryStrList.add( makeDescribeQueryStr( OWL.Ontology.getURI(), namespace.substring(0,namespace.length()-2) ) ); + queryStrList.add( makeDescribeQueryStr( OWL.Ontology.getURI(), namespace.substring(0,namespace.length()-2), graphURI ) ); } else { - queryStrList.add( makeDescribeQueryStr( OWL.Ontology.getURI(), namespace ) ); + queryStrList.add( makeDescribeQueryStr( OWL.Ontology.getURI(), namespace, graphURI ) ); } // Perform the SPARQL DESCRIBEs for ( String queryStr : queryStrList ) { Query tboxSparqlQuery = QueryFactory.create(queryStr); - QueryExecution qe = QueryExecutionFactory.create(tboxSparqlQuery,inputModel); + QueryExecution qe = QueryExecutionFactory.create(tboxSparqlQuery,dataset); try { - inputModel.enterCriticalSection(Lock.READ); + dataset.getLock().enterCriticalSection(Lock.READ); qe.execDescribe(tboxModel); } finally { - inputModel.leaveCriticalSection(); + dataset.getLock().leaveCriticalSection(); } } @@ -185,12 +189,23 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM; } private String makeDescribeQueryStr( String typeURI, String namespace ) { + return makeDescribeQueryStr( typeURI, namespace, null ); + } + + private String makeDescribeQueryStr( String typeURI, String namespace, String graphURI ) { StringBuffer describeQueryStrBuff = new StringBuffer() .append("PREFIX rdf: \n") .append("PREFIX afn: \n") - .append("DESCRIBE ?res WHERE { \n") - .append(" ?res rdf:type <").append(typeURI).append("> . \n") + .append("DESCRIBE ?res WHERE { \n"); + if (graphURI != null) { + describeQueryStrBuff + .append("GRAPH " + graphURI + "{ \n"); + } + describeQueryStrBuff + .append(" ?res rdf:type <").append(typeURI).append("> . \n"); + + describeQueryStrBuff .append(" FILTER (!isBlank(?res)) \n"); if (namespace == null) { @@ -216,6 +231,10 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM; .append(namespace) .append("\") \n"); } + if (graphURI != null) { + describeQueryStrBuff + .append("} \n"); + } describeQueryStrBuff.append("} \n"); @@ -223,36 +242,62 @@ private final OntModelSpec DEFAULT_ONT_MODEL_SPEC = OntModelSpec.OWL_MEM; } - public Model extractABox( Model inputModel ) { + public Model extractABox(Model inputModel){ + Dataset dataset = DatasetFactory.create(inputModel); + return extractABox(dataset, null); + } + + public Model extractABox( Dataset dataset, String graphURI ) { Model aboxModel = ModelFactory.createDefaultModel(); - + // iterate through all classes and DESCRIBE each of their instances // Note that this could be simplified if we knew that the model was a // reasoning model: we could then simply describe all instances of // owl:Thing. + + //OntModel ontModel = ( inputModel instanceof OntModel ) + //? (OntModel)inputModel + //: ModelFactory.createOntologyModel( DEFAULT_ONT_MODEL_SPEC, inputModel ); + OntModel ontModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM); + Model model = ModelFactory.createDefaultModel(); + String getStatements = + "CONSTRUCT " + + "{ ?p ?o ?a \n" + + "} WHERE {" + + "GRAPH ?g { \n" + + "{ ?p ?o ?a } \n" + + "} \n" + + "}"; + try{ + dataset.getLock().enterCriticalSection(Lock.READ); + model = QueryExecutionFactory.create(QueryFactory.create(getStatements), dataset).execConstruct(); + } + finally{ + dataset.getLock().leaveCriticalSection(); + } + ontModel.add(model.listStatements()); - OntModel ontModel = ( inputModel instanceof OntModel ) - ? (OntModel)inputModel - : ModelFactory.createOntologyModel( DEFAULT_ONT_MODEL_SPEC, inputModel ); try { ontModel.enterCriticalSection(Lock.READ); Iterator classIt = ontModel.listNamedClasses(); + while ( classIt.hasNext() ) { + OntClass ontClass = (OntClass) classIt.next(); if ( !(ontClass.getNameSpace().startsWith(OWL.getURI()) ) && !(ontClass.getNameSpace().startsWith(VitroVocabulary.vitroURI)) ) { - String queryStr = makeDescribeQueryStr( ontClass.getURI(), null ); + String queryStr = makeDescribeQueryStr( ontClass.getURI(), null, graphURI ); Query aboxSparqlQuery = QueryFactory.create(queryStr); - QueryExecution qe = QueryExecutionFactory.create(aboxSparqlQuery,inputModel); + QueryExecution qe = QueryExecutionFactory.create(aboxSparqlQuery,dataset); try { - inputModel.enterCriticalSection(Lock.READ); - qe.execDescribe(aboxModel); + dataset.getLock().enterCriticalSection(Lock.READ); + qe.execDescribe(aboxModel); // puts the statements about each resource into aboxModel. } finally { - inputModel.leaveCriticalSection(); + dataset.getLock().leaveCriticalSection(); } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/VitroRequestPrep.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/VitroRequestPrep.java index e8ec1b1e9..8787e04ee 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/VitroRequestPrep.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/VitroRequestPrep.java @@ -20,6 +20,10 @@ import javax.servlet.http.HttpSession; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.DatasetFactory; + import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle; import edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory; import edu.cornell.mannlib.vitro.webapp.auth.identifier.SelfEditingIdentifierFactory.SelfEditing; @@ -40,6 +44,7 @@ import edu.cornell.mannlib.vitro.webapp.flags.FlagException; import edu.cornell.mannlib.vitro.webapp.flags.PortalFlag; import edu.cornell.mannlib.vitro.webapp.flags.RequestToAuthFlag; import edu.cornell.mannlib.vitro.webapp.flags.SunsetFlag; +import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase; /** * This sets up several objects in the Request scope for each @@ -195,6 +200,15 @@ public class VitroRequestPrep implements Filter { if( log.isDebugEnabled() ) log.debug("setting role-based WebappDaoFactory filter for role " + role.toString()); vreq.setWebappDaoFactory(wdf); + + // support for Dataset interface if using Jena in-memory model + if (vreq.getDataset() == null) { + DataSource dataset = DatasetFactory.create(); + dataset.addNamedModel(JenaDataSourceSetupBase.JENA_DB_MODEL, vreq.getAssertionsOntModel()); + dataset.addNamedModel(JenaDataSourceSetupBase.JENA_INF_MODEL, vreq.getInferenceOntModel()); + vreq.setDataset(dataset); + } + request.setAttribute("VitroRequestPrep.setup", new Integer(1)); chain.doFilter(request, response); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/WebappDaoFactorySDBPrep.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/WebappDaoFactorySDBPrep.java index 53b7d21bb..3377b5f17 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/WebappDaoFactorySDBPrep.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/filters/WebappDaoFactorySDBPrep.java @@ -80,27 +80,27 @@ public class WebappDaoFactorySDBPrep implements Filter { SDBConnection conn = null; try { - if ( - request instanceof HttpServletRequest && - _bds != null && _storeDesc != null && _oms != null) { - try { - conn = new SDBConnection(_bds.getConnection()) ; - } catch (SQLException sqe) { - throw new RuntimeException("Unable to connect to database", sqe); + if ( + request instanceof HttpServletRequest && + _bds != null && _storeDesc != null && _oms != null) { + try { + conn = new SDBConnection(_bds.getConnection()) ; + } catch (SQLException sqe) { + throw new RuntimeException("Unable to connect to database", sqe); + } + if (conn != null) { + Store store = SDBFactory.connectStore(conn, _storeDesc); + Dataset dataset = SDBFactory.connectDataset(store); + VitroRequest vreq = new VitroRequest((HttpServletRequest) request); + WebappDaoFactory wadf = + new WebappDaoFactorySDB(_oms, dataset, _defaultNamespace, null, null); + vreq.setWebappDaoFactory(wadf); + vreq.setFullWebappDaoFactory(wadf); + vreq.setDataset(dataset); + } } - if (conn != null) { - Store store = SDBFactory.connectStore(conn, _storeDesc); - Dataset dataset = SDBFactory.connectDataset(store); - VitroRequest vreq = new VitroRequest((HttpServletRequest) request); - WebappDaoFactory wadf = - new WebappDaoFactorySDB(_oms, dataset, _defaultNamespace, null, null); - vreq.setWebappDaoFactory(wadf); - vreq.setFullWebappDaoFactory(wadf); - vreq.setDataset(dataset); - } - } } catch (Throwable t) { - t.printStackTrace(); + log.error("Unable to filter request to set up SDB connection", t); } request.setAttribute("WebappDaoFactorySDBPrep.setup", 1); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetup.java index 216249a08..fd6c6f19e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetup.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetup.java @@ -76,10 +76,12 @@ public class JenaDataSourceSetup extends JenaDataSourceSetupBase implements java sce.getServletContext().setAttribute("baseOntModel", memModel); WebappDaoFactory baseWadf = new WebappDaoFactoryJena(baseOms, defaultNamespace, null, null); sce.getServletContext().setAttribute("assertionsWebappDaoFactory",baseWadf); + sce.getServletContext().setAttribute("baseOntModelSelector", baseOms); sce.getServletContext().setAttribute("inferenceOntModel", inferenceModel); WebappDaoFactory infWadf = new WebappDaoFactoryJena(inferenceOms, defaultNamespace, null, null); sce.getServletContext().setAttribute("deductionsWebappDaoFactory", infWadf); + sce.getServletContext().setAttribute("inferenceOntModelSelector", inferenceOms); sce.getServletContext().setAttribute("jenaOntModel", unionModel); WebappDaoFactory wadf = new WebappDaoFactoryJena(unionOms, defaultNamespace, null, null); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupBase.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupBase.java index 68e679c5b..fb7c9c5e1 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupBase.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/JenaDataSourceSetupBase.java @@ -56,12 +56,12 @@ public class JenaDataSourceSetupBase extends JenaBaseDaoCon { // (queries and updates) with the ABox data from the DB - this model is not maintained // in memory. For query performance reasons, there won't be any submodels for the ABox data. - static final String JENA_DB_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-2"; + public static final String JENA_DB_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-2"; // ABox inferences. This is ABox data that is inferred, using VIVO's native simple, specific- // purpose reasoning based on the combination of the Abox (assertion and inferences) data // and the TBox (assertions and inferences) data. - static final String JENA_INF_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf"; + public static final String JENA_INF_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-inf"; // TBox assertions. // Some of these (the local extensions) are stored and maintained in a Jena database and @@ -69,17 +69,17 @@ public class JenaDataSourceSetupBase extends JenaBaseDaoCon { // Other parts of the TBox, the 'VIVO Core', are also backed by a Jena DB, but they are // read fresh from files each time the application starts. While the application is running, // they are kept in memory, as submodels of the in memory copy of this named graph. - static final String JENA_TBOX_ASSERTIONS_MODEL = "http://vitro.mannlib.cornell.edu/default/asserted-tbox"; + public static final String JENA_TBOX_ASSERTIONS_MODEL = "http://vitro.mannlib.cornell.edu/default/asserted-tbox"; // Inferred TBox. This is TBox data that is inferred from the combination of VIVO core TBox // and any local extension TBox assertions. Pellet computes these inferences. // These are stored in the DB. - static final String JENA_TBOX_INF_MODEL = "http://vitro.mannlib.cornell.edu/default/inferred-tbox"; + public static final String JENA_TBOX_INF_MODEL = "http://vitro.mannlib.cornell.edu/default/inferred-tbox"; static final String JENA_AUDIT_MODEL = "http://vitro.mannlib.cornell.edu/ns/db/experimental/audit"; - static final String JENA_USER_ACCOUNTS_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-userAccounts"; + public static final String JENA_USER_ACCOUNTS_MODEL = "http://vitro.mannlib.cornell.edu/default/vitro-kb-userAccounts"; // This model doesn't exist yet. It's a placeholder for the application ontology.