MCPcopy
hub / github.com/cayleygraph/cayley / primitiveToQuad

Method primitiveToQuad

graph/kv/quadstore.go:394–405  ·  view source on GitHub ↗
(ctx context.Context, tx kv.Tx, p *proto.Primitive)

Source from the content-addressed store, hash-verified

392}
393
394func (qs *QuadStore) primitiveToQuad(ctx context.Context, tx kv.Tx, p *proto.Primitive) (quad.Quad, error) {
395 q := &quad.Quad{}
396 for _, dir := range quad.Directions {
397 v := p.GetDirection(dir)
398 val, err := qs.getValFromLog(ctx, tx, v)
399 if err != nil {
400 return *q, err
401 }
402 q.Set(dir, val)
403 }
404 return *q, nil
405}
406
407func (qs *QuadStore) getValFromLog(ctx context.Context, tx kv.Tx, k uint64) (quad.Value, error) {
408 if k == 0 {

Callers 1

QuadMethod · 0.95

Implementers 1

QuadStoregraph/gaedatastore/quadstore.go

Calls 3

getValFromLogMethod · 0.95
GetDirectionMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected