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 a93ac88ae..dac869b54 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 @@ -57,15 +57,13 @@ public class DataPropertyStatementDaoSDB extends DataPropertyStatementDaoJena } else { - String[] graphVars = { "?g" }; String query = "CONSTRUCT { \n" + " <" + entity.getURI() + "> ?p ?o . \n" + - "} WHERE { GRAPH ?g { \n" + + "} WHERE { \n" + " <" + entity.getURI() + "> ?p ?o . \n" + " FILTER(isLiteral(?o)) \n" + - WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + - "} }" ; + "}" ; Model results = null; DatasetWrapper w = dwf.getDatasetWrapper(); Dataset dataset = w.getDataset(); 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 96cedd1c2..95216e798 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 @@ -395,8 +395,8 @@ public class IndividualSDB extends IndividualImpl implements Individual { String[] graphVars = { "?g" }; String queryStr = "CONSTRUCT { <"+ind.getURI()+"> <" + propertyURI + "> ?value } \n" + - "WHERE { GRAPH ?g { \n" + - "<" + ind.getURI() +"> <" + propertyURI + "> ?value } \n" + + "WHERE { \n" + + "<" + ind.getURI() +"> <" + propertyURI + "> ?value \n" + WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + "\n} "; Query query = QueryFactory.create(queryStr); @@ -502,14 +502,11 @@ public class IndividualSDB extends IndividualImpl implements Individual { if( _hasThumb != null ){ return _hasThumb; }else{ - String[] graphVars = { "?g" }; String ask = - "ASK { GRAPH ?g " + - " { <" + individualURI + "> ?mainImage . \n" + - " ?mainImage ?thumbImage . }\n" + - WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + - "}"; - DatasetWrapper w = getDatasetWrapper(); + "ASK { " + + " <" + individualURI + "> ?mainImage . \n" + + " ?mainImage ?thumbImage . }\n" ; + DatasetWrapper w = getDatasetWrapper(); Dataset dataset = w.getDataset(); dataset.getLock().enterCriticalSection(Lock.READ); try{ @@ -552,10 +549,8 @@ public class IndividualSDB extends IndividualImpl implements Individual { Dataset dataset = w.getDataset(); dataset.getLock().enterCriticalSection(Lock.READ); try { - String graphVars[] = { "?g" }; StringBuffer selectPrimaryLinkQueryBuff = new StringBuffer().append( - "SELECT ?url ?anchor \n" ).append( - "WHERE{ GRAPH ?g { \n " ).append( + "SELECT ?url ?anchor \n" ).append(" WHERE { \n").append( " <" + this.individualURI + "> ").append( "<" + VitroVocabulary.PRIMARY_LINK + "> " ).append( "?link . \n").append( @@ -563,9 +558,7 @@ public class IndividualSDB extends IndividualImpl implements Individual { ).append( " ?link <" + VitroVocabulary.LINK_ANCHOR + "> ?anchor . \n" ).append( - "} \n") - .append(WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode)) - .append("}"); + "} \n"); QueryExecution qexec = QueryExecutionFactory.create( QueryFactory.create(selectPrimaryLinkQueryBuff.toString()) , dataset); @@ -678,12 +671,9 @@ public class IndividualSDB extends IndividualImpl implements Individual { Dataset dataset = w.getDataset(); dataset.getLock().enterCriticalSection(Lock.READ); try { - String[] graphVars = { "?g" }; String valuesOfProperty = - "CONSTRUCT{<" + this.individualURI + "> <" + propertyURI + "> ?object}" + - "WHERE{ GRAPH ?g { <" + this.individualURI + "> <" + propertyURI + "> ?object} \n" + - WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + - "}"; + "CONSTRUCT{ <" + this.individualURI + "> <" + propertyURI + "> ?object }" + + "WHERE{ <" + this.individualURI + "> <" + propertyURI + "> ?object } \n"; tempModel = QueryExecutionFactory.create(QueryFactory.create(valuesOfProperty), dataset).execConstruct(); ontModel.add(tempModel.listStatements()); Resource ontRes = ontModel.getResource(this.individualURI); @@ -727,13 +717,10 @@ public class IndividualSDB extends IndividualImpl implements Individual { Dataset dataset = w.getDataset(); dataset.getLock().enterCriticalSection(Lock.READ); try { - String[] graphVars = { "?g" }; String valuesOfProperty = "SELECT ?object" + - "WHERE{ GRAPH ?g { <" + this.individualURI + "> <" + - propertyURI + "> ?object} \n" + - WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + - "}"; + "WHERE{ <" + this.individualURI + "> <" + + propertyURI + "> ?object } \n"; ResultSet values = QueryExecutionFactory.create( QueryFactory.create(valuesOfProperty), dataset) .execSelect(); @@ -767,13 +754,10 @@ public class IndividualSDB extends IndividualImpl implements Individual { Dataset dataset = w.getDataset(); dataset.getLock().enterCriticalSection(Lock.READ); try { - String[] graphVars = { "?g" }; String valueOfProperty = "SELECT ?object " + - "WHERE{ GRAPH ?g { <" + this.individualURI + "> <" + - propertyURI + "> ?object} \n" + - WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + - "}"; + "WHERE{ <" + this.individualURI + "> <" + + propertyURI + "> ?object } \n"; QueryExecution qe = QueryExecutionFactory.create( QueryFactory.create(valueOfProperty), dataset); try { diff --git a/webapp/web/templates/edit/specific/ents_edit.jsp b/webapp/web/templates/edit/specific/ents_edit.jsp index 32b09295d..1a9ff77c6 100644 --- a/webapp/web/templates/edit/specific/ents_edit.jsp +++ b/webapp/web/templates/edit/specific/ents_edit.jsp @@ -34,13 +34,13 @@
@@ -51,13 +51,13 @@