pub struct EntityType {
pub base: DataPoint,
pub name: String,
pub description: String,
}Expand description
Storage-layer entity type model.
Represents a category of entities (e.g., “Organization”, “Person”, “Location”).
Entity instances reference their EntityType via the is_a field.
Fields§
§base: DataPointBase data point fields (id, timestamps, metadata, etc.)
name: StringType name (e.g., “Organization”, “Person”, “Location”)
description: StringType description
Implementations§
Source§impl EntityType
impl EntityType
Sourcepub const INDEX_FIELDS: &'static [&'static str]
pub const INDEX_FIELDS: &'static [&'static str]
Index fields to embed for vector search.
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
dataset_id: Option<Uuid>,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, dataset_id: Option<Uuid>, ) -> Self
Create a new EntityType.
§Arguments
name- Type name (e.g., “Organization”)description- Type descriptiondataset_id- Dataset UUID
Sourcepub fn from_node_type(
type_name: impl Into<String>,
dataset_id: Option<Uuid>,
) -> Self
pub fn from_node_type( type_name: impl Into<String>, dataset_id: Option<Uuid>, ) -> Self
Create EntityType from LLM-extracted node type string.
§Arguments
type_name- Node type from LLM (e.g., “Organization”)dataset_id- Dataset UUID
Sourcepub fn get_embeddable_text(&self) -> String
pub fn get_embeddable_text(&self) -> String
Get the type name (for embedding).
Sourcepub fn set_description(&mut self, description: impl Into<String>)
pub fn set_description(&mut self, description: impl Into<String>)
Update type description.
Sourcepub fn is_ontology_valid(&self) -> bool
pub fn is_ontology_valid(&self) -> bool
Check if this type has been validated against an ontology.
Sourcepub fn mark_ontology_valid(&mut self, canonical_name: Option<String>)
pub fn mark_ontology_valid(&mut self, canonical_name: Option<String>)
Mark as ontology-validated with canonical name.
§Arguments
canonical_name- Canonical name from ontology
Trait Implementations§
Source§impl Clone for EntityType
impl Clone for EntityType
Source§fn clone(&self) -> EntityType
fn clone(&self) -> EntityType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntityType
impl Debug for EntityType
Source§impl<'de> Deserialize<'de> for EntityType
impl<'de> Deserialize<'de> for EntityType
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
Source§impl HasDataPoint for EntityType
impl HasDataPoint for EntityType
Source§fn data_point(&self) -> &DataPoint
fn data_point(&self) -> &DataPoint
Borrow the embedded
DataPoint of this container.Source§fn data_point_mut(&mut self) -> &mut DataPoint
fn data_point_mut(&mut self) -> &mut DataPoint
Mutably borrow the embedded
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))
Visit every owned child that itself implements
HasDataPoint.
Default: no children. Override on container types whose fields
own (rather than reference by Uuid) another HasDataPoint.Source§impl PartialEq for EntityType
impl PartialEq for EntityType
Source§fn eq(&self, other: &EntityType) -> bool
fn eq(&self, other: &EntityType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EntityType
impl Serialize for EntityType
impl StructuralPartialEq for EntityType
Auto Trait Implementations§
impl Freeze for EntityType
impl RefUnwindSafe for EntityType
impl Send for EntityType
impl Sync for EntityType
impl Unpin for EntityType
impl UnsafeUnpin for EntityType
impl UnwindSafe for EntityType
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