de-GRAPHing some remaining DAO queries

This commit is contained in:
bjl23 2011-02-01 18:54:48 +00:00
parent 7b18bbe8d6
commit 4e18504ca0
3 changed files with 18 additions and 15 deletions

View file

@ -112,13 +112,16 @@ public class IndividualDaoSDB extends IndividualDaoJena {
String query = String query =
"SELECT DISTINCT ?ind ?label ?moniker " + "SELECT DISTINCT ?ind ?label ?moniker " +
"WHERE " + "WHERE " +
"{ GRAPH ?g { \n" + "{ \n" +
" ?ind a <" + theClass.getURI() + "> \n" + "{ \n" +
" ?ind a <" + theClass.getURI() + "> . \n" +
" ?ind <" + RDFS.label.getURI() + "> ?label \n" +
"} \n" + "} \n" +
"OPTIONAL { GRAPH ?h { ?ind <" + RDFS.label.getURI() + "> ?label } }\n" + "UNION { \n" +
"OPTIONAL { GRAPH ?i { ?ind <" + VitroVocabulary.MONIKER + "> ?moniker } } \n" + " ?ind a <" + theClass.getURI() + "> . \n" +
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + " ?ind <" + VitroVocabulary.MONIKER + "> ?moniker \n" +
"} ORDER BY ?label"; "} \n" +
"} ORDER BY ?ind ?label";
ResultSet rs =QueryExecutionFactory.create( ResultSet rs =QueryExecutionFactory.create(
QueryFactory.create(query), dataset) QueryFactory.create(query), dataset)
.execSelect(); .execSelect();

View file

@ -190,7 +190,7 @@ public class IndividualSDB extends IndividualImpl implements Individual {
} }
} }
private static final boolean SKIP_INITIALIZATION = true; static final boolean SKIP_INITIALIZATION = true;
public IndividualSDB(String individualURI, public IndividualSDB(String individualURI,
DatasetWrapperFactory datasetWrapperFactory, DatasetWrapperFactory datasetWrapperFactory,

View file

@ -53,15 +53,15 @@ public class ObjectPropertyStatementDaoSDB extends
String query = "CONSTRUCT { \n" + String query = "CONSTRUCT { \n" +
" <" + entity.getURI() + "> ?p ?o . \n" + " <" + entity.getURI() + "> ?p ?o . \n" +
// " ?o a ?oType . \n" + // " ?o a ?oType . \n" +
" ?o <" + RDFS.label.getURI() + "> ?oLabel . \n" + // " ?o <" + RDFS.label.getURI() + "> ?oLabel . \n" +
" ?o <" + VitroVocabulary.MONIKER + "> ?oMoniker \n" + // " ?o <" + VitroVocabulary.MONIKER + "> ?oMoniker \n" +
"} WHERE { \n" + "} WHERE { \n" +
" { <" + entity.getURI() + "> ?p ?o } \n" + " { <" + entity.getURI() + "> ?p ?o } \n" +
// " UNION { <" + entity.getURI() + "> ?p ?o . ?o a ?oType } \n" + // " UNION { <" + entity.getURI() + "> ?p ?o . ?o a ?oType } \n" +
" UNION { <" + entity.getURI() + "> ?p ?o . \n" + // " UNION { <" + entity.getURI() + "> ?p ?o . \n" +
" ?o <" + RDFS.label.getURI() + "> ?oLabel } \n" + // " ?o <" + RDFS.label.getURI() + "> ?oLabel } \n" +
" UNION { <" + entity.getURI() + "> ?p ?o . \n " + // " UNION { <" + entity.getURI() + "> ?p ?o . \n " +
" ?o <" + VitroVocabulary.MONIKER + "> ?oMoniker } \n" + // " ?o <" + VitroVocabulary.MONIKER + "> ?oMoniker } \n" +
"}"; "}";
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Model m = null; Model m = null;
@ -127,7 +127,7 @@ public class ObjectPropertyStatementDaoSDB extends
this.dwf, this.dwf,
datasetMode, datasetMode,
getWebappDaoFactory(), getWebappDaoFactory(),
m); IndividualSDB.SKIP_INITIALIZATION);
objPropertyStmt.setObject(objInd); objPropertyStmt.setObject(objInd);
} }