Note
The development is on
rust-sketch01 branch.
This document is a WIP collection of ideas and introduces the basic concepts.
At some point the sketch should get squashed and merged here, and effectively
graduate to an actual alpha release.
LifeCore is a typed graph database with basic version-control features, primarily for "personal database"-type applications. Think Obsidian, with a bit more structure but deliberately less flexibility. Additionally, it is aimed to be a shared database between different personal productivity packages; e.g. your notes could link to project management-related nodes, or semantic graph-style concept nodes, or just other notes.
It intends to achieve this by building in a few core rules, and implementing more complicated functionality as "Analyzer" plug-ins.
- Index: All Nodes and Edges have a unique index, and are strictly ordered, which depends on the insertion order.
- Node: Has a
typestring, a map of strings to values ("Payload"), and optionally aparentindex. - Edge: Has a
fromindex,toindex, and atypestring.
Nodes have a very minimal, single-parent VCS mechanism built into them. A node
that has a non-empty parent index is said to override the node referred to
by that index. The "parent" node is considered stale if it has a "child" node.
A node is considered fresh if it is not a parent to any other node.
Note that this mechanism does not forbid multiple nodes from having the same parent. Thus, the history self-organizes into a tree.
Earlier designs had edges as first-class entities that would have additional fields just like nodes. Another design had gotten rid of edges in favor of "connect" lists on the nodes themselves. The current design carries over edges, but said edges are entirely "lightweight". They do not have versions, and do not have additional fields.
All types are specified as strings, and by default, don't do anything. Now, all type-checking is its own "Analyzer". (the ability to just turn it off + dogfooding the Analyzer interface)
- Edge
fromandtomust point to different nodes. - Node
parentmust point to a node, or be empty.
- The set of fresh nodes at any point in time must not contain a duplicate. That is, an exact duplicate (with the same parentage, types, and fields) is only allowed if the original is currently stale.
-
An edge may only connect nodes with an index lower than its index.
-
A node may only have a parent that is older than itself (and thus has a lower index)
This is the core part of the ruleset. A node that is stale cannot form new connections.