diff --git a/database.md b/database.md index 5990988..16c50be 100644 --- a/database.md +++ b/database.md @@ -27,13 +27,15 @@ pub struct TextContent { } ``` -We create KnowledgeSource, which we will store +We create KnowledgeSource, which we will store as a node, and its relationship as edges - Add a uuid to we can link the textcontent and files to the knowledge sources? +- Rename id to name, and use it as the id? Id represents the TextContent link, from which several knowledgeentities can be gathered. ``` pub struct KnowledgeSource { - pub id: String, + pub name: String, + pub id: Uuid, pub title: String, pub description: String, pub relationships: Vec, diff --git a/src/models/text_content.rs b/src/models/text_content.rs index 4deaee1..9937a5e 100644 --- a/src/models/text_content.rs +++ b/src/models/text_content.rs @@ -14,10 +14,20 @@ pub struct TextContent { pub category: String, } +/// Represents a generic knowledge entity in the graph. +#[derive(Debug, Serialize, Deserialize, Clone)] +pub struct KnowledgeEntity { + pub id: Uuid, + pub name: String, + pub description: String, + pub source_uuid: Uuid, + pub entity_type: String, +} + /// A struct representing a knowledge source in the graph database. #[derive(Deserialize, Debug, Serialize, Clone )] pub struct KnowledgeSource { - pub id: String, + pub id: Uuid, pub title: String, pub description: String, pub relationships: Vec,