当前位置: 首页>>代码示例>>Golang>>正文


Golang TripleStore.NameOf方法代码示例

本文整理汇总了Golang中github.com/google/cayley/graph.TripleStore.NameOf方法的典型用法代码示例。如果您正苦于以下问题:Golang TripleStore.NameOf方法的具体用法?Golang TripleStore.NameOf怎么用?Golang TripleStore.NameOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/google/cayley/graph.TripleStore的用法示例。


在下文中一共展示了TripleStore.NameOf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: checkIteratorContains

func checkIteratorContains(ts graph.TripleStore, it graph.Iterator, expected []string, t *testing.T) {
	var actual []string
	actual = nil
	for {
		val, ok := it.Next()
		if !ok {
			break
		}
		actual = append(actual, ts.NameOf(val))
	}
	actualSet := actual[:]
	for _, a := range expected {
		found := false
		for j, b := range actualSet {
			if a == b {
				actualSet = append(actualSet[:j], actualSet[j+1:]...)
				found = true
				break
			}
		}
		if !found {
			t.Error("Couldn't find", a, "in actual output.\nActual:", actual, "\nExpected: ", expected, "\nRemainder: ", actualSet)
			return
		}
	}
	if len(actualSet) != 0 {
		t.Error("Actual output has more than expected.\nActual:", actual, "\nExpected: ", expected, "\nRemainder: ", actualSet)
	}
}
开发者ID:niksd,项目名称:cayley,代码行数:29,代码来源:value_comparison_iterator_test.go

示例2: iteratedNames

func iteratedNames(qs graph.TripleStore, it graph.Iterator) []string {
	var res []string
	for graph.Next(it) {
		res = append(res, qs.NameOf(it.Result()))
	}
	sort.Strings(res)
	return res
}
开发者ID:Joeento,项目名称:cayley,代码行数:8,代码来源:leveldb_test.go

示例3: extractValuesFromIterator

func extractValuesFromIterator(ts graph.TripleStore, it graph.Iterator) []string {
	var output []string
	for {
		val, ok := it.Next()
		if !ok {
			break
		}
		output = append(output, ts.NameOf(val))
	}
	return output
}
开发者ID:niksd,项目名称:cayley,代码行数:11,代码来源:leveldb_test.go

示例4: iteratedNames

func iteratedNames(qs graph.TripleStore, it graph.Iterator) []string {
	var res []string
	for {
		val, ok := graph.Next(it)
		if !ok {
			break
		}
		res = append(res, qs.NameOf(val))
	}
	sort.Strings(res)
	return res
}
开发者ID:neevor,项目名称:cayley,代码行数:12,代码来源:leveldb_test.go


注:本文中的github.com/google/cayley/graph.TripleStore.NameOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。