1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! The `Arrow` trait — directed structures carrying kind and per-instance
//! provenance.
//!
//! # Ontological grounding
//!
//! Arrow is the Rust realisation of
//! [`crate::category::category_theory::CategoryTheoryConcept::Morphism`].
//! Mac Lane (1971) CWM Ch. I §1 uses "morphism" and "arrow" as synonyms;
//! Awodey (2010) uses "arrow" as primary. The Rust trait is `Arrow`
//! (avoids naming collision with the `Morphism` struct) and both names
//! point at the same ontological concept.
//!
//! The previous `Relationship` trait (Chen 1976 Entity-Relationship
//! database modelling vocabulary) has been absorbed — "relationship"
//! is ER modelling, not the category-theoretic or ontology-engineering
//! literature the rest of pr4xis cites. `Arrow` replaces it.
//!
//! # Per-instance provenance (required)
//!
//! Every arrow carries its own [`Provenance`] via [`Arrow::meta`]. Per
//! Gruber (1993) KAS 5 "formally-named relations", Smith et al. (2005)
//! OBO-RO "every relation-instance is named", W3C PROV-O (2013) "every
//! entity has provenance", W3C SKOS (2009) "every concept mapping has
//! labels + notes" — no anonymous arrows. `meta(&self)` is required
//! on every impl.
//!
//! # Dimensional scope
//!
//! Arrow is for **morphism-level** cells (0-cells to 0-cells within a
//! category). Higher cells — functors (1-cells in Cat), natural
//! transformations (2-cells), adjunctions (structured pairs) — keep
//! their own traits (`Functor`, `NaturalTransformation`, `Adjunction`)
//! with type-level `fn meta()`. Bénabou (1967) *Introduction to
//! Bicategories* distinguishes cells by dimension; their Rust encoding
//! follows.
//!
//! Literature:
//! - Mac Lane (1971) CWM Ch. I §1 — morphism / arrow
//! - Awodey (2010) *Category Theory* — "arrow" as primary
//! - Gruber (1993) KAS 5 — formally-named relations
//! - Smith et al. (2005) OBO-RO — relation-kinds with instance-level
//! provenance
//! - W3C PROV-O (2013) — every entity has provenance
//! - W3C SKOS (2009) — every concept mapping has labels/notes
use Debug;
use Concept;
use crateProvenance;
/// A directed structure between objects, carrying a relation kind and
/// per-instance provenance.