if (squash && " ".equals(s)) return "";
return s;
}
private void learnHighDegreeProperties(boolean isInverse, int limit) {
CachedPropertyCollection knownHighProps = isInverse
? config.getVocabularyStore().getHighIndegreeProperties()
: config.getVocabularyStore().getHighOutdegreeProperties();
Map<Property, Integer> highCounts = isInverse
? highIndegreeProperties
: highOutdegreeProperties;
StmtIterator it = isInverse
? model.listStatements(null, null, resource)
: resource.listProperties();
Map<Property, Integer> valueCounts = new HashMap<Property, Integer>();
while (it.hasNext()) {
Property p = it.next().getPredicate();
if (!valueCounts.containsKey(p)) {
valueCounts.put(p, 0);
}
valueCounts.put(p, valueCounts.get(p) + 1);
}
for (Property p: valueCounts.keySet()) {
if (valueCounts.get(p) <= limit) continue;
knownHighProps.reportAdditional(p);
if (isInverse) {
model.removeAll(null, p, resource);
} else {
resource.removeAll(p);
}