static L webs_readTripleFileAsTriples(File f) { if (!f.exists()) ret ll(); Iterator it = linesFromFile(f); new L names; while (it.hasNext()) { S s = trim(it.next()); if (empty(s)) break; names.add(unquote(s)); } new L triples; while (it.hasNext()) { S s = it.next(); pcall { addIfNotNull(triples, webs_readTripleFileAsTriple_line(s, names)); } } ret triples; } static TripleWeb webs_readTripleFileAsTriple_line(S s, L names) { L l = javaTokC(s); if (l(l) == 8) { new TripleWeb t; t.a = intern(names.get(parseInt(l.get(0)))); t.b = intern(names.get(parseInt(l.get(1)))); t.c = intern(names.get(parseInt(l.get(2)))); t.globalID(unquote(l.get(3))); // t.title = unquote(l.get(4)); // unused t.source = intern(unquote(l.get(5))); t.flags = eq(l.get(6), "v") ? 0 : TripleWeb.UNVERIFIED; t.created = parseLong(l.get(7)); ret t; } null; }