Documentation
¶
Overview ¶
Package graphtest is the contract every brain graph backend must meet. Run it from a backend's own tests, as helixgraph does, so any graph database a host substitutes behaves as Engine expects.
Each case writes fresh object ids, namespaces and search words, so cases never see each other's data, even on one long-lived graph. A backend owns its embedding, so the contract hands newGraph the Embedder each case needs: nil for a text-only graph, or Embedder, whose vectors the contract chooses.
Index ¶
Constants ¶
const Dimension = 2
Dimension is the length of every vector Embedder returns.
const EdgeSearchLabel = "cites"
EdgeSearchLabel is the one relation the contract searches edges on. A backend that indexes edges per relation indexes it (text and vector) before Run.
const OtherEdgeSearchLabel = "quotes"
OtherEdgeSearchLabel is the second relation the contract searches edges on. A graph under test indexes both for edge search.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Embedder ¶
type Embedder struct{}
Embedder embeds a text as the vector of the first marker word in it: veca is (1, 0), vecb (0.6, 0.8), vecc (0.9, 0.1) and anything else (0, 1). Markers are ordinary words to text search. A text with the word poison fails.