sbool ai_tripleToTripleRef_debug; static TripleRef ai_tripleToTripleRef(TripleWeb w, Symbol searchTerm, int occurrence) { if (ai_tripleToTripleRef_debug) print("ai_tripleToTripleRef: " + w + " " + searchTerm + " " + occurrence); if (w == null) null; // occurrence count magic if (occurrence < 3) for (int i = 0; i < 3; i++) if (eqic(tripleGet(w, i), searchTerm)) { if (occurrence-- == 0) ret tripleRef(w, i); } null; }