pub struct Archive {
pub nodes: Vec<Definition>,
pub connections: Vec<Connection>,
}Expand description
A .prx archive: the nodes and connections of one serialized ontology.
Fields§
§nodes: Vec<Definition>The node definitions (concepts, axioms, lenses, …).
connections: Vec<Connection>The connections (morphisms) — functors / adjunctions / lenses / nat-trans.
Implementations§
Source§impl Archive
impl Archive
Sourcepub fn root(&self) -> Result<ContentAddress, CodecError>
pub fn root(&self) -> Result<ContentAddress, CodecError>
The Merkle root — the content address over the sorted, deduplicated set of every node’s and connection’s definition-bearing address.
Source§impl Archive
impl Archive
Sourcepub fn recursive_addresses(
&self,
) -> Result<BTreeMap<String, ContentAddress>, RecursiveAddressError>
pub fn recursive_addresses( &self, ) -> Result<BTreeMap<String, ContentAddress>, RecursiveAddressError>
The recursive (transitive) content address of every node, keyed by name —
each address fixes the node’s reachable definition, cycle-safe. See the
module doc. Edge kinds resolve against the default_kind_vocab
(the meta kind floor). Err on a dangling local edge or an unlabeled
automorphic cycle (fail-closed).
Sourcepub fn recursive_addresses_grounded(
&self,
vocab: &KindVocab,
) -> Result<BTreeMap<String, ContentAddress>, RecursiveAddressError>
pub fn recursive_addresses_grounded( &self, vocab: &KindVocab, ) -> Result<BTreeMap<String, ContentAddress>, RecursiveAddressError>
As recursive_addresses, but resolving edge
kinds against an EXPLICIT KindVocab. Two peers agree on a concept’s
MEANING (not just spelling) by recomputing with the SAME vocab; a vocab in
which a kind’s properties differ yields a different address (A3).
Sourcepub fn recursive_root(&self) -> Result<ContentAddress, RecursiveAddressError>
pub fn recursive_root(&self) -> Result<ContentAddress, RecursiveAddressError>
The recursive Merkle root — the content address over the sorted set of
every node’s RECURSIVE address. The transitive-identity analogue of
root; additive, leaves root untouched. Kinds resolve
against the default_kind_vocab.
Sourcepub fn recursive_root_grounded(
&self,
vocab: &KindVocab,
) -> Result<ContentAddress, RecursiveAddressError>
pub fn recursive_root_grounded( &self, vocab: &KindVocab, ) -> Result<ContentAddress, RecursiveAddressError>
As recursive_root, but resolving edge kinds
against an explicit KindVocab.
Sourcepub fn extract_concept(
&self,
name: &str,
) -> Result<Archive, RecursiveAddressError>
pub fn extract_concept( &self, name: &str, ) -> Result<Archive, RecursiveAddressError>
The minimal sub-archive carrying name and its transitive LOCAL closure
(every node reachable by Local edges) PLUS the ontology’s connections —
the teach-a-peer payload. A peer that loads it (1) recomputes name’s
recursive address to the SAME value as in this archive — because a recursive
address depends only on this closure plus the Grounded leaves (whose
foreign roots the peer must already hold; a Grounded edge is kept verbatim
as a foreign-atom address) — and (2) holds the functors needed to
INTERPRET (rebind via apply) the concept, not merely identify it.
The connections ride whole: a functor is ontology-level (it maps generic
KINDS, e.g. Synset → Concept), so it is the interpretation machinery for
every concept of the ontology, not one concept’s. Err if name is absent
or a local edge dangles.