pub struct GraphNode {
pub id: String,
pub label: String,
pub node_type: NodeType,
pub attributes: HashMap<String, Value>,
pub embedding: Option<Embedding>,
pub source_documents: HashSet<String>,
pub confidence: f32,
pub pagerank_score: Option<f32>,
pub created_at: DateTime<Utc>,
}Expand description
Graph node representing entities and concepts
Fields§
§id: StringUnique node identifier
label: StringNode label/name
node_type: NodeTypeNode type
attributes: HashMap<String, Value>Node attributes
embedding: Option<Embedding>Associated embedding for semantic operations
source_documents: HashSet<String>Source document references
confidence: f32Node confidence score
pagerank_score: Option<f32>PageRank score
created_at: DateTime<Utc>Creation timestamp
Implementations§
Source§impl GraphNode
impl GraphNode
Sourcepub fn with_id(
id: impl Into<String>,
label: impl Into<String>,
node_type: NodeType,
) -> Self
pub fn with_id( id: impl Into<String>, label: impl Into<String>, node_type: NodeType, ) -> Self
Create node with specific ID
Sourcepub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
pub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
Add attribute using builder pattern
Sourcepub fn with_embedding(self, embedding: Embedding) -> Self
pub fn with_embedding(self, embedding: Embedding) -> Self
Set embedding
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
Set confidence score
Sourcepub fn with_source_document(self, document_id: impl Into<String>) -> Self
pub fn with_source_document(self, document_id: impl Into<String>) -> Self
Add source document
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GraphNode
impl<'de> Deserialize<'de> for GraphNode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GraphNode
impl RefUnwindSafe for GraphNode
impl Send for GraphNode
impl Sync for GraphNode
impl Unpin for GraphNode
impl UnwindSafe for GraphNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more