pub struct EntityType {
pub name: String,
pub description: Option<String>,
pub base: Option<String>,
pub traits: Vec<String>,
pub subtype_of: Vec<String>,
pub aliases: Vec<String>,
pub exemplars: Vec<String>,
pub negative_examples: Vec<String>,
pub schema: Value,
}Expand description
One entity type an ontology declares ($defs/entityType in
ontology.schema.json).
Fields§
§name: StringThe entity type’s name (^[a-z][a-z0-9-]*$).
description: Option<String>Human-readable description — the primary positive embedding signal.
base: Option<String>Base memory type (semantic/episodic/procedural). Optional here
(tolerant parse); the schema requires it for a conformant document.
traits: Vec<String>Traits this entity type includes.
subtype_of: Vec<String>Parent entity types this type specializes (subsumption).
aliases: Vec<String>Synonyms and label variations (skos:altLabel analog), distinct
from description. Part of the positive embedding document.
exemplars: Vec<String>Curated canonical example phrases or instances (skos:example
analog; 2-5 recommended). Part of the positive embedding document.
negative_examples: Vec<String>Curated near-misses from the ontology’s most confusable type pairs:
texts that resemble this type but do NOT denote it. Never part of
the positive embedding document (see EntityType::embedding_doc);
consumed by the negative-demotion-v1 gate
(crate::confidence::negative_demotes): a candidate whose query
sits at least as close to one of these as to the type’s positive
document is barred from auto-classify eligibility. Types carrying
none score exactly as before the gate existed.
schema: ValueThe {required, properties} shape a finding’s entity payload is
validated against.
Implementations§
Source§impl EntityType
impl EntityType
Sourcepub fn embedding_doc(&self) -> Option<String>
pub fn embedding_doc(&self) -> Option<String>
Composes the positive embedding document for this entity type:
description, then each alias, then each exemplar, newline-joined
in that deterministic order, skipping empty strings.
Returns None when no non-empty signal exists — callers skip such
types rather than embedding an empty document (generalizing the
previous skip-when-no-description behavior).
negative_examples is deliberately excluded: it asserts what this
type is not, and concatenating it into the positive document would
poison the type’s own embedding.
Trait Implementations§
Source§impl Clone for EntityType
impl Clone for EntityType
Source§fn clone(&self) -> EntityType
fn clone(&self) -> EntityType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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<EntityType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EntityType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for EntityType
Source§impl PartialEq for EntityType
impl PartialEq 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more