resolves NIHVIVO-98 'Properties ''applicable'' to a class are not applied to directly equivalent classes'
This commit is contained in:
parent
8e15b5e20c
commit
6ca8826f85
2 changed files with 16 additions and 5 deletions
|
@ -43,6 +43,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
import edu.cornell.mannlib.vitro.webapp.dao.InsertException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.OntologyDao;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener;
|
import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener;
|
||||||
|
|
||||||
|
@ -308,9 +309,14 @@ public class DataPropertyDaoJena extends PropertyDaoJena implements
|
||||||
List<DataProperty> datapropsForClass = new ArrayList();
|
List<DataProperty> datapropsForClass = new ArrayList();
|
||||||
OntModel ontModel = getOntModelSelector().getTBoxModel();
|
OntModel ontModel = getOntModelSelector().getTBoxModel();
|
||||||
try {
|
try {
|
||||||
HashSet<String> superclassURIs = new HashSet<String>(getWebappDaoFactory().getVClassDao().getAllSuperClassURIs(vclassURI));
|
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
||||||
Iterator superclassURIsIt = superclassURIs.iterator();
|
HashSet<String> superclassURIs = new HashSet<String>(vcDao.getAllSuperClassURIs(vclassURI));
|
||||||
superclassURIs.add(vclassURI);
|
superclassURIs.add(vclassURI);
|
||||||
|
for (String equivURI : vcDao.getEquivalentClassURIs(vclassURI)) {
|
||||||
|
superclassURIs.add(equivURI);
|
||||||
|
superclassURIs.addAll(vcDao.getAllSuperClassURIs(equivURI));
|
||||||
|
}
|
||||||
|
Iterator superclassURIsIt = superclassURIs.iterator();
|
||||||
ontModel.enterCriticalSection(Lock.READ);
|
ontModel.enterCriticalSection(Lock.READ);
|
||||||
try {
|
try {
|
||||||
Iterator dataprops = ontModel.listDatatypeProperties();
|
Iterator dataprops = ontModel.listDatatypeProperties();
|
||||||
|
|
|
@ -134,11 +134,16 @@ public class PropertyInstanceDaoJena extends JenaBaseDao implements
|
||||||
}
|
}
|
||||||
List<PropertyInstance> propInsts = new ArrayList();
|
List<PropertyInstance> propInsts = new ArrayList();
|
||||||
|
|
||||||
List<String> allSuperclassURIs = getWebappDaoFactory().getVClassDao().getAllSuperClassURIs(classURI);
|
VClassDao vcDao = getWebappDaoFactory().getVClassDao();
|
||||||
|
|
||||||
|
Set<String> allSuperclassURIs = new HashSet<String>();
|
||||||
|
|
||||||
if (allSuperclassURIs == null)
|
|
||||||
allSuperclassURIs = new ArrayList();
|
|
||||||
allSuperclassURIs.add(classURI);
|
allSuperclassURIs.add(classURI);
|
||||||
|
for (String equivURI : vcDao.getEquivalentClassURIs(classURI)) {
|
||||||
|
allSuperclassURIs.add(equivURI);
|
||||||
|
allSuperclassURIs.addAll(vcDao.getAllSuperClassURIs(equivURI));
|
||||||
|
}
|
||||||
|
allSuperclassURIs.addAll(vcDao.getAllSuperClassURIs(classURI));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue