MCPcopy
hub / github.com/dgraph-io/dgraph / QuerySingleVectorsUsingUid

Method QuerySingleVectorsUsingUid

dgraphapi/vector.go:61–76  ·  view source on GitHub ↗
(uid, pred string)

Source from the content-addressed store, hash-verified

59}
60
61func (gc *GrpcClient) QuerySingleVectorsUsingUid(uid, pred string) ([][]float32, error) {
62 vectorQuery := fmt.Sprintf(`
63 {
64 vector(func: uid(%v)) {
65 uid
66 %v
67 }
68 }`, uid[1:len(uid)-1], pred)
69
70 resp, err := gc.Query(vectorQuery)
71 if err != nil {
72 return [][]float32{}, err
73 }
74
75 return UnmarshalVectorResp(resp)
76}
77
78func UnmarshalVectorResp(resp *api.Response) ([][]float32, error) {
79 type Data struct {

Callers 3

testVectorQueryFunction · 0.80

Calls 2

QueryMethod · 0.95
UnmarshalVectorRespFunction · 0.85

Tested by 3

testVectorQueryFunction · 0.64