pub struct Definition {
pub kind: String,
pub name: String,
pub edges: Vec<(String, EdgeTarget)>,
pub axioms: Vec<String>,
pub lexical: Option<String>,
}Expand description
The canonical definition of a node — the structure its content-address is
taken over. Field order is the serialized order; the edges/axioms rows
are sorted + deduplicated by Definition::address before encoding, so the
address does not depend on assembly order.
Fields§
§kind: StringThe node’s kind — a name resolved against the meta-ontology
(e.g. "Concept", "Functor", "Lens").
name: StringThe node’s name within its ontology.
edges: Vec<(String, EdgeTarget)>Outgoing typed edges, each (relation-kind name, target). The target is
usually EdgeTarget::Local (a name in this ontology); a
EdgeTarget::Grounded target crosses into a connected ontology by
content address. An all-local node’s encoding — hence its address — is
unchanged from when targets were bare strings.
axioms: Vec<String>Names of the axioms that constrain this node.
lexical: Option<String>The node’s lexical grounding (canonical English form / Lemon entry), if any — part of the definition because in praxis “everything is Lemon”.
Implementations§
Source§impl Definition
impl Definition
Sourcepub fn address(&self) -> Result<ContentAddress, CodecError>
pub fn address(&self) -> Result<ContentAddress, CodecError>
The content address of this node — its definition-bearing identity.
Canonical: the edges and axioms rows are sorted + deduplicated before
the DAG-CBOR encoding, so two definitions with the same content assembled
in different orders share the same address.
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
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 Definition
impl Debug for Definition
Source§impl<'de> Deserialize<'de> for Definition
impl<'de> Deserialize<'de> for Definition
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>,
impl Eq for Definition
Source§impl PartialEq for Definition
impl PartialEq for Definition
Source§fn eq(&self, other: &Definition) -> bool
fn eq(&self, other: &Definition) -> bool
self and other values to be equal, and is used by ==.