func iteratedQuads(qs graph.QuadStore, it graph.Iterator) []quad.Quad { var res ordered for graph.Next(it) { res = append(res, qs.Quad(it.Result())) } sort.Sort(res) return res }
func IteratedQuads(t testing.TB, qs graph.QuadStore, it graph.Iterator) []quad.Quad { var res quad.ByQuadString for graph.Next(it) { res = append(res, qs.Quad(it.Result())) } require.Nil(t, it.Err()) sort.Sort(res) return res }
func iterateResults(qs graph.QuadStore, it graph.Iterator) []string { var res []string for graph.Next(it) { v := it.Result() if t, ok := v.(*Token); ok && t.Kind == nodeKind { res = append(res, qs.NameOf(it.Result())) } else { res = append(res, qs.Quad(it.Result()).String()) } } sort.Strings(res) it.Reset() return res }
func printIterator(qs graph.QuadStore, it graph.Iterator) { for graph.Next(it) { glog.Infof("%v", qs.Quad(it.Result())) } }