reverting a small rearrangement of VClassGroupCache to avoid changing the unit test
This commit is contained in:
parent
1a1606d6ff
commit
6e99b1c707
1 changed files with 18 additions and 16 deletions
|
@ -358,25 +358,24 @@ public class VClassGroupCache implements SearchIndexer.Listener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean isClassNameChange(Statement stmt, ServletContext context) {
|
protected static boolean isClassNameChange(Statement stmt, OntModel jenaOntModel) {
|
||||||
// Check if the stmt is a rdfs:label change and that the
|
// Check if the stmt is a rdfs:label change and that the
|
||||||
// subject is an owl:Class.
|
// subject is an owl:Class.
|
||||||
if( !RDFS.label.equals( stmt.getPredicate() )) {
|
if( RDFS.label.equals( stmt.getPredicate() )) {
|
||||||
|
jenaOntModel.enterCriticalSection(Lock.READ);
|
||||||
|
try{
|
||||||
|
return jenaOntModel.contains(
|
||||||
|
ResourceFactory.createStatement(
|
||||||
|
ResourceFactory.createResource(stmt.getSubject().getURI()),
|
||||||
|
RDF.type,
|
||||||
|
OWL.Class));
|
||||||
|
}finally{
|
||||||
|
jenaOntModel.leaveCriticalSection();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
OntModel jenaOntModel = ModelAccess.on(context).getOntModelSelector().getTBoxModel();
|
|
||||||
jenaOntModel.enterCriticalSection(Lock.READ);
|
|
||||||
try{
|
|
||||||
return jenaOntModel.contains(
|
|
||||||
ResourceFactory.createStatement(
|
|
||||||
ResourceFactory.createResource(stmt.getSubject().getURI()),
|
|
||||||
RDF.type,
|
|
||||||
OWL.Class));
|
|
||||||
}finally{
|
|
||||||
jenaOntModel.leaveCriticalSection();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ******************** RebuildGroupCacheThread **************** */
|
/* ******************** RebuildGroupCacheThread **************** */
|
||||||
|
|
||||||
protected class RebuildGroupCacheThread extends VitroBackgroundThread {
|
protected class RebuildGroupCacheThread extends VitroBackgroundThread {
|
||||||
|
@ -488,8 +487,11 @@ public class VClassGroupCache implements SearchIndexer.Listener {
|
||||||
requestCacheUpdate();
|
requestCacheUpdate();
|
||||||
} else if(VitroVocabulary.DISPLAY_RANK.equals(stmt.getPredicate().getURI())){
|
} else if(VitroVocabulary.DISPLAY_RANK.equals(stmt.getPredicate().getURI())){
|
||||||
requestCacheUpdate();
|
requestCacheUpdate();
|
||||||
} else if( isClassNameChange(stmt, context) ) {
|
} else if (RDFS.label.equals(stmt.getPredicate())){
|
||||||
requestCacheUpdate();
|
OntModel jenaOntModel = ModelAccess.on(context).getOntModelSelector().getTBoxModel();
|
||||||
|
if( isClassNameChange(stmt, jenaOntModel) ) {
|
||||||
|
requestCacheUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue