Involved Source Filesaggregate.go Chained n-hop walk-count aggregation: the multi-hop path of Aggregation,
which seeds per-node walk multiplicity from the filtered sources and
expands hop by hop over the CSR (two dense buffers ping-pong, frontier
tracked so clears are O(active)), emitting one row per reached endpoint.
Split from aggregate_run.go, which holds the single-scan Run.aggregate_run.goanalytics.goatoms.gobuilder.gobuilder_read.gocol.gocolumn.go Narrow integer-column storage (task 213): values that fit a small byte
class after a minimum offset store little-endian deltas at width 1, 2,
4, or 6 instead of 8 bytes each. Narrowing is a storage choice made at
column build -- the logical Dtype stays I64 and values read back
identically through every class. The 6-byte class exists for
epoch-millis timestamp columns, whose offset spans sit at 37-45 bits --
past u32, far under u64. Dense, sparse, and rank layouts share one
value-vector representation.column_rank.gocow.gofinalize.gofulltext.gogeo.goindex.goint128.gokernels.go Neighbor-counting and common-neighbor analytics: the neighbor histogram,
the pairwise common-neighborhood set, and the masked A^2 / link-
prediction primitive (per-source distinct two-hop endpoint counts,
folded in parallel). Split from kernels.go, which holds the
roots-via / functional-relationship kernels. Label-conditional degree statistics: the average number of relationships
of one type, in one direction, per node carrying one label. The global
AvgDegree averages a type's count over the type's OWN sources, which says
nothing about how a particular label's nodes fan out over it -- a type
whose rels overwhelmingly leave one label reads as a huge average for
every label that merely touches it. A chain-cost estimator multiplying
hop fan-outs needs the conditional form, or a low-cardinality anchor
hides an exploding chain behind it.manager.goneighborgroups.gonquads.go N-Quads serialization: writing a snapshot as a deterministic, byte-stable
N-Quads document (optionally gzip-compressed), the property Value -> RDF
literal mapping, and IRI percent-escaping. Split from nquads.go, which
holds the vocabulary, constants, and the parse/build (read) path.prop.gopropagate.gopropindex.goprops.gorangeindex.goremoval.gosearch_bfs.gosearch_dijkstra.goserialize.gosnapshot.gothaw.gotraverse.gotypedadj.go Bound-pair typed-adjacency queries: counting and position-seeking the
m-matched relationships between two given endpoints. Each side-picks the
lower-degree endpoint's run (a reverse run lists the same relationships)
across the typed-view, below-floor run, and sorted edge-key tiers. Split
from typedadj.go, which holds the view construction. Package chickpeas is a high-performance in-memory graph database: the Go
implementation of RustyChickpeas. Graphs are built with a Builder,
finalized into an immutable read-optimized Snapshot (CSR adjacency,
columnar properties, lazy indexes), and exchanged as RCPG files (package
rcpg) byte-compatibly with the Rust implementation.value.go
Code Examples
package main
import (
"fmt"
chickpeas "github.com/freeeve/gochickpeas"
)
func main() {
// Boot: build the initial snapshot and register it.
b := chickpeas.NewBuilder(0, 0)
alice, _ := b.AddNode("Person")
bob, _ := b.AddNode("Person")
b.SetProp(alice, "name", "alice")
b.SetProp(bob, "name", "bob")
b.AddRel(alice, bob, "KNOWS")
m := chickpeas.NewManager()
m.AddSnapshotWithVersion("v1", b.Finalize())
// One write cycle: read -> thaw -> edit -> Finalize -> swap.
cur, _ := m.Snapshot("v1")
w := chickpeas.NewBuilderFromSnapshot(cur)
carol, _ := w.AddNode("Person")
w.SetProp(carol, "name", "carol")
w.AddRel(alice, carol, "KNOWS")
w.RemoveNode(bob) // detach-delete: bob's rels die with him
m.AddSnapshotWithVersion("v2", w.Finalize())
v1, _ := m.Snapshot("v1")
v2, _ := m.Snapshot("v2")
fmt.Printf("v1: %d nodes, %d rels\n", v1.NodeCount(), v1.RelCount())
fmt.Printf("v2: %d nodes, %d rels\n", v2.NodeCount(), v2.RelCount())
for nbr := range v2.Neighbors(alice, chickpeas.Outgoing) {
fmt.Printf("alice now knows %s\n", v2.Prop(nbr, "name").StrOr("?"))
}
}
Aggregation is a fluent parallel grouped reduction; build with
Snapshot.Aggregate, chain the steps, then Run. Bin groups by a column bucketed at ascending bounds (bucket = count of
bounds <= value; field = "{column}_bin"). By groups by an i64 column's value (field = the column name). ByLabel groups by the source node label (key = its index; field "label"). ByLabelMembership groups by membership of one label (key 0/1; field =
the label name) -- the n:Label predicate as a dimension, distinct from
ByLabel. Filter adds the population predicate `column op value`; rows passing all
filters are counted in Total. FilterVia keeps a source node only when column of its projected node
(projection[node], e.g. a RootsVia array) is in allowed -- a membership
test over any value type, applied with the scalar filters. Having adds a predicate applied to grouped rows only (after the
population filters). Hop appends a hop to a chained n-hop WALK count: Run then counts the
walks of the whole hop sequence from each filtered source, one group per
reachable final endpoint (field "endpoint"). A rel may be reused across
hops, so this equals a relationship-unique path count only for shapes
where no rel can repeat -- the caller restricts to such shapes. Mutually
exclusive with Through. OnlyNeighbors restricts Through counting to these neighbors. RequirePresent keeps only source nodes carrying a value for column (the
IS NOT NULL predicate), regardless of dtype. Run executes the reduction in parallel and collects the groups. Sum also sums this i64 column per group. TemporalComponent groups by a temporal component of an epoch-millis
column (field = "{column}_{unit}"). Through counts rels of relType/dir out of each filtered source instead
of counting nodes, grouping additionally by the neighbor (field
"neighbor"); Total still counts source nodes.
func (*Aggregation).Bin(column string, bounds ...int64) *Aggregation
func (*Aggregation).By(column string) *Aggregation
func (*Aggregation).ByLabel() *Aggregation
func (*Aggregation).ByLabelMembership(label string) *Aggregation
func (*Aggregation).Filter(column string, op AggOp, value int64) *Aggregation
func (*Aggregation).FilterVia(projection []NodeID, column string, allowed ...Value) *Aggregation
func (*Aggregation).Having(column string, op AggOp, value int64) *Aggregation
func (*Aggregation).Hop(relType string, dir Direction) *Aggregation
func (*Aggregation).OnlyNeighbors(ids ...NodeID) *Aggregation
func (*Aggregation).RequirePresent(column string) *Aggregation
func (*Aggregation).Sum(column string) *Aggregation
func (*Aggregation).TemporalComponent(column string, unit TemporalUnit) *Aggregation
func (*Aggregation).Through(relType string, dir Direction) *Aggregation
func (*Snapshot).Aggregate(labels ...string) *Aggregation
AggResult is the outcome of Run. Fields names each key position: "label", a column name, or
"{col}_bin" / "{col}_{unit}" / "neighbor" / "endpoint". Rows holds one AggRow per group, unordered. Total counts rows passing the population (Filter) predicates.
func (*Aggregation).Run() (*AggResult, error)
AggRow is one output group: the key values in field order (the source
label as its index when grouping by label), the row count, and the
summed value. Sum is nil exactly when the group's true total lies
outside int64 range (the accumulator is 128-bit, so the verdict depends
on the total alone, never on how work was partitioned); a query without
a Sum column reports 0, not nil.Countuint64Key[]int64Sum*int64
Atoms is the immutable interned-string table of a snapshot: id -> string
with an O(1) reverse index. Atom 0 is always the empty string (the RCPG
convention: labels, rel types, property keys, and string property values
are all atom ids, and dense string columns encode missing as atom 0). ID returns the atom id for a string; ok is false when never interned. Len is the number of atoms. Resolve returns the string for an atom id; ok is false when out of range. Strings exposes the id-ordered table (for serialization). Callers must
not mutate it.
func NewAtoms(strings []string) *Atoms
func (*Interner).Atoms() *Atoms
func (*Snapshot).Atoms() *Atoms
BoolCol is a resolved boolean column reader. Bits is the dense bit vector indexed directly by position; ok is false
for a sparse column. Get returns the value at pos; ok is false when absent.
func Col.Bool() BoolCol
Builder stages a graph for finalization. AddNode adds a node with an auto-generated sequential id. AddNodeWithID adds (or re-labels) the node with the given id; callers map
their own identifiers onto the u32 space. AddRel adds a relationship from u to v, returning its rel index (usable
with SetRelPropAt). Endpoints are registered as known nodes. Finalize consumes the builder into an immutable Snapshot; the builder
must not be used afterwards. indexProperties optionally names property
keys whose (label, key) equality indexes are built upfront (faster first
queries, more memory); all others build lazily on first access.
A builder thawed from a snapshot rebuilds only the components it dirtied
and shares the rest with its source (cow.go), so a property-only edit skips
the O(m) CSR rebuild and every untouched column, and the source's lazy
caches carry forward. InternPropertyKey interns a property-key name (or any string) and returns
its atom, for reuse with SetPropByKey across many rows. NeighborIDs lists node's staged neighbors in direction (outgoing then
incoming for Both), skipping removed rels -- an O(rels) pre-finalization
scan. NodeCount is the number of distinct nodes staged so far. NodeLabels lists node's staged labels in insertion order. NodesWithProperty lists the label-carrying nodes whose staged property
key equals value, in staging order -- an O(pairs) pre-finalization scan.
A string value never interned in this builder can't be on any node, so
the probe returns empty WITHOUT interning it (reads must not grow the
atom table). Prop reads node's staged value for key -- an O(pairs) pre-finalization
probe that never interns (a string value never interned can't be staged
anywhere). Returns the FIRST staged write, matching the Rust builder. RelCount is the number of live relationships staged so far (tombstoned
rels and pending detach-delete cascades excluded). RemoveNode detach-deletes node: its labels and staged properties go
immediately, and every currently staged incident rel (with its rel
properties) dies at Finalize. Reports whether the node was known.
Ids retire rather than reuse -- nextNodeID never rewinds -- but removal is
not a permanent tombstone: any later staging touch (AddNodeWithID,
SetProp, or being an AddRel endpoint) resurrects the id as a fresh
unlabeled, propertyless node. Rels staged before the removal stay dead
either way; only rels added after the resurrection survive. RemoveProp deletes node's staged property key, sweeping every staged
occurrence across all four typed columns (duplicate staged writes and
cross-type stagings all go -- a partial sweep would resurrect a stale
value at Finalize). Reports whether anything was removed; false covers
every kind of miss uniformly (a key never staged anywhere, or staged but
not on this node -- either way no staged pair existed for (node, key)). RemoveRel tombstones the rel at relIdx (as returned by AddRel). The
staging array is never compacted -- swap-removal would invalidate every
handed-out rel index and the staged rel-prop ids -- so the rel is marked
removed, degrees adjust immediately, and Finalize compacts in one pass.
Removing a rel that is out of range, already removed, or dead via a
detach-deleted endpoint is ErrRelNotFound (no removed bool: a live
handle always removes, so removal happened exactly when err is nil). RemoveRelProp deletes the staged property key on the first rel matching
(u, v, relType) -- the addressing dual of SetRelProp. For parallel rels,
address the specific rel via RemoveRelPropAt. Reports whether anything
was removed; an unmatched (u, v, relType) address is ErrRelNotFound. RemoveRelPropAt deletes the staged property key on the rel at relIdx (as
returned by AddRel), sweeping every staged occurrence across all four
typed columns. Reports whether anything was removed -- a key with no
staged pair on this rel is (false, nil), distinguishable from a real
removal; a removed or out-of-range rel is ErrRelNotFound. ResolveString resolves an interner atom back to its string (for reading
staged Prop values); ok is false when out of range. SetProp stages a node property of any supported type (string, int,
int32, int64, float64, bool, or Value), auto-typed into the matching
column. The key interns before the value, matching the Rust typed
setters' atom order.
A key should keep one value type graph-wide: the snapshot stores one
column (one dtype) per key, so a key staged under several types across
different nodes keeps only one type's column at Finalize -- the other
types' pairs are discarded, reported by the snapshot's
DroppedCrossTypedStagings (zero on a well-typed graph). Restaging one
node's key under a new type is fine via UpdateProp, which sweeps the
node's old stagings of every type first. SetPropByKey is SetProp with a pre-interned key (see InternPropertyKey). SetRelProp stages a property on the first rel matching (u, v, relType).
For parallel rels (same endpoints and type), address the specific rel by
the index AddRel returned via SetRelPropAt. SetRelPropAt stages a property on the rel at the given index (as returned
by AddRel). SetVersion sets the snapshot-level version string. UpdateProp replaces node's staged value for key rather than staging a
duplicate write, sweeping every prior staged occurrence across all four
typed columns so the newest write wins even when it changes the value's
type (Finalize's per-type column loops would otherwise resolve a
cross-type duplicate by loop order, not write order).
func NewBuilder(capNodes, capRels int) *Builder
func NewBuilderFromSnapshot(g *Snapshot) *Builder
Col is a resolved property column, narrowed to a typed reader with I64 /
F64 / Bool / Str. Build with Snapshot.Col (node columns, indexed by node
id) or Snapshot.RelCol (rel columns, indexed by outgoing-CSR position). Bool narrows to a typed boolean reader. Column is the raw generic reader. Dtype is the column's logical element type, for picking a typed reader
without narrowing. F64 narrows to a typed float reader. I64 narrows to a typed integer reader; a non-integer column reads back as
absent, like a mistyped Prop. Str narrows to a typed string reader exposing interned atom ids; resolve
a comparison string to its atom once and compare ids.
func (*Snapshot).Col(key string) (Col, bool)
func (*Snapshot).ColIndexed(key string) (Col, bool)
func (*Snapshot).RelCol(key string) (Col, bool)
func (*Snapshot).RelColIndexed(key string) (Col, bool)
Column is one property column's storage. Get reads the value at a
position; Entries iterates every (position, value) present, ascending.
Concrete representations are internal -- read through Get/Entries or the
typed Col readers. Dtype is the column's logical element type. Entries iterates (position, value) pairs in ascending position order. Get returns the value at pos; ok is false when absent. Len is the number of positions carrying a value.
func Col.Column() Column
F64Col is a resolved float column reader. Get returns the value at pos; ok is false when absent. Slice is the dense value slice; ok is false for a sparse column. SliceRange is I64Col.SliceRange for float columns.
func Col.F64() F64Col
FullTextField is the inverted index for a single (label, property) text
field. Build directly or query through Snapshot.FullTextSearch, which
builds and caches per field lazily. DocCount is the number of indexed documents (nodes with non-empty text). Query returns the nodes whose text contains EVERY token in query
(boolean AND). An empty query, or any token absent from the field,
yields the empty set. QueryRanked returns the top k nodes by BM25 relevance (disjunctive: a
node scores for every query token it contains), sorted by score
descending, ties by ascending node id. TermCount is the number of distinct indexed tokens.
func BuildFullTextField(docs func(yield func(node uint32, text string) bool)) *FullTextField
GeoIndex is the immutable index for one (label, latKey, lonKey) field. KNN returns up to k nearest nodes to (lat, lon), sorted by increasing
distance, ties by ascending node id. Len is the number of indexed points. WithinBBox returns the nodes inside the lat/lon rectangle; minLon >
maxLon treats the box as crossing the antimeridian. WithinRadius returns the nodes within km great-circle distance of
(lat, lon).
func BuildGeoIndex(points func(yield func(node uint32, lat, lon float64) bool)) *GeoIndex
I64Col is a resolved integer column reader. Get returns the value at pos (a node id for node columns, a CSR position
for rel columns); ok is false when absent. GetMany reads the values at ids into vals with a presence mask -- the
bulk form of Get for candidate-batch sweeps: the representation switch
and the receiver hoist out of the loop, so a chunk pays one dispatch
instead of a call chain per id. vals and present must be at least
len(ids) long. Slice is the dense value slice indexed directly by position; ok is false
for a sparse column (fall back to Get). SliceRange is the dense-speed window of a column whose presence is one
contiguous position run: values read as vals[pos-start], and a
position outside [start, start+len) is absent. LDBC-shaped loaders
assign each label a contiguous id block, so a label-scoped column
stored sparse still reads at hoisted-slice speed through its window
(the rcp twin's as_i64_slice_range, tasks rcp-265/072; a sparse
column's pair array is position-sorted, so contiguous presence makes
the value array itself the window -- the check is O(1) and nothing is
built). ok=false for gapped presence or a non-integer column.
func Col.I64() I64Col
Interner is the build-side, thread-safe string interner (the Rust side
uses lasso). The empty string is pre-interned as atom 0, upholding the
RCPG convention from the start. Atoms snapshots the interner into an immutable table. Get returns s's atom id without interning; ok is false when unknown. GetOrIntern returns s's atom id, interning it if new. Len is the number of interned strings (including atom 0). Resolve returns the string for an atom id; ok is false when out of range.
func NewInterner() *Interner
Label is an interned node-label atom. Resolve text via the snapshot. ID is the raw atom id.
func (*Snapshot).Label(name string) (Label, bool)
Manager holds named immutable snapshots. AddSnapshot registers g under its own version string, or LatestVersion
when it has none, replacing any previous snapshot under that key. AddSnapshotWithVersion registers g under an explicit version key. Clear drops every registered snapshot. Len is the number of registered snapshots. RemoveSnapshot drops the snapshot under version, reporting whether one
was present. Snapshot returns the snapshot registered under version; ok is false when
absent. Versions lists the registered version keys (unordered).
func NewManager() *Manager
NeighborGroups is built by Snapshot.NeighborGroups; chain Project, then
call a terminal. Project maps each neighbor to its group node via a chain of
first-neighbor steps (like Follow). Without a projection, neighbors
group by their own id (every cohort is 1). Sizes is the raw reduction: per source, the size of its largest cohort.
Sources with no projectable neighbors yield 0; an unknown rel type or
projection type yields all-zero sizes. Runs in parallel over the
sources; output order follows the input sources. TopBySize is the n sources with the largest cohorts, size descending.
Ties break by the tieKey node property (read as i64, ascending) when
non-empty, else by source id ascending -- always deterministic.
func (*NeighborGroups).Project(steps ...Step) *NeighborGroups
func (*Snapshot).NeighborGroups(sources []NodeID, m RelMatch, dir Direction) *NeighborGroups
Prop is a property read result. The zero value reads as absent: every
accessor returns not-ok / its default. Bool returns the boolean value; ok is false when absent or not a boolean. BoolOr returns the boolean value, or def when absent or not a boolean. F64 returns the float value; ok is false when absent or not a float. F64Or returns the float value, or def when absent or not a float. I64 returns the integer value; ok is false when absent or not an integer. I64Or returns the integer value, or def when absent or not an integer. Str returns the string value; ok is false when absent, not a string, or
empty (dense string columns store a missing value as "", so the empty
check callers would otherwise repeat is folded in). StrOr returns the string value, or def when absent / not a string / empty. Value returns the raw value; ok is false when the property is absent.
func (*Snapshot).Prop(node NodeID, key string) Prop
func (*Snapshot).RelProp(pos uint32, key string) Prop
PropagateOpts parameterizes PropagateBFS. The zero value is not useful:
set RelTypes (empty matches no rels), Direction, MaxDepth, and ValueProp. Desc orders each expansion's eligible rels by ValueProp descending
instead of ascending. Ties keep adjacency order (stable). Direction of expansion from each claimed node.FilterMaxint64FilterMinint64 FilterProp, when non-empty, names an integer rel property that must
be present and within [FilterMin, FilterMax] for a rel to be
eligible at all. MaxDepth bounds the traversal: seeds sit at depth 1 and nodes expand
while their depth is below MaxDepth (values below 1 mean seeds only). MinValue is an exclusive lower bound on a claiming rel's carried
value; the default 0 propagates only positive values. Pass -Inf to
disable. RelTypes is the fan-out union of relationship types. TruncLimit caps each expansion's ordered rels (0 = no cap). ValueProp is the float rel property a claiming rel carries to the
node it claims (absent values read as 0).
func (*Snapshot).PropagateBFS(seeds []PropagateSeed, opts PropagateOpts) []PropagateResult
RangeIndex is a sorted view of an i64 node property column: Window
answers value intervals with a zero-copy slice of node ids. The zero
value is an empty index. Len is the number of indexed entries (nodes carrying the key). Window is the node ids whose value lies in the interval [lo, hi] with
per-bound inclusivity, as a zero-copy slice ordered by (value, id).
Pass math.MinInt64/math.MaxInt64 with inclusive bounds for a half- or
unbounded interval. An empty or inverted interval is an empty slice.
func (*Snapshot).ColRangeIndex(key string) (RangeIndex, bool)
RelRef is one relationship incident to a queried node, as yielded by
Snapshot.Rels. It carries the other endpoint, the type, the direction
relative to the queried node, and the CSR position for reading the rel's
properties via Snapshot.RelProp -- valid in BOTH directions (an incoming
rel's position is pre-mapped to where the property is stored).DirectionDirectionNeighborNodeIDPosuint32TypeRelType
RelStats is the per-type relationship statistics entry: total count and
the distinct source/target node counts -- the degree facts a cost-based
planner needs. Count is the total rels of this type. InSources is the distinct nodes that are the target of such a rel
(the source when traversed incoming). OutSources is the distinct nodes that are the source of such a rel.
func (*Snapshot).RelTypeStats(relType string) (RelStats, bool)
ShortestPaths is the result of a Dijkstra search: the shortest distance
to every reached node, with predecessors for path reconstruction. Small
searches keep map state; a search that settles a large set switches to
dense id-space arrays mid-run (see densify), so point queries stay
cheap while component-scale searches avoid per-edge map probes. Distance is the shortest distance from the source to node; ok is false
when unreached. Distances is every reached node with its shortest distance (the source
itself at 0). The returned map is the result's own -- callers must not
mutate it while still using PathTo. PathTo is the shortest path from the source to target as a node sequence
(source first); ok is false when target was unreached. Reached reports whether node was reached from the source.
func (*Snapshot).Dijkstra(source NodeID, dir Direction, m RelMatch, weight WeightFn) *ShortestPaths
func (*Snapshot).DijkstraTo(source, target NodeID, dir Direction, m RelMatch, weight WeightFn) *ShortestPaths
StrCol is a resolved string column reader exposing interned atom ids. ID returns the atom id at pos; ok is false when absent. Note atom 0 ("")
in a dense column means missing -- Prop.Str folds that in; this raw
reader does not. IDs is the dense atom-id slice; ok is false for a sparse column.
func Col.Str() StrCol
Value is a property value: the Go port of the Rust ValueId tagged union.
It is comparable -- usable as a map key with == -- with the same equality
semantics as the Rust derive: strings compare by atom id and floats by
IEEE-754 bit pattern (so NaN == NaN when the payloads match, and
0.0 != -0.0). Bool returns the boolean value; ok is false for other kinds. F64 returns the float value; ok is false for other kinds. I64 returns the integer value; ok is false for other kinds. Kind reports the value's discriminant. StrID returns the interned-string atom id; ok is false for other kinds.
func BoolValue(v bool) Value
func F64Value(v float64) Value
func I64Value(v int64) Value
func StrValue(atom uint32) Value
func (*Builder).Prop(node NodeID, key string) (Value, bool)
func Column.Get(pos uint32) (Value, bool)
func Prop.Value() (Value, bool)
func (*Snapshot).ValueFromString(s string) (Value, bool)
func (*Aggregation).FilterVia(projection []NodeID, column string, allowed ...Value) *Aggregation
func (*Snapshot).NodesWithValue(label, key string, v Value) (*nodeset.Set, bool)
BuildGeoIndex builds from (node, latDeg, lonDeg) points; non-finite or
out-of-range coordinates are skipped.
CoCount weights by the number of shared centers (co-occurrence events).
CoDistinct weights by the number of distinct values of the property key
read off each shared center (e.g. distinct co-occurrence days); a center
lacking the key contributes nothing.
F64Value is a float value, stored by bit pattern.
FromGraphSection builds a snapshot from the on-disk data model. The
section's slices and bitmaps are taken over; the caller must not reuse
them.
HaversineKM is the great-circle distance in kilometres between two
lat/lon points -- a public utility independent of the index.
I64Value is an integer value.
MatchAll matches every relationship type.
MatchNone matches no relationship type.
MatchType matches a single pre-resolved type, allocation-free.
NewAtoms builds the table from an id-ordered string slice. When the slice
contains duplicates, the smallest id wins reverse lookups.
NewBuilder returns a builder with capacity hints (0 = the 2^20 default);
the builder auto-grows past them.
NewBuilderFromSnapshot thaws g back into a Builder whose Finalize
reproduces g -- a no-edit thaw -> Finalize -> WriteRCPG round trip is
byte-identical for any snapshot Finalize itself can produce. Atom ids are
preserved exactly (the interner is seeded from g's atom table), so labels,
rel types, property keys, and string values stay valid across the thaw.
Two lossy corners are inherited from the snapshot representation itself:
- Dense columns cannot distinguish "never set" from the zero value, so
the thaw stages a pair for every position of a dense column (including
atom-0 positions of a dense string column, mirroring the read layer,
which reports those as present ""). Since tasks/041 Go only finalizes
numeric/bool columns dense at full coverage, so this zero-fill
materialization arises for those dtypes only when thawing a legacy or
Rust-written file whose dense column was written at partial fill --
the missingness was destroyed at that write, and refinalize keeps the
zero-filled positions as genuine (staged) values.
- Ghost nodes -- isolated, unlabeled, propertyless -- leave no
identifiable trace. Known nodes rebuild from labels, rel endpoints,
and column positions; ghosts outside that union are lost (their count
no longer contributes to NodeCount), and dense-column positions inside
it may register ids the original builder never saw.
NewInterner returns an interner holding only atom 0 = "".
NewManager returns an empty registry.
Type Parameters:
T: any ParNeighborFold folds node's typed neighbors in parallel, merging the
per-chunk results -- NeighborsMatch composed with a parallel fold. Use
when each neighbor drives substantial independent work; for light
per-neighbor work iterate sequentially. The reduce runs in ascending
chunk order, so the result is deterministic for any associative reduce.
ParseAggOp parses a comparison symbol (<, <=, >, >=, ==, !=).
ReadNQuads builds a Snapshot from an N-Quads or N-Triples document
using the read mapping documented at the top of this file. Gzipped
input (the 1f 8b magic) is decompressed transparently.
ReadNQuadsFile reads an N-Quads/N-Triples file (transparently
gunzipping) into a Snapshot via ReadNQuads.
ReadRCPG reads a snapshot from RCPG bytes. Lazy indexes rebuild on first
use.
ReadRCPGFile reads a snapshot from an RCPG file on disk.
StrValue is an interned-string value holding an atom id.
Tokenize splits text into lowercased alphanumeric runs -- the shared
tokenizer of the build and query paths.
Package-Level Variables (total 4)
ErrBadValue reports a property value of an unsupported type.
ErrCapacity reports exceeding the u32 node/rel ceiling.
ErrRelNotFound reports a rel-property set on a (u, v, type) that was
never added.
ErrSchema reports an aggregation over an unknown column/label, a
mistyped column, or an unsupported option combination.
Package-Level Constants (total 26)
Both follows rels in either direction.
DtypeBool is a boolean column.
DtypeF64 is a float column.
DtypeI64 is an integer column.
DtypeStr is an interned-string column.
Incoming follows rels from destination to source.
KindBool is a boolean value.
KindF64 is a float value, stored by bit pattern.
KindI64 is an integer value.
KindStr is an interned-string value (the payload is an atom id).
LatestVersion is the registry key AddSnapshot uses for a snapshot that
carries no version string.
NoMaxDepth removes the depth bound of a search.
NoNeighbor is the sentinel a NeighborVia array holds for a node with no
such neighbor.
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.