private static void processMatchingTerms() throws Exception { // Report all the matches between terms. LoomTerm term1 = null; LoomTerm term2 = null; while (!termRetainer.isEmpty()) { term1 = termRetainer.remove(0); Iterator<LoomTerm> itr = termRetainer.iterator(); while (itr.hasNext()) { term2 = itr.next(); // Don't report any matches within an ontology. if (term1.matchOntID(term2)) { log.trace("Skipping terms, same ontology:"); log.trace("... {}", term1.toString()); log.trace("... {}", term2.toString()); continue; } // Detect any exact match for term URI. if (term1.matchURL(term2)) { // This is handled by the UriMatchMappings process log.trace("Skipping terms, same URL:"); log.trace("... {}", term1.toString()); log.trace("... {}", term2.toString()); continue; } // Don't report matches between synonyms. if (term1.isSkosAltLabel() && term2.isSkosAltLabel()) { log.trace("Skipping terms, both altLabel:"); log.trace("... {}", term1.toString()); log.trace("... {}", term2.toString()); continue; } // Ignore some term labels. if (skipLabels(term1, term2) || skipCellPhone(term1, term2)) { log.trace("Skipping terms, a label is problematic:"); log.trace("... {}", term1.toString()); log.trace("... {}", term2.toString()); continue; } createLoomMappings(term1, term2); } } // Should not be necessary, but just to be sure! termRetainer.clear(); // Do we need a new output file? if (oFileName != null && oMapCount > oMapCountMax) { createOutputStream(oFileName); oMapCount = 0; } }