triblespace_core/
examples.rs1use crate::prelude::*;
5pub mod literature {
7 #![allow(unused)]
8 use super::*;
9 use crate::prelude::*;
10 use blobschemas::LongString;
11 use valueschemas::Blake3;
12 use valueschemas::GenId;
13 use valueschemas::Handle;
14 use valueschemas::ShortString;
15 use valueschemas::R256;
16
17 attributes! {
18 "A74AA63539354CDA47F387A4C3A8D54C" as pub title: ShortString;
22
23 "6A03BAF6CFB822F04DA164ADAAEB53F6" as pub quote: Handle<Blake3, LongString>;
25
26 "8F180883F9FD5F787E9E0AF0DF5866B9" as pub author: GenId;
28
29 "0DBB530B37B966D137C50B943700EDB2" as pub firstname: ShortString;
31
32 "6BAA463FD4EAF45F6A103DB9433E4545" as pub lastname: ShortString;
34
35 "FCCE870BECA333D059D5CD68C43B98F0" as pub page_count: R256;
37 }
38}
39
40pub fn dataset() -> TribleSet {
42 let mut set = TribleSet::new();
43 let mut blobs = MemoryBlobStore::new();
44 let author_id = ufoid();
45
46 set += entity! { &author_id @
47 literature::firstname: "Frank",
48 literature::lastname: "Herbert",
49 };
50
51 set += entity! {
52 literature::title: "Dune",
53 literature::author: &author_id,
54 literature::quote: blobs
55 .put("Deep in the human unconscious is a pervasive need for a logical universe that makes sense. But the real universe is always one step beyond logic.")
56 .unwrap(),
57 literature::quote: blobs
58 .put("I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past I will turn the inner eye to see its path. Where the fear has gone there will be nothing. Only I will remain.")
59 .unwrap(),
60 };
61
62 set
63}