//list equivalent classes
for (Iterator i=((OntClass)resource).listEquivalentClasses();
i.hasNext();) {
OntClass equivClass = (OntClass) i.next();
//add labels
for (Iterator j=equivClass.listLabels(null); j.hasNext();) {
Literal l = (Literal) j.next();
synonyms.put(l.toString(), "1");
}
}
}