diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java index 6bb4e1572..82f90146f 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyDaoJena.java @@ -64,11 +64,10 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements protected static final String dataPropertyQueryString = PREFIXES + "\n" + "SELECT DISTINCT ?property WHERE { \n" + - //" GRAPH ?g {\n" + - " ?subject ?property ?object . \n" + - " ?property rdf:type owl:DatatypeProperty . \n" + + " GRAPH ?g { ?subject ?property ?object } \n" + + " GRAPH ?h { ?property rdf:type owl:DatatypeProperty } \n" + propertyFilters + - //" }\n" + + " }\n" + "}"; static protected Query dataPropertyQuery; @@ -93,8 +92,9 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements } } - public DataPropertyDaoJena(WebappDaoFactoryJena wadf) { - super(wadf); + public DataPropertyDaoJena(DatasetWrapperFactory dwf, + WebappDaoFactoryJena wadf) { + super(dwf, wadf); } public void deleteDataProperty(DataProperty dtp) { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoJena.java index 5d2aa5d02..6f5c1f091 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoJena.java @@ -10,6 +10,7 @@ import com.hp.hpl.jena.datatypes.TypeMapper; import com.hp.hpl.jena.ontology.DatatypeProperty; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntResource; +import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; @@ -39,11 +40,13 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.event.IndividualUpdateEvent; public class DataPropertyStatementDaoJena extends JenaBaseDao implements DataPropertyStatementDao { + private DatasetWrapperFactory dwf; + protected static final String dataPropertyValueQueryString = "SELECT ?value WHERE { \n" + - //" GRAPH ?g {\n" + + " GRAPH ?g {\n" + " ?subject ?property ?value . \n" + - //" }\n" + + " }\n" + "}"; static protected Query dataPropertyValueQuery; @@ -56,8 +59,10 @@ public class DataPropertyStatementDaoJena extends JenaBaseDao implements DataPro } } - public DataPropertyStatementDaoJena(WebappDaoFactoryJena wadf) { + public DataPropertyStatementDaoJena(DatasetWrapperFactory dwf, + WebappDaoFactoryJena wadf) { super(wadf); + this.dwf = dwf; } public void deleteDataPropertyStatement(DataPropertyStatement dataPropertyStmt) { @@ -295,16 +300,27 @@ public class DataPropertyStatementDaoJena extends JenaBaseDao implements DataPro bindings.add("subject", ResourceFactory.createResource(subjectUri)); bindings.add("property", ResourceFactory.createResource(propertyUri)); - // Run the SPARQL query to get the properties - QueryExecution qexec = QueryExecutionFactory.create(dataPropertyValueQuery, getOntModelSelector().getFullModel(), bindings); - ResultSet results = qexec.execSelect(); - - List statements = new ArrayList(); - while (results.hasNext()) { - QuerySolution sol = results.next(); - Literal value = sol.getLiteral("value"); - DataPropertyStatement dps = new DataPropertyStatementImpl(subjectUri, propertyUri, value.getLexicalForm()); - statements.add(dps); + // Run the SPARQL query to get the properties + List statements = + new ArrayList(); + DatasetWrapper w = dwf.getDatasetWrapper(); + Dataset dataset = w.getDataset(); + dataset.getLock().enterCriticalSection(Lock.READ); + try { + QueryExecution qexec = QueryExecutionFactory.create( + dataPropertyValueQuery, dataset, bindings); + ResultSet results = qexec.execSelect(); + + while (results.hasNext()) { + QuerySolution sol = results.next(); + Literal value = sol.getLiteral("value"); + DataPropertyStatement dps = new DataPropertyStatementImpl( + subjectUri, propertyUri, value.getLexicalForm()); + statements.add(dps); + } + } finally { + dataset.getLock().leaveCriticalSection(); + w.close(); } return statements; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoSDB.java index 19b3d633b..6ad4a59c3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/DataPropertyStatementDaoSDB.java @@ -38,7 +38,7 @@ public class DataPropertyStatementDaoSDB extends DataPropertyStatementDaoJena private DatasetWrapperFactory dwf; public DataPropertyStatementDaoSDB(DatasetWrapperFactory datasetWrapperFactory, WebappDaoFactoryJena wadf) { - super (wadf); + super (datasetWrapperFactory, wadf); this.dwf = datasetWrapperFactory; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java index 54cd5aa55..cb2a55a32 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyDaoJena.java @@ -55,11 +55,10 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp protected static final String objectPropertyQueryString = PREFIXES + "\n" + "SELECT DISTINCT ?property WHERE { \n" + - //" GRAPH ?g {\n" + - " ?subject ?property ?object . \n" + - " ?property rdf:type owl:ObjectProperty . \n" + + " GRAPH ?g { ?subject ?property ?object } \n" + + " GRAPH ?h { ?property rdf:type owl:ObjectProperty } \n" + propertyFilters + - //" }\n" + + " }\n" + "}"; static protected Query objectPropertyQuery; @@ -90,8 +89,9 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp Map customListViewConfigFileMap = null; - public ObjectPropertyDaoJena(WebappDaoFactoryJena wadf) { - super(wadf); + public ObjectPropertyDaoJena(DatasetWrapperFactory dwf, + WebappDaoFactoryJena wadf) { + super(dwf, wadf); } @Override diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java index 23f6ec7bb..0a7b7251c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoJena.java @@ -11,6 +11,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; @@ -38,8 +39,12 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec protected static final Log log = LogFactory.getLog(ObjectPropertyStatementDaoJena.class); - public ObjectPropertyStatementDaoJena(WebappDaoFactoryJena wadf) { + private DatasetWrapperFactory dwf; + + public ObjectPropertyStatementDaoJena(DatasetWrapperFactory dwf, + WebappDaoFactoryJena wadf) { super(wadf); + this.dwf = dwf; } @Override @@ -72,7 +77,7 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec else { Map uriToObjectProperty = new HashMap(); - ObjectPropertyDaoJena opDaoJena = new ObjectPropertyDaoJena(getWebappDaoFactory()); + ObjectPropertyDaoJena opDaoJena = new ObjectPropertyDaoJena(dwf, getWebappDaoFactory()); OntModel ontModel = getOntModelSelector().getABoxModel(); ontModel.enterCriticalSection(Lock.READ); @@ -265,14 +270,25 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec bindings.add("subject", ResourceFactory.createResource(subjectUri)); bindings.add("property", ResourceFactory.createResource(propertyUri)); - // Run the SPARQL query to get the properties - QueryExecution qexec = QueryExecutionFactory.create(query, getOntModelSelector().getFullModel(), bindings); - ResultSet results = qexec.execSelect(); + // Run the SPARQL query to get the properties List> list = new ArrayList>(); - - while (results.hasNext()) { - QuerySolution soln = results.nextSolution(); - list.add(QueryUtils.querySolutionToStringValueMap(soln)); + DatasetWrapper w = dwf.getDatasetWrapper(); + Dataset dataset = w.getDataset(); + dataset.getLock().enterCriticalSection(Lock.READ); + try { + + QueryExecution qexec = QueryExecutionFactory.create( + query, dataset, bindings); + ResultSet results = qexec.execSelect(); + + while (results.hasNext()) { + QuerySolution soln = results.nextSolution(); + list.add(QueryUtils.querySolutionToStringValueMap(soln)); + } + + } finally { + dataset.getLock().leaveCriticalSection(); + w.close(); } return list; } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoSDB.java index cfaa11f6b..a31cb4533 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoSDB.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/ObjectPropertyStatementDaoSDB.java @@ -34,10 +34,10 @@ public class ObjectPropertyStatementDaoSDB extends private DatasetWrapperFactory dwf; public ObjectPropertyStatementDaoSDB( - DatasetWrapperFactory datasetWrapperFactory, + DatasetWrapperFactory dwf, WebappDaoFactoryJena wadf) { - super (wadf); - this.dwf = datasetWrapperFactory; + super (dwf, wadf); + this.dwf = dwf; } @Override diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java index 1dfb1e40a..6e86460d3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/PropertyDaoJena.java @@ -15,6 +15,7 @@ import org.apache.commons.logging.LogFactory; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntProperty; +import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.Query; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; @@ -69,8 +70,12 @@ public class PropertyDaoJena extends JenaBaseDao implements PropertyDao { } } - public PropertyDaoJena(WebappDaoFactoryJena wadf) { + private DatasetWrapperFactory dwf; + + public PropertyDaoJena(DatasetWrapperFactory dwf, + WebappDaoFactoryJena wadf) { super(wadf); + this.dwf = dwf; } @Override @@ -410,10 +415,21 @@ public class PropertyDaoJena extends JenaBaseDao implements PropertyDao { log.debug("SPARQL query:\n" + query.toString()); // Bind the subject's uri to the ?subject query term QuerySolutionMap subjectBinding = new QuerySolutionMap(); - subjectBinding.add("subject", ResourceFactory.createResource(subjectUri)); + subjectBinding.add("subject", + ResourceFactory.createResource(subjectUri)); // Run the SPARQL query to get the properties - QueryExecution qexec = QueryExecutionFactory.create(query, getOntModelSelector().getFullModel(), subjectBinding); - return qexec.execSelect(); + DatasetWrapper w = dwf.getDatasetWrapper(); + Dataset dataset = w.getDataset(); + dataset.getLock().enterCriticalSection(Lock.READ); + try { + QueryExecution qexec = QueryExecutionFactory.create( + query, dataset, subjectBinding); + return qexec.execSelect(); + } finally { + dataset.getLock().leaveCriticalSection(); + w.close(); + } } + } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/StaticDatasetFactory.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/StaticDatasetFactory.java new file mode 100644 index 000000000..2fed71d7e --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/StaticDatasetFactory.java @@ -0,0 +1,17 @@ +package edu.cornell.mannlib.vitro.webapp.dao.jena; + +import com.hp.hpl.jena.query.Dataset; + +public class StaticDatasetFactory implements DatasetWrapperFactory { + + private Dataset _dataset; + + public StaticDatasetFactory (Dataset dataset) { + _dataset = dataset; + } + + public DatasetWrapper getDatasetWrapper() { + return new DatasetWrapper(_dataset); + } + +} \ No newline at end of file diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactoryJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactoryJena.java index ff6b4b025..dbd1a46fa 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactoryJena.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/WebappDaoFactoryJena.java @@ -16,6 +16,9 @@ import com.hp.hpl.jena.iri.Violation; import com.hp.hpl.jena.ontology.OntClass; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntResource; +import com.hp.hpl.jena.query.DataSource; +import com.hp.hpl.jena.query.Dataset; +import com.hp.hpl.jena.query.DatasetFactory; import com.hp.hpl.jena.rdf.model.Literal; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; @@ -59,6 +62,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VClassGroupDao; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener; +import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase; public class WebappDaoFactoryJena implements WebappDaoFactory { @@ -97,7 +101,9 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { protected boolean INCLUDE_TOP_CONCEPT = false; protected boolean INCLUDE_BOTTOM_CONCEPT = false; - private Map properties = new HashMap(); + private Map properties = new HashMap(); + + private DatasetWrapperFactory dwf; // for temporary use to construct URIs for the things that still use integer IDs. // As these objects get changed to support getURI(), this should become unnecessary. @@ -114,7 +120,12 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { this.flag2ClassLabelMap = base.flag2ClassLabelMap; } - public WebappDaoFactoryJena(OntModelSelector ontModelSelector, String defaultNamespace, HashSet nonuserNamespaces, String[] preferredLanguages, String userURI){ + public WebappDaoFactoryJena(OntModelSelector ontModelSelector, + OntModelSelector inferenceOntModelSelector, + String defaultNamespace, + HashSet nonuserNamespaces, + String[] preferredLanguages, + String userURI){ this.ontModelSelector = ontModelSelector; @@ -162,14 +173,43 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { if (languageUniversalsModel.size()>0) { this.ontModelSelector.getTBoxModel().addSubModel(languageUniversalsModel); } + DataSource dataset = DatasetFactory.create(); + + dataset.addNamedModel(JenaDataSourceSetupBase.JENA_DB_MODEL, + ontModelSelector.getFullModel()); + if (inferenceOntModelSelector != null) { + dataset.addNamedModel(JenaDataSourceSetupBase.JENA_INF_MODEL, + inferenceOntModelSelector.getFullModel()); + } + this.dwf = new StaticDatasetFactory(dataset); + + + } + + public WebappDaoFactoryJena(OntModelSelector ontModelSelector, + String defaultNamespace, + HashSet nonuserNamespaces, + String[] preferredLanguages, + String userURI){ + this(ontModelSelector, + null, + defaultNamespace, + nonuserNamespaces, + preferredLanguages, + userURI); + } public WebappDaoFactoryJena(OntModelSelector ontModelSelector, String defaultNamespace, HashSet nonuserNamespaces, String[] preferredLanguages){ this(ontModelSelector, defaultNamespace, nonuserNamespaces, preferredLanguages, null); } + + public WebappDaoFactoryJena(OntModelSelector ontModelSelector, OntModelSelector inferenceOntModelSelector, String defaultNamespace, HashSet nonuserNamespaces, String[] preferredLanguages){ + this(ontModelSelector, inferenceOntModelSelector, defaultNamespace, nonuserNamespaces, preferredLanguages, null); + } public WebappDaoFactoryJena(OntModelSelector ontModelSelector) { - this(ontModelSelector, null, null, null, null); + this(ontModelSelector, null, null, null, null, null); } public WebappDaoFactoryJena(OntModel ontModel, String defaultNamespace, HashSet nonuserNamespaces, String[] preferredLanguages, String userURI){ @@ -181,7 +221,7 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { } public WebappDaoFactoryJena(OntModel ontModel) { - this(new SimpleOntModelSelector(ontModel), null, null, null, null); + this(new SimpleOntModelSelector(ontModel), null, null, null, null, null); } public OntModelSelector getOntModelSelector() { @@ -493,7 +533,8 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { DataPropertyStatementDao dataPropertyStatementDao = null; public DataPropertyStatementDao getDataPropertyStatementDao() { if( dataPropertyStatementDao == null ) - dataPropertyStatementDao = new DataPropertyStatementDaoJena(this); + dataPropertyStatementDao = new DataPropertyStatementDaoJena( + dwf, this); return dataPropertyStatementDao; } @@ -507,7 +548,7 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { DataPropertyDao dataPropertyDao = null; public DataPropertyDao getDataPropertyDao() { if( dataPropertyDao == null ) - dataPropertyDao = new DataPropertyDaoJena(this); + dataPropertyDao = new DataPropertyDaoJena(dwf, this); return dataPropertyDao; } @@ -528,7 +569,8 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { ObjectPropertyStatementDao objectPropertyStatementDao = null; public ObjectPropertyStatementDao getObjectPropertyStatementDao() { if( objectPropertyStatementDao == null ) - objectPropertyStatementDao = new ObjectPropertyStatementDaoJena(this); + objectPropertyStatementDao = new ObjectPropertyStatementDaoJena( + dwf, this); return objectPropertyStatementDao; } @@ -542,7 +584,7 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { private ObjectPropertyDao objectPropertyDao = null; public ObjectPropertyDao getObjectPropertyDao() { if( objectPropertyDao == null ) - objectPropertyDao = new ObjectPropertyDaoJena(this); + objectPropertyDao = new ObjectPropertyDaoJena(dwf, this); return objectPropertyDao; } @@ -595,4 +637,5 @@ public class WebappDaoFactoryJena implements WebappDaoFactory { public DisplayModelDao getDisplayModelDao(){ return new DisplayModelDaoJena( this ); } + } 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 c0693c6c5..79f34c354 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 @@ -97,20 +97,6 @@ public class WebappDaoFactorySDB extends WebappDaoFactoryJena { return vClassDao = new VClassDaoSDB(dwf, this); } - private class StaticDatasetFactory implements DatasetWrapperFactory { - - private Dataset _dataset; - - public StaticDatasetFactory (Dataset dataset) { - _dataset = dataset; - } - - public DatasetWrapper getDatasetWrapper() { - return new DatasetWrapper(_dataset); - } - - } - private class ReconnectingDatasetFactory implements DatasetWrapperFactory { private BasicDataSource _bds; 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 d6ecae371..15c4ec5e4 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 @@ -87,17 +87,20 @@ public class JenaDataSourceSetup extends JenaDataSourceSetupBase implements java checkForNamespaceMismatch( memModel, defaultNamespace ); sce.getServletContext().setAttribute("baseOntModel", memModel); - WebappDaoFactory baseWadf = new WebappDaoFactoryJena(baseOms, defaultNamespace, null, null); + 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); + 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); + WebappDaoFactory wadf = new WebappDaoFactoryJena( + baseOms, inferenceOms, defaultNamespace, null, null); sce.getServletContext().setAttribute("webappDaoFactory",wadf); sce.getServletContext().setAttribute("unionOntModelSelector", unionOms); diff --git a/webapp/web/config/listViewConfig-default.xml b/webapp/web/config/listViewConfig-default.xml index e98279fdd..97767e403 100644 --- a/webapp/web/config/listViewConfig-default.xml +++ b/webapp/web/config/listViewConfig-default.xml @@ -23,9 +23,9 @@ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?object ?name ?moniker { - ?subject ?property ?object . - OPTIONAL { ?object rdfs:label ?name . } - OPTIONAL { ?object vitro:moniker ?moniker . } + GRAPH ?g1 { ?subject ?property ?object } + OPTIONAL { GRAPH ?g2 { ?object rdfs:label ?name } } + OPTIONAL { GRAPH ?g3 { ?object vitro:moniker ?moniker } } } @@ -34,4 +34,4 @@ edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.DefaultObjectPropertyDataPostprocessor - \ No newline at end of file +