NIHVIVO-1849 added check for empty result set
This commit is contained in:
parent
781f3d042f
commit
aeff100428
1 changed files with 17 additions and 11 deletions
|
@ -939,17 +939,23 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
||||||
propertyURI + "> ?object} \n" +
|
propertyURI + "> ?object} \n" +
|
||||||
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) +
|
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) +
|
||||||
"}";
|
"}";
|
||||||
ResultSet results = QueryExecutionFactory.create(
|
QueryExecution qe = QueryExecutionFactory.create(
|
||||||
QueryFactory.create(valueOfProperty), dataset).execSelect();
|
QueryFactory.create(valueOfProperty), dataset);
|
||||||
QuerySolution result = results.next();
|
try {
|
||||||
RDFNode value = result.get("object");
|
ResultSet results = qe.execSelect();
|
||||||
if (value != null && value.canAs(OntResource.class)) {
|
if (results.hasNext()) {
|
||||||
return new IndividualSDB(
|
QuerySolution result = results.next();
|
||||||
((OntResource) value.as(OntResource.class)).getURI(),
|
RDFNode value = result.get("object");
|
||||||
dwf, datasetMode, webappDaoFactory);
|
if (value != null && value.canAs(OntResource.class)) {
|
||||||
} else {
|
return new IndividualSDB(
|
||||||
return null;
|
((OntResource) value.as(OntResource.class)).getURI(),
|
||||||
}
|
dwf, datasetMode, webappDaoFactory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} finally {
|
||||||
|
qe.close();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
dataset.getLock().leaveCriticalSection();
|
dataset.getLock().leaveCriticalSection();
|
||||||
w.close();
|
w.close();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue