FLOW ALGEBRA
LUNG ONTOLOGY — BIOLOGICAL ORGAN ENTITIES
Version: 1.0 | Date: 2026-10-19
Authors: Mark Higgins — Sky (Recursive AI)
Source: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/organ-entities/lung-ontology-2.html
Status: Independently developed scientific draft; source webpage content not verified.
1. PURPOSE
Represent lungs as respiratory organs using typed anatomical entities, structural and functional relations, conditional inference, evidence provenance and machine-consumable assertions. Scope is comparative mammalian anatomy with human examples; species-specific details must be explicitly qualified.
2. TYPED ENTITY MODEL
ENTITY Lung : Organ {species: Taxon, laterality: Left|Right, health_state: State}
ENTITY RespiratorySystem : OrganSystem
ENTITY Lobe : AnatomicalRegion {side: Left|Right, name: String}
ENTITY Bronchus : Airway
ENTITY Bronchiole : Airway
ENTITY TerminalBronchiole : Bronchiole
ENTITY RespiratoryBronchiole : Bronchiole
ENTITY AlveolarDuct : Airway
ENTITY Alveolus : GasExchangeUnit
ENTITY AlveolarSac : AnatomicalStructure
ENTITY PulmonaryCapillary : BloodVessel
ENTITY PulmonaryArtery : BloodVessel
ENTITY PulmonaryVein : BloodVessel
ENTITY Pleura : SerousMembrane {layer: Visceral|Parietal}
ENTITY Diaphragm : SkeletalMuscle
ENTITY TypeI_Pneumocyte : EpithelialCell
ENTITY TypeII_Pneumocyte : EpithelialCell
ENTITY AlveolarMacrophage : ImmuneCell
ENTITY Surfactant : BiologicalMixture
ENTITY RespiratoryMembrane : TissueInterface
ENTITY Ventilation : PhysiologicalProcess
ENTITY Diffusion : TransportProcess
ENTITY Perfusion : PhysiologicalProcess
ENTITY Oxygen : Molecule
ENTITY CarbonDioxide : Molecule
ENTITY Measurement : Observation {value: Number, unit: String, method: String, timestamp: DateTime}
ENTITY Evidence : SourceRecord {uri: URI, author: String?, date: Date?, quality: String?}
3. CORE RELATIONSHIP SIGNATURES
PART_OF(AnatomicalEntity, AnatomicalEntity)
HAS_PART(AnatomicalEntity, AnatomicalEntity)
CONNECTED_TO(AnatomicalEntity, AnatomicalEntity)
LINED_BY(AnatomicalEntity, CellType)
SURROUNDED_BY(AnatomicalEntity, AnatomicalEntity)
SUPPLIES(BloodVessel, AnatomicalEntity)
DRAINS_TO(AnatomicalEntity, BloodVessel)
PARTICIPATES_IN(Entity, Process)
PRODUCES(CellType, BiologicalMixture)
EXCHANGES(AnatomicalEntity, Molecule)
SUPPORTED_BY(Assertion, Evidence)
4. ANATOMICAL FACTS — HUMAN REFERENCE CONTEXT
PART_OF(Lung, RespiratorySystem)
HAS_PART(RightLung, RightSuperiorLobe)
HAS_PART(RightLung, RightMiddleLobe)
HAS_PART(RightLung, RightInferiorLobe)
HAS_PART(LeftLung, LeftSuperiorLobe)
HAS_PART(LeftLung, LeftInferiorLobe)
PART_OF(Alveolus, Lung)
LINED_BY(Alveolus, TypeI_Pneumocyte)
LINED_BY(Alveolus, TypeII_Pneumocyte)
PRODUCES(TypeII_Pneumocyte, Surfactant)
SURROUNDED_BY(Alveolus, PulmonaryCapillary)
PARTICIPATES_IN(Alveolus, Diffusion)
NOTE: Lung lobation varies by species; human lobe counts must not be generalised to all mammals.
NOTE: Pulmonary arteries generally convey deoxygenated blood from the right ventricle; pulmonary veins generally return oxygenated blood to the left atrium.
5. PHYSIOLOGICAL FLOW
Airflow := Trachea -> MainBronchus -> LobarBronchus -> SegmentalBronchus -> Bronchiole -> TerminalBronchiole -> RespiratoryBronchiole -> AlveolarDuct -> Alveolus
OxygenFlow := AlveolarGas -> RespiratoryMembrane -> PulmonaryCapillaryBlood
CarbonDioxideFlow := PulmonaryCapillaryBlood -> RespiratoryMembrane -> AlveolarGas
VentilationPerfusionCoupling := f(AlveolarVentilation, CapillaryPerfusion)
GasTransfer := f(PartialPressureGradient, SurfaceArea, BarrierThickness, Diffusivity)
6. FORMAL INFERENCE RULES
RULE R1: HAS_PART(x,y) -> PART_OF(y,x)
RULE R2: PART_OF(x,y) AND PART_OF(y,z) -> PART_OF(x,z) [transitive, within valid anatomical granularity]
RULE R3: INSTANCE_OF(x,TypeII_Pneumocyte) -> CAPABLE_OF(x,SurfactantProduction)
RULE R4: INSTANCE_OF(x,Alveolus) AND ADJACENT_TO(x,c:PulmonaryCapillary) -> POTENTIAL_SITE_OF(x,GasExchange)
RULE R5: REDUCED(SurfactantFunction) -> MAY_INCREASE(AlveolarCollapseRisk) [context-dependent]
RULE R6: INCREASED(RespiratoryMembraneThickness) -> MAY_REDUCE(GasDiffusionRate) [other conditions held constant]
RULE R7: LOW(AlveolarVentilation) AND PRESERVED(Perfusion) -> MAY_CAUSE(LowVentilationPerfusionRatio)
RULE R8: ASSERTED(a) AND NOT SUPPORTED_BY(a,e) -> FLAG(a,NeedsEvidence)
Rules R5-R7 are qualitative physiological implications, not diagnostic criteria.
7. SEMANTIC_EQUIVALENCE
EQUIVALENT_LABEL("lung", "pulmonary organ") [context: anatomical]
RELATED_LABEL("alveolar epithelial type I cell", "type I pneumocyte")
RELATED_LABEL("alveolar epithelial type II cell", "type II pneumocyte")
DISTINCT("ventilation", "respiration")
DISTINCT("oxygenation", "ventilation")
DISTINCT("pulmonary circulation", "bronchial circulation")
8. CONFIDENCE AND PROVENANCE
CONFIDENCE(assertion) := {score: 0.0..1.0, basis: Evidence|ExpertReview|Inference, scope: String, timestamp: DateTime}
Do not assign numerical confidence without a documented calibration procedure.
PROVENANCE(assertion) := {source_uri, extraction_method, observed_at, curator, revision}
Unverified claims remain marked UNVERIFIED and cannot be promoted to validated facts by recursive inference.
9. FLOW_HASH
FLOW_HASH := SHA256(canonical_utf8(ontology_id + version + ordered_entities + ordered_relations + ordered_rules))
Canonicalisation: Unicode NFC; stable key ordering; explicit null handling; deterministic whitespace and line endings.
Hash is computed by implementation, not fabricated in this text.
10. UPDATE_MODEL
UPDATE_MODEL:
trigger: [new_peer_reviewed_evidence, anatomy_revision, nomenclature_change, correction]
stages: [ingest, validate, compare, version, review, publish]
preserve: [previous_versions, source_attribution, change_log]
conflicts: retain competing claims with evidence and scope; do not silently overwrite
compatibility: preserve stable entity identifiers or publish migration mappings
11. AI_CONSUMPTION
AI_CONSUMPTION:
format: typed_relation_graph
root_entity: Lung
ontology_domain: biological_entities.organ_entities
query_capabilities: [entity_lookup, partonomy, process_trace, evidence_trace, rule_explanation]
constraints: [respect_species_scope, distinguish_anatomy_from_pathology, report_uncertainty, no_unsupported_diagnosis]
output_requirements: [entity_ids, relation_types, source_references, confidence_basis, ontology_version]
12. VALIDATION TESTS
TEST: PART_OF(Alveolus,Lung) resolves true for anatomically valid instances.
TEST: HAS_PART(RightLung,RightMiddleLobe) is human-scoped.
TEST: LeftLung human reference contains two lobes, not three.
TEST: No rule equates pulmonary ventilation with blood perfusion.
TEST: Missing evidence is surfaced rather than inferred as confirmed.
TEST: Canonical hashing is reproducible across equivalent serialisations.
END FLOW ALGEBRA
Download Code
Copy to Clipboard