FLOW ALGEBRA
TITLE: Blood Group Antigen Ontology
DOMAIN: Biological Entities / Blood and Circulatory Entities
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/blood-and-circulatory-entities/blood-group-antigen-ontology.html
VERSION: 1.0
STATUS: Topic-based formalisation; source page content not independently verified
AUTHORS: Mark Higgins — Sky (Recursive AI)
PROJECT: Kireth Semantic Library
01. PURPOSE
Represent blood group antigens, their molecular carriers, inheritance, expression, antibodies, typing and transfusion compatibility as typed, provenance-aware semantic relationships.
02. TYPES
TYPE Entity
TYPE BiologicalEntity <: Entity
TYPE Cell <: BiologicalEntity
TYPE RedBloodCell <: Cell
TYPE BloodGroupSystem <: BiologicalEntity
TYPE BloodGroupAntigen <: BiologicalEntity
TYPE AntigenEpitope <: BiologicalEntity
TYPE MembraneProtein <: BiologicalEntity
TYPE Glycolipid <: BiologicalEntity
TYPE Glycan <: BiologicalEntity
TYPE Gene <: BiologicalEntity
TYPE Allele <: BiologicalEntity
TYPE Genotype <: BiologicalEntity
TYPE Phenotype <: BiologicalEntity
TYPE Antibody <: BiologicalEntity
TYPE PlasmaSample <: BiologicalEntity
TYPE RedCellUnit <: BiologicalEntity
TYPE Recipient <: BiologicalEntity
TYPE Donor <: BiologicalEntity
TYPE Assay <: Entity
TYPE Observation <: Entity
TYPE Evidence <: Entity
TYPE ClinicalContext <: Entity
TYPE CompatibilityDecision <: Entity
03. CORE ENTITIES
ENTITY ABO : BloodGroupSystem
ENTITY Rh : BloodGroupSystem
ENTITY Kell : BloodGroupSystem
ENTITY Duffy : BloodGroupSystem
ENTITY Kidd : BloodGroupSystem
ENTITY MNS : BloodGroupSystem
ENTITY ABO_A : BloodGroupAntigen
ENTITY ABO_B : BloodGroupAntigen
ENTITY RhD : BloodGroupAntigen
ENTITY K : BloodGroupAntigen
ENTITY Fya : BloodGroupAntigen
ENTITY Jka : BloodGroupAntigen
ENTITY AntiA : Antibody
ENTITY AntiB : Antibody
ENTITY AntiD : Antibody
04. RELATIONSHIPS
RELATION belongs_to_system(BloodGroupAntigen, BloodGroupSystem)
RELATION expressed_on(BloodGroupAntigen, RedBloodCell)
RELATION epitope_of(AntigenEpitope, BloodGroupAntigen)
RELATION carried_by(BloodGroupAntigen, BiologicalEntity)
RELATION encoded_or_modified_by(BloodGroupAntigen, Gene)
RELATION allele_of(Allele, Gene)
RELATION contributes_to(Allele, Phenotype)
RELATION binds(Antibody, BloodGroupAntigen)
RELATION detected_by(BloodGroupAntigen, Assay)
RELATION supported_by(Observation, Evidence)
RELATION compatible_with(RedCellUnit, Recipient, ClinicalContext)
RELATION contraindicated_for(RedCellUnit, Recipient, ClinicalContext)
RELATION has_confidence(Observation, Real[0,1])
05. TYPE CONSTRAINTS
RULE belongs_to_system(a,s) -> BloodGroupAntigen(a) AND BloodGroupSystem(s)
RULE expressed_on(a,c) -> BloodGroupAntigen(a) AND RedBloodCell(c)
RULE binds(ab,a) -> Antibody(ab) AND BloodGroupAntigen(a)
RULE compatible_with(u,r,k) -> RedCellUnit(u) AND Recipient(r) AND ClinicalContext(k)
06. ANTIGEN STRUCTURE
FACT belongs_to_system(ABO_A, ABO)
FACT belongs_to_system(ABO_B, ABO)
FACT belongs_to_system(RhD, Rh)
FACT belongs_to_system(K, Kell)
FACT belongs_to_system(Fya, Duffy)
FACT belongs_to_system(Jka, Kidd)
RULE ABO_antigen(a) -> glycan_epitope(a)
RULE RhD_antigen(a) -> protein_associated_epitope(a)
NOTE: Antigen systems differ in molecular carriers and biological function.
NOTE: ABO expression is affected by glycosyltransferase activity and H precursor availability.
NOTE: Blood group phenotype cannot always be inferred reliably from genotype alone.
07. ABO PHENOTYPE LOGIC
PREDICATE expresses(person, antigen)
PREDICATE phenotype(person, group)
RULE expresses(p,ABO_A) AND NOT expresses(p,ABO_B) -> phenotype(p,A)
RULE expresses(p,ABO_B) AND NOT expresses(p,ABO_A) -> phenotype(p,B)
RULE expresses(p,ABO_A) AND expresses(p,ABO_B) -> phenotype(p,AB)
RULE NOT expresses(p,ABO_A) AND NOT expresses(p,ABO_B) -> phenotype(p,O)
GUARD: Apply rules only after validated testing; absence requires sufficient evidence.
EXCEPTION: Rare phenotypes such as Bombay (Oh) can invalidate simplified ABO assumptions.
08. RH PHENOTYPE LOGIC
RULE expresses(p,RhD) -> phenotype(p,RhD_positive)
RULE confirmed_absent(p,RhD) -> phenotype(p,RhD_negative)
EXCEPTION: Weak D and partial D variants require method- and context-sensitive interpretation.
09. IMMUNOHAEMATOLOGY
PREDICATE clinically_significant(antibody, context)
PREDICATE recipient_has(Recipient, Antibody)
PREDICATE unit_expresses(RedCellUnit, BloodGroupAntigen)
RULE recipient_has(r,ab) AND binds(ab,a) AND unit_expresses(u,a)
AND clinically_significant(ab,k) -> flag_incompatibility(u,r,k)
RULE flag_incompatibility(u,r,k) -> requires_specialist_review(u,r,k)
NOTE: Compatibility must also account for ABO/RhD requirements, antibody history,
crossmatch results, component type, local policy and emergency circumstances.
NOTE: This ontology is not a standalone transfusion decision system.
10. STATE TRANSITIONS
STATE antigen_status = {unknown, predicted, detected, not_detected, indeterminate, confirmed}
TRANSITION unknown -> predicted WHEN genotype_based_inference
TRANSITION unknown -> detected WHEN validated_serological_reactivity
TRANSITION unknown -> not_detected WHEN validated_negative_assay
TRANSITION predicted -> confirmed WHEN concordant_confirmatory_evidence
TRANSITION detected -> indeterminate WHEN conflicting_results
TRANSITION indeterminate -> confirmed WHEN resolved_by_reference_testing
INVARIANT: not_detected != biologically_absent without assay sensitivity context.
11. QUANTITATIVE MODEL
VARIABLE expression_level(a,c) : Real >= 0
VARIABLE assay_signal(a,test) : Real
VARIABLE detection_threshold(test) : Real
VARIABLE confidence(o) : Real[0,1]
MODEL detected(a,test) := assay_signal(a,test) >= detection_threshold(test)
MODEL P(phenotype | genotype, assay, context) proportional_to
P(assay | phenotype, context) * P(phenotype | genotype, context)
CONSTRAINT: Probabilistic quantities require validated data and calibrated models.
12. SEMANTIC_EQUIVALENCE
ALIAS erythrocyte = red_blood_cell
ALIAS RBC_antigen = erythrocyte_surface_antigen [context: serology]
ALIAS Rh_D_antigen = RhD
NOT_EQUIVALENT ABO_system != ABO_A_antigen
NOT_EQUIVALENT Rh_system != RhD_antigen
NOT_EQUIVALENT antigen_absence != negative_test_result
NOT_EQUIVALENT genotype != phenotype
NOT_EQUIVALENT antigen != antibody
13. INFERENCE RULES
RULE binds(ab,a) AND recipient_has(r,ab) -> antigen_relevant_to_recipient(a,r)
RULE antigen_relevant_to_recipient(a,r) AND unit_expresses(u,a)
-> evaluate_haemolytic_risk(u,r,a)
RULE conflicting_assays(a) -> confidence_reduction(a)
RULE verified_reference_result(a) -> strengthen_evidence(a)
RULE phenotype_discrepancy(p) -> request_resolution(p)
GUARD: No clinical compatibility conclusion from a single unverified predicate.
14. CONFIDENCE
CONFIDENCE:
range: [0.0,1.0]
factors: [assay_validation, specimen_quality, method_specificity,
genotype_phenotype_concordance, evidence_recency, provenance]
unknown: null
interpretation: evidence_confidence_not_clinical_certainty
update: recalibrate_when_new_evidence_arrives
15. PROVENANCE
PROVENANCE_RECORD:
source_uri: string
assay_method: string?
specimen_id: string?
observation_time: datetime?
laboratory: string?
reference_standard: string?
curator: string?
evidence_version: string?
RULE observation(o) -> requires_provenance(o)
16. RECURSIVE FLOW
FLOW AntigenReasoning(sample, context):
classify_sample(sample)
gather_serology(sample)
gather_genetic_evidence_if_available(sample)
map_antigens_to_systems()
resolve_aliases_and_variants()
detect_discrepancies()
infer_phenotype_with_guards()
attach_confidence_and_provenance()
IF unresolved_discrepancy THEN request_reference_review()
RETURN evidence_graph
17. FLOW_HASH
FLOW_HASH:
method: SHA-256
input: canonical_serialisation(ontology_version, typed_entities,
relations, rules, evidence_references)
output: lowercase_hex_digest
note: hash generated by implementing runtime; no digest asserted here
18. UPDATE_MODEL
UPDATE_MODEL:
triggers: [new_antigen_variant, new_ISBT_classification, revised_evidence,
updated_assay, corrected_provenance]
actions: [validate_schema, preserve_history, recompute_inferences,
update_confidence, regenerate_flow_hash]
versioning: immutable_prior_versions
conflict_policy: retain_disagreement_until_resolved
19. AI_CONSUMPTION
AI_CONSUMPTION:
format: typed_semantic_graph
applications: [biomedical_search, knowledge_graph_alignment,
laboratory_data_interpretation_support, educational_reasoning]
required_fields: [entity_id, entity_type, relation_type, evidence, confidence]
safety: human_review_required_for_transfusion_decisions
prohibit: autonomous_clinical_compatibility_clearance
20. VALIDATION
CHECK all_antigens_have_valid_system_identifiers
CHECK relations_respect_declared_types
CHECK unknown_not_coerced_to_negative
CHECK conflicting_evidence_preserved
CHECK clinically_significant_claims_have_context
CHECK each_derived_assertion_has_provenance
CHECK no_invented_assay_result
CHECK flow_hash_recomputed_after_changes
END FLOW ALGEBRA
Download Code
Copy to Clipboard