static void webs_toTripleFile(Collection webs, PrintWriter out) { new L names; new Map index; new StringBuilder buf; for (Web web : webs) { T3 t = ai_webToTriple(web); if (t == null) fail("Not tripelizable: " + webToStringShort(web)); S moreInfo = quote(unnull(web.globalID())) + " " + quote(unnull(web.title)) + " " + quote(unnull(web.source)) + " " + (web.unverified ? "u" : "v") + " " + web.created; buf.append( webs_toTripleFile_indexGet(names, index, t.a) + " " + webs_toTripleFile_indexGet(names, index, t.b) + " " + webs_toTripleFile_indexGet(names, index, t.c) + " " + moreInfo + "\n"); } //out.println(struct(names)); for (S s : names) out.println(quoteUnlessIdentifierOrInteger(s)); out.println(); out.print(buf); } static int webs_toTripleFile_indexGet(L names, Map index, S s) { Int i = index.get(s); if (i == null) { i = l(names); names.add(s); index.put(s, i); } ret i; }