尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
“We need to abolish names and places, and replace them with hashes.”
— Joe Armstrong, The Mess We’re In
TribleSpace is an embedded knowledge graph built from immutable facts,
content-addressed blobs, and grow-only collections. It combines the
queryability of a database with the distribution semantics of a join
semilattice, in one append-only file or an S3-compatible endpoint.查看完整 README ↗
“We need to abolish names and places, and replace them with hashes.” — Joe Armstrong, The Mess We’re In
TribleSpace is an embedded knowledge graph built from immutable facts, content-addressed blobs, and grow-only collections. It combines the queryability of a database with the distribution semantics of a join semilattice, in one append-only file or an S3-compatible endpoint.
TribleSpace is designed from first principles around simple algebra rather than mutable database machinery. Independent writers publish signed collection members; replicas combine evidence by set union; reproducible indexes and rollups are ordinary merge and derivation equations. No mutable branch head, compare-and-swap retry loop, or query planner is required.
Add the crate to a project:
cargo add triblespace ed25519-dalek rand
The example below publishes one self-contained Fragment, freezes one coherent
store snapshot, and queries an admitted collection cover. entity! derives the
author and book identifiers from their contents and carries the text
blobs with the facts that reference them.
use ed25519_dalek::SigningKey;
use rand::rngs::OsRng;
use triblespace::core::collection::{AdmissionPolicy, CollectionPolicy};
use triblespace::prelude::*;
mod literature {
use triblespace::prelude::*;
use triblespace::prelude::blobencodings::UTF8String;
use triblespace::prelude::inlineencodings::{GenId, Handle};
attributes! {
/// The title of a work.
"A74AA63539354CDA47F387A4C3A8D54C" as pub title: Handle<UTF8String>;
/// A quote from a work.
"6A03BAF6CFB822F04DA164ADAAEB53F6" as pub quote: Handle<UTF8String>;
/// The author of a work.
"8F180883F9FD5F787E9E0AF0DF5866B9" as pub author: GenId;
/// The first name of an author.
"0DBB530B37B966D137C50B943700EDB2" as pub firstname: Handle<UTF8String>;
/// The last name of an author.
"6BAA463FD4EAF45F6A103DB9433E4545" as pub lastname: Handle<UTF8String>;
}
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
let key = SigningKey::generate(&mut OsRng);
let mut storage = MemoryRepo::default();
let root = key.verifying_key();
let library = storage.collection(
"library",
CollectionPolicy::new(
AdmissionPolicy::direct(root),
AdmissionPolicy::direct(root),
),
)?;
let author = entity! {
literature::firstname: "Frank",
literature::lastname: "Herbert",
};
let author_id = author.root().expect("intrinsic author id");
let book = entity! {
literature::title: "Dune",
literature::author: &author_id,
literature::quote: "I must not fear. Fear is the mind-killer.",
};
let mut import = author;
import += book;
storage.commit(library, &key, import)?;
let snapshot = storage.snapshot()?;
let facts: TribleSet = library.read(&snapshot)?;
let title = "Dune";
for (first, last, quote) in find!(
(first, last, quote),
pattern!(&facts, [
{ _?author @
literature::firstname: ?first,
literature::lastname: ?last
},
{ _?book @
literature::title: title,
literature::author: _?author,
literature::quote: ?quote
}
])
) {
let first: View<str> = snapshot.get(first)?;
let last: View<str> = snapshot.get(last)?;
let quote: View<str> = snapshot.get(quote)?;
println!(
"'{}'\n - from {title} by {} {}.",
quote.as_ref(),
first.as_ref(),
last.as_ref()
);
}
Ok(())
}
The descriptor's independent READ and WRITE policies participate in collection
identity. Here both are one-root policies. Whether a recipient may extend its
authority is described by the independent delegation-action facts in the
capability definitions signed into its proof prefix, not by a second
collection-policy threshold. Each child may invoke or delegate only actions
its parent permits delegating; the definition handles may differ.
Other strictly verified signers become visible only when
library.admitted(&snapshot) observes sufficient root support for exact
ACTION_WRITE on this descriptor handle through resident proof and definition
evidence. Collection WRITE authority has no wall-clock expiry.
Identical retries deduplicate by intrinsic record identity, distinct commits
coexist, and library.read(&snapshot) reads the union of every admitted
author's commits through the same snapshot. Call
the store's flush operation when an application needs an explicit durability
barrier.
The Getting Started
chapter breaks the example down, while Collection
Workflows
explains descriptors, exact covers, COMMIT/MERGE/DERIVE, and lazy
derived representations.
The Tribles Book is the best place to go deeper:
To build the book locally: cargo install mdbook && ./scripts/build_book.sh
For development setup, see Contributing.
Questions or ideas? Join the Discord.
Licensed under either of
at your option.