if(log.isDebugEnabled()){
log.debug("compute co-mentions for ContentItem {} language {} text={}",
new Object []{ci.getUri().getUnicodeString(), language, StringUtils.abbreviate(at.getSpan(), 100)});
}
//create the in-memory database for the mentioned Entities
ContentItemMentionBuilder entityMentionIndex = new ContentItemMentionBuilder(
labelTokenizer, language, linkerConfig.getDefaultLanguage());
MGraph metadata = ci.getMetadata();
Set<UriRef> textAnnotations = new HashSet<UriRef>();
ci.getLock().readLock().lock();
try { //iterate over all TextAnnotations (mentions of Entities)
for(Iterator<Triple> it = metadata.filter(null, RDF_TYPE, ENHANCER_TEXTANNOTATION); it.hasNext();){
UriRef ta = (UriRef)it.next().getSubject();
entityMentionIndex.registerTextAnnotation(ta, metadata);
textAnnotations.add(ta); //store the registered text annotations
}
} finally {
ci.getLock().readLock().unlock();
}