pub struct EdgeType {
pub base: DataPoint,
pub relationship_name: String,
pub number_of_edges: i32,
}Expand description
Storage-layer edge type model.
Represents a type of relationship between entities (e.g., “works_at”, “located_in”, “knows”). Used for indexing and semantic search of relationship types.
Fields§
§base: DataPointBase data point fields (id, timestamps, metadata, etc.)
relationship_name: StringRelationship name (e.g., “works_at”, “located_in”)
number_of_edges: i32Number of edges of this type (for statistics)
Implementations§
Source§impl EdgeType
impl EdgeType
Sourcepub const INDEX_FIELDS: &'static [&'static str]
pub const INDEX_FIELDS: &'static [&'static str]
Index fields to embed for vector search.
Sourcepub fn deterministic_id(relationship_name: &str) -> Uuid
pub fn deterministic_id(relationship_name: &str) -> Uuid
Compute a deterministic UUID for an EdgeType from its relationship name.
Mirrors Python’s generate_edge_id(edge_id=text):
uuid5(NAMESPACE_OID, text.lower().replace(" ", "_").replace("'", ""))
Sourcepub fn new(
relationship_name: impl Into<String>,
dataset_id: Option<Uuid>,
) -> Self
pub fn new( relationship_name: impl Into<String>, dataset_id: Option<Uuid>, ) -> Self
Create a new EdgeType with a random UUID.
§Arguments
relationship_name- Relationship name (e.g., “works_at”)dataset_id- Dataset UUID
Sourcepub fn new_deterministic(
relationship_name: impl Into<String>,
dataset_id: Option<Uuid>,
) -> Self
pub fn new_deterministic( relationship_name: impl Into<String>, dataset_id: Option<Uuid>, ) -> Self
Create a new EdgeType with a deterministic UUID derived from the
relationship name, matching Python’s generate_edge_id.
§Arguments
relationship_name- Relationship name (e.g., “works_at”)dataset_id- Dataset UUID
Sourcepub fn get_embeddable_text(&self) -> String
pub fn get_embeddable_text(&self) -> String
Get the relationship name (for embedding).
Sourcepub fn increment_count(&mut self)
pub fn increment_count(&mut self)
Increment the edge count.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EdgeType
impl<'de> Deserialize<'de> for EdgeType
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>,
Source§impl HasDataPoint for EdgeType
impl HasDataPoint for EdgeType
Source§fn data_point(&self) -> &DataPoint
fn data_point(&self) -> &DataPoint
DataPoint of this container.Source§fn data_point_mut(&mut self) -> &mut DataPoint
fn data_point_mut(&mut self) -> &mut DataPoint
DataPoint of this container.Source§fn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
fn for_each_child_mut(&mut self, _visit: &mut dyn FnMut(&mut dyn HasDataPoint))
HasDataPoint.
Default: no children. Override on container types whose fields
own (rather than reference by Uuid) another HasDataPoint.