fix to long-standing bug where entity counts not populated by non-filtering DAO
This commit is contained in:
parent
a3472b4fe8
commit
9c2c22edfd
1 changed files with 6 additions and 2 deletions
|
@ -787,7 +787,11 @@ public class VClassDaoJena extends JenaBaseDao implements VClassDao {
|
||||||
VClass vcw = (VClass) getVClassByURI(cls.getURI());
|
VClass vcw = (VClass) getVClassByURI(cls.getURI());
|
||||||
if (vcw != null) {
|
if (vcw != null) {
|
||||||
boolean classIsInstantiated = false;
|
boolean classIsInstantiated = false;
|
||||||
if (includeUninstantiatedClasses == false) {
|
if (getIndividualCount) {
|
||||||
|
int count = getOntModel().listStatements(null,RDF.type,cls).toList().size();
|
||||||
|
vcw.setEntityCount(count);
|
||||||
|
classIsInstantiated = (count > 0);
|
||||||
|
} else if (includeUninstantiatedClasses == false) {
|
||||||
// Note: to support SDB models, may want to do this with
|
// Note: to support SDB models, may want to do this with
|
||||||
// SPARQL and LIMIT 1 if SDB can take advantage of it
|
// SPARQL and LIMIT 1 if SDB can take advantage of it
|
||||||
ClosableIterator countIt = getOntModel().listStatements(null,RDF.type,cls);
|
ClosableIterator countIt = getOntModel().listStatements(null,RDF.type,cls);
|
||||||
|
@ -799,7 +803,7 @@ public class VClassDaoJena extends JenaBaseDao implements VClassDao {
|
||||||
countIt.close();
|
countIt.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//vcw.setEntityCount(count);
|
|
||||||
if (includeUninstantiatedClasses || classIsInstantiated) {
|
if (includeUninstantiatedClasses || classIsInstantiated) {
|
||||||
group.add(vcw);
|
group.add(vcw);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue