尚未偵測到更新。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.