diff --git a/src/database/constants.rs b/src/database/constants.rs index 8baae01..08cd6d7 100644 --- a/src/database/constants.rs +++ b/src/database/constants.rs @@ -1,15 +1,24 @@ use crate::addressing::Address; use crate::database::entry::InvariantEntry; +/// Attribute denoting (hierarchical) relation, in the upwards direction. For example, a file `OF` a group, an image `OF` photos, etc. pub const IS_OF_ATTR: &str = "OF"; +/// Attribute denoting that an entry belongs to the set relating to a given (hierarchical) relation. +/// For example, a data blob may have a label entry, and to qualify that label within the context of belonging to a given hierarchical group, that label entry and the hierarchical entry will be linked with `BY`. pub const ATTR_BY_ATTR: &str = "BY"; +/// Attribute denoting a human readable label. pub const LABEL_ATTR: &str = "LBL"; +/// Attribute denoting the date & time an entity was noted in the database. +/// (TODO: This info can be trivially derived from existing entry timestamps, while at the same time the "Introduction problem" is still open.) pub const ADDED_ATTR: &str = "ADDED"; +/// Attribute for cross-vault unambiguous referencing of non-hashable (e.g. UUID) entities. +pub const KEY_ATTR: &str = "KEY"; + lazy_static! { pub static ref HIER_ROOT_INVARIANT: InvariantEntry = InvariantEntry { - attribute: String::from(IS_OF_ATTR), + attribute: String::from(KEY_ATTR), value: "HIER_ROOT".into(), }; pub static ref HIER_ROOT_ADDR: Address = HIER_ROOT_INVARIANT.entity().unwrap();