Fixing NPE when individual has no moniker and no types. NIHVIVO-1927
This commit is contained in:
parent
d68faf2cec
commit
347c09ef51
1 changed files with 12 additions and 12 deletions
|
@ -565,6 +565,7 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
|||
// may have more than 1 VClass
|
||||
List<VClass> clasList = this.getVClasses(true);
|
||||
if (clasList == null || clasList.size() < 2) {
|
||||
if( getVClass() != null )
|
||||
moniker = getVClass().getName();
|
||||
} else {
|
||||
VClass preferredClass = null;
|
||||
|
@ -644,12 +645,12 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
|||
dataset.getLock().enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
String[] graphVars = { "?g" };
|
||||
String queryStr = "CONSTRUCT { ?ind <" +
|
||||
propertyURI + "> ?value } \n" +
|
||||
"WHERE { GRAPH ?g { ?ind <" +
|
||||
propertyURI + "> ?value } \n" +
|
||||
String queryStr =
|
||||
"CONSTRUCT { <"+ind.getURI()+"> <" + propertyURI + "> ?value } \n" +
|
||||
"WHERE { GRAPH ?g { \n" +
|
||||
"<" + ind.getURI() +"> <" + propertyURI + "> ?value } \n" +
|
||||
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) +
|
||||
"\n} \n";
|
||||
"\n} ";
|
||||
Query query = QueryFactory.create(queryStr);
|
||||
QueryExecution qe = QueryExecutionFactory.create(
|
||||
query, dataset);
|
||||
|
@ -666,11 +667,10 @@ public class IndividualSDB extends IndividualImpl implements Individual {
|
|||
}else{
|
||||
String[] graphVars = { "?g" };
|
||||
String getPropertyValue =
|
||||
"SELECT ?value" +
|
||||
"WHERE { GRAPH ?g { <" + individualURI + ">" +
|
||||
webappDaoFactory.getJenaBaseDao().SEARCH_BOOST_ANNOT +
|
||||
"?value} \n" +
|
||||
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) +
|
||||
"SELECT ?value \n" +
|
||||
"WHERE { GRAPH ?g { \n" +
|
||||
"<" +individualURI+ "> <" +webappDaoFactory.getJenaBaseDao().SEARCH_BOOST_ANNOT+ "> ?value} \n" +
|
||||
WebappDaoFactorySDB.getFilterBlock(graphVars, datasetMode) + "\n" +
|
||||
"}";
|
||||
DatasetWrapper w = getDatasetWrapper();
|
||||
Dataset dataset = w.getDataset();
|
||||
|
|
Loading…
Add table
Reference in a new issue