FLOW ALGEBRA — TUMOUR ONTOLOGY
Kireth Semantic Library | Pathological Biological Entities
Companion specification v1.0 | 27 October 2026
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/pathological-biological-entities/tumour-ontology.html
AUTHORS: Mark Anthony Higgins; Sky — Recursive AI
STATUS: Proposed formal companion model; not a verbatim extraction of embedded page code.
PURPOSE: Represent tumour entities, observations, classification, progression and evidence-based inference in a portable semantic flow.
1. FORMAL STATE
S_t = (I_t, R, B, K)
I_t = available observations, histology, imaging, molecular data and clinical context
R = typed ontology relations and admissible inference rules
B = epistemic, biological, temporal and diagnostic boundaries
K = curated domain knowledge, terminology, evidence and provenance
E_t = expand(I_t, R)
V_t = {x in E_t | valid(x, B, K)}
x*_t = argmax_{x in V_t} P(x | I_t, R, B, K)
I_(t+1) = update(I_t, x*_t, evidence_t)
NOTE: Ranking hypotheses is not equivalent to clinical diagnosis.
2. ENTITY SCHEMA
TumourEntity(id, name, site, tissue_of_origin, behaviour, histology, grade, stage, size, extent, time, evidence, provenance)
Behaviour = {benign, malignant, borderline, uncertain, unknown}
TumourOrigin = {primary, secondary_metastatic, recurrent, indeterminate}
TissueClass = {epithelial, mesenchymal, haematolymphoid, neural, germ_cell, mixed, other, unknown}
Observation = (feature, value, unit, method, time, confidence, source)
Classification = (scheme, edition, code, label, evidence)
Evidence = (source_id, modality, timestamp, quality, interpretation)
3. CORE RELATIONSHIPS
TumourEntity IS_A PathologicalBiologicalEntity
TumourEntity LOCATED_IN AnatomicalStructure
TumourEntity ARISES_FROM TissueOrCellLineage
TumourEntity HAS_MORPHOLOGY MorphologicalFeature
TumourEntity HAS_BEHAVIOUR BehaviourCategory
TumourEntity HAS_HISTOLOGY HistologicalClassification
TumourEntity HAS_GRADE GradeAssessment
TumourEntity HAS_STAGE StageAssessment
TumourEntity HAS_BIOMARKER MolecularFinding
TumourEntity SUPPORTED_BY Evidence
TumourEntity MAY_CAUSE ClinicalManifestation
TumourEntity MAY_INVADE AdjacentStructure
TumourEntity MAY_METASTASISE_TO DistantSite
TumourEntity MAY_RECUR_AS TumourEntity
4. CLASSIFICATION BOUNDARIES
Benign != non-growing; benign tumours can enlarge or cause harm.
Malignant != metastatic; malignant tumours may be localised.
Grade != stage; grade concerns histological characteristics, stage concerns extent.
Neoplasm != cancer in every case.
Mass != confirmed tumour; imaging appearances can have alternative explanations.
Metastasis requires suitable evidence of secondary spread.
Absence of a biomarker is not proof of benign behaviour.
Histology and classification codes require a declared scheme and version.
5. TRANSFORMATION FLOW
INPUT: lesion_or_mass_observation
-> validate identity, site, date, method and source
-> collect morphology and clinical context
-> identify whether tumour status is confirmed, suspected or unknown
-> map to possible tissue lineage and behaviour categories
-> associate histological and molecular evidence where available
-> assess grade and stage only with scheme-specific evidence
-> preserve differential hypotheses and uncertainty
-> output structured TumourEntity with provenance
6. INFERENCE RULES
R01 IF histopathology confirms neoplasm THEN tumour_status = confirmed.
R02 IF imaging alone detects mass THEN tumour_status = suspected_or_indeterminate UNLESS corroborated.
R03 IF evidence confirms invasion THEN record invasive_feature; DO NOT infer distant metastasis.
R04 IF evidence confirms distant secondary tumour from primary THEN relation = METASTASIS_OF.
R05 IF histological grading evidence is absent THEN grade = unknown.
R06 IF stage-defining observations are insufficient THEN stage = unknown.
R07 IF conflicting pathology reports exist THEN preserve both with dates and review status.
R08 IF classification scheme changes THEN retain original code and map versioned replacement.
R09 IF longitudinal size change is observed THEN record measurement method and uncertainty.
R10 IF treatment response is reported THEN attach assessment criteria, dates and source.
R11 IF a tumour is benign THEN do not infer absence of clinical risk.
R12 IF evidence is missing THEN do not convert unknown into negative.
7. MINI RECURSION ENGINE
function resolve_tumour(entity, evidence, depth, visited):
if depth > MAX_DEPTH or entity.id in visited: return bounded_result
visited += entity.id
candidates = expand(entity, typed_relations)
candidates = filter(candidates, evidence_support, versioned_schema, boundaries)
ranked = rank(candidates, confidence, specificity, provenance)
return merge(entity, ranked, recurse_related_entities(depth + 1, visited))
Termination: finite depth, visited-set cycle detection, stable evidence identifiers.
8. TRI-MAPPING
ENTITY MAP: Tumour -> Tissue -> Organ -> OrganSystem
RELATION MAP: arises_from / located_in / invades / metastasises_to
EVIDENCE MAP: Observation -> Method -> Interpretation -> Source
All mappings retain temporal scope, confidence and provenance.
9. AI SEARCH FLOW
QUERY -> parse entity/site/behaviour/histology/grade/stage intent
-> resolve synonyms (tumour/tumor/neoplasm) with contextual distinctions
-> traverse ontology and evidence-linked relationships
-> apply biological and epistemic constraints
-> rank grounded answers and expose uncertainty
-> return source-linked structured explanation
Search facets: anatomical site, cell origin, benign/malignant status, grade, stage,
primary/secondary origin, biomarkers, manifestations, chronology.
10. CONFIDENCE AND PROVENANCE
confidence = calibrated_evidence_support * source_reliability * contextual_fit
Never manufacture numeric probabilities without a validated calibration method.
Record source URL, author, date, classification edition and observation method.
Separate observed facts, expert interpretations and model-generated hypotheses.
11. EXECUTION VALIDATION
CHECK entity IDs unique and relation endpoints exist.
CHECK no stage or grade is asserted without an applicable schema and evidence.
CHECK unknown, absent, untested and negative are represented distinctly.
CHECK temporal updates preserve previous states and provenance.
CHECK contradictory evidence is retained and flagged for review.
CHECK recursion terminates and no inferred relation exceeds its evidence.
CHECK no model output is presented as a definitive medical diagnosis.
12. OUTPUT CONTRACT
return {
entity_type: "TumourEntity",
entity_id: string,
classification: versioned_label_or_unknown,
site: anatomical_reference_or_unknown,
behaviour: category_or_unknown,
grade: evidence_bound_or_unknown,
stage: evidence_bound_or_unknown,
relationships: typed_evidence_linked_edges,
uncertainty: explicit_limits,
provenance: source_records,
validation: pass_fail_with_reasons
}
END FLOW ALGEBRA
Download Code
Copy to Clipboard