MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / updateVector

Function updateVector

query/vector/vector_test.go:152–162  ·  view source on GitHub ↗
(t *testing.T, triple string, pred string)

Source from the content-addressed store, hash-verified

150 }
151}
152func updateVector(t *testing.T, triple string, pred string) []float32 {
153 uid := strings.Split(triple, " ")[0]
154 randomVec := generateRandomVector(10)
155 updatedTriple := fmt.Sprintf("%s <%s> \"%v\" .", uid, pred, randomVec)
156 require.NoError(t, addTriplesToCluster(updatedTriple))
157
158 updatedVec, err := queryVectorUsingUid(t, uid, pred)
159 require.NoError(t, err)
160 require.Equal(t, randomVec, updatedVec)
161 return updatedVec
162}
163
164func queryVectorUsingUid(t *testing.T, uid, pred string) ([]float32, error) {
165 vectorQuery := fmt.Sprintf(`

Callers 1

TestVectorUpdateFunction · 0.85

Calls 3

generateRandomVectorFunction · 0.85
queryVectorUsingUidFunction · 0.85
addTriplesToClusterFunction · 0.70

Tested by

no test coverage detected