merge to master

This commit is contained in:
Barak Michener 2014-08-06 16:21:57 -04:00
commit c64acabee0
30 changed files with 645 additions and 334 deletions

View file

@ -28,14 +28,17 @@ import (
"github.com/google/cayley/quad"
)
// Defines an opaque "triple store value" type. However the backend wishes to
// implement it, a Value is merely a token to a triple or a node that the backing
// store itself understands, and the base iterators pass around.
// Value defines an opaque "triple store value" type. However the backend wishes
// to implement it, a Value is merely a token to a triple or a node that the
// backing store itself understands, and the base iterators pass around.
//
// For example, in a very traditional, graphd-style graph, these are int64s
// (guids of the primitives). In a very direct sort of graph, these could be
// pointers to structs, or merely triples, or whatever works best for the
// backing store.
//
// These must be comparable, or implement a `Hasher() interface{}` function
// so that they may be stored in maps.
type Value interface{}
type TripleStore interface {
@ -44,7 +47,7 @@ type TripleStore interface {
ApplyDeltas([]*Delta) error
// Given an opaque token, returns the triple for that token from the store.
Quad(Value) *quad.Quad
Quad(Value) quad.Quad
// Given a direction and a token, creates an iterator of links which have
// that node token in that directional field.