static S webToString(Web web) { new L out; new Map index; for (int i = 0; i < l(web.nodes); i++) { out.add("Node " + (i+1) + ": " + struct(web.nodes.get(i).labels)); index.put(web.nodes.get(i), i+1); } for (Pair p : keys(web.relations)) out.add(index.get(p.a) + " -> " + index.get(p.b) + " = " + struct(web.relations.get(p).labels)); ret fromLines(out); }