FLOW ALGEBRA
LIVER 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/liver-ontology.html
Status: Independently constructed scientific draft; source-page content not verified.
1. PURPOSE
Represent liver anatomy, cellular composition, physiology, pathology and evidential reasoning as typed, inspectable semantic relations. This specification is declarative pseudocode; implementation requires a compatible interpreter.
2. TYPES
ENTITY Liver <: Organ
ENTITY HepaticLobe <: AnatomicalRegion
ENTITY HepaticSegment <: AnatomicalRegion
ENTITY HepaticLobule <: MicroanatomicalUnit
ENTITY PortalTriad <: AnatomicalStructure
ENTITY Hepatocyte <: Cell
ENTITY KupfferCell <: Macrophage
ENTITY HepaticStellateCell <: Cell
ENTITY Cholangiocyte <: EpithelialCell
ENTITY SinusoidalEndothelialCell <: EndothelialCell
ENTITY BileCanaliculus <: AnatomicalStructure
ENTITY BileDuct <: Duct
ENTITY PortalVein <: BloodVessel
ENTITY HepaticArtery <: BloodVessel
ENTITY HepaticVein <: BloodVessel
ENTITY CentralVein <: BloodVessel
ENTITY HepaticSinusoid <: Capillary
ENTITY Bile <: BiologicalFluid
ENTITY Blood <: BiologicalFluid
ENTITY Metabolite <: ChemicalEntity
ENTITY Protein <: Macromolecule
ENTITY Disease <: PathologicalCondition
ENTITY Observation <: Evidence
ENTITY Process <: BiologicalProcess
3. RELATIONSHIPS
RELATION part_of(child:ENTITY, parent:ENTITY)
RELATION contains(parent:ENTITY, child:ENTITY)
RELATION supplied_by(organ:ENTITY, vessel:BloodVessel)
RELATION drains_to(source:ENTITY, target:ENTITY)
RELATION produces(source:ENTITY, product:ENTITY)
RELATION participates_in(entity:ENTITY, process:Process)
RELATION regulates(source:ENTITY, process:Process)
RELATION associated_with(entity:ENTITY, condition:Disease)
RELATION supported_by(assertion:ENTITY, evidence:Observation)
RELATION has_confidence(assertion:ENTITY, score:Float[0..1])
4. CANONICAL INSTANCES AND FACTS
LIVER := Liver("liver")
HEPATOCYTE := Hepatocyte("hepatocyte")
KUPFFER := KupfferCell("Kupffer cell")
STELLATE := HepaticStellateCell("hepatic stellate cell")
CHOLANGIOCYTE := Cholangiocyte("cholangiocyte")
SINUSOID := HepaticSinusoid("hepatic sinusoid")
PORTAL_VEIN := PortalVein("portal vein")
HEPATIC_ARTERY := HepaticArtery("hepatic artery")
HEPATIC_VEIN := HepaticVein("hepatic vein")
BILE := Bile("bile")
FACT part_of(HEPATOCYTE, LIVER)
FACT part_of(KUPFFER, LIVER)
FACT part_of(STELLATE, LIVER)
FACT part_of(CHOLANGIOCYTE, LIVER)
FACT part_of(SINUSOID, LIVER)
FACT supplied_by(LIVER, PORTAL_VEIN)
FACT supplied_by(LIVER, HEPATIC_ARTERY)
FACT drains_to(LIVER, HEPATIC_VEIN)
FACT produces(HEPATOCYTE, BILE)
5. PROCESSES
PROCESS carbohydrate_metabolism: glycogen_synthesis | glycogenolysis | gluconeogenesis
PROCESS lipid_metabolism: fatty_acid_oxidation | lipoprotein_metabolism | cholesterol_metabolism
PROCESS protein_metabolism: amino_acid_processing | urea_cycle | plasma_protein_synthesis
PROCESS detoxification: biotransformation | conjugation | excretion
PROCESS bile_formation: hepatocyte_secretion | canalicular_flow | duct_modification
PROCESS immune_surveillance: macrophage_clearance | antigen_response
PROCESS bilirubin_handling: uptake | conjugation | biliary_excretion
PROCESS haemostasis_support: clotting_factor_synthesis | anticoagulant_protein_synthesis
6. FUNCTIONAL FLOW
FLOW portal_blood:
gastrointestinal_venous_return -> portal_vein -> hepatic_sinusoids -> central_veins -> hepatic_veins -> inferior_vena_cava
FLOW arterial_blood:
hepatic_artery -> hepatic_microcirculation -> hepatic_sinusoids -> hepatic_veins
FLOW bile:
hepatocyte -> bile_canaliculus -> bile_ductules -> intrahepatic_bile_ducts -> extrahepatic_biliary_tree
CONSTRAINT blood_flow_direction != bile_flow_direction_in_classic_lobule
7. REASONING RULES
RULE R01: IF x TYPE Hepatocyte THEN part_of(x, Liver) [context: native hepatic tissue]
RULE R02: IF x TYPE KupfferCell THEN participates_in(x, immune_surveillance)
RULE R03: IF x TYPE HepaticStellateCell AND x.state = activated THEN associated_with(x, fibrosis_process)
RULE R04: IF x TYPE Cholangiocyte THEN participates_in(x, bile_duct_modification)
RULE R05: IF process = urea_cycle THEN organ_site(process, Liver)
RULE R06: IF evidence indicates elevated liver_enzyme THEN infer possible_hepatocellular_injury WITH uncertainty; NOT diagnose disease
RULE R07: IF bile_outflow_obstruction THEN infer possible_cholestasis WITH uncertainty; require clinical corroboration
RULE R08: IF assertion lacks provenance THEN confidence_status(assertion) = unverified
8. SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE("hepatic organ", "liver") [context: anatomy]
SEMANTIC_EQUIVALENCE("liver cell", "hepatocyte") [context: histology; non-universal colloquial usage]
SEMANTIC_EQUIVALENCE("hepatic macrophage", "Kupffer cell") [context: resident macrophage; qualified]
SEMANTIC_DIFFERENCE("liver", "hepatic lobule") = organ_vs_microanatomical_unit
SEMANTIC_DIFFERENCE("bile duct", "blood vessel") = distinct_transport_structures
9. CONFIDENCE AND PROVENANCE
CONFIDENCE(assertion) := calibrated_score(evidence_quality, source_reliability, replication, context_match)
CONSTRAINT 0.0 <= CONFIDENCE(assertion) <= 1.0
PROVENANCE(assertion) := {source_uri, author, timestamp, method, evidence_id, version}
CONSTRAINT uncertain_pathology_inferences MUST NOT be represented as confirmed diagnoses
10. VALIDATION
VALIDATE type_compatibility(all_relations)
VALIDATE no_cycle_in(part_of)
VALIDATE each_assertion_has(source_or_draft_flag)
VALIDATE distinguish(anatomical_part, cell_type, physiological_process, pathology)
VALIDATE blood_and_bile_routes_are_separate
VALIDATE preserve_species_and_developmental_context
11. UPDATE_MODEL
UPDATE_MODEL:
revision_strategy: append_versioned_changes
change_tracking: entity | relationship | rule | evidence | confidence
conflict_resolution: preserve_both_claims_until_evidence_review
deprecated_terms: retain_alias_and_replacement
recompute_on_change: affected_inferences | confidence | flow_hash
12. FLOW_HASH
FLOW_HASH := SHA256(canonical_utf8(normalized_types + normalized_relations + normalized_rules + version))
NOTE: FLOW_HASH is a generation recipe; no digest is asserted until canonicalisation and hashing execute.
13. AI_CONSUMPTION
AI_CONSUMPTION:
representation: typed_entity_relation_graph
reasoning: rule_based_with_uncertainty
outputs: structured_facts | inference_traces | provenance | confidence
safeguards: do_not_infer_diagnosis_from_isolated_observations
interoperability: ontology_mapping | JSON-LD_adapter | RDF_adapter
audit: record_rule_id_and_evidence_for_each_inference
END FLOW ALGEBRA
Download Code
Copy to Clipboard