FLOW ALGEBRA
LIPID ONTOLOGY
Kireth Semantic Library | Macromolecular Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/macromolecular-entities/lipid-ontology-2.html
Companion formalisation | 2026-10-15
Authors: Mark Anthony Higgins — Sky (Recursive AI)
1. PURPOSE
Represent lipid entities, structures, functions, relationships, transformations and evidence as a typed, recursively traversable semantic graph. Distinguish chemical class membership from physiological function and avoid treating all lipids as polymers or macromolecules.
2. TYPE SYSTEM
TYPE Entity
TYPE ChemicalEntity <: Entity
TYPE Lipid <: ChemicalEntity
TYPE FattyAcyl <: Lipid
TYPE Glycerolipid <: Lipid
TYPE Glycerophospholipid <: Lipid
TYPE Sphingolipid <: Lipid
TYPE SterolLipid <: Lipid
TYPE PrenolLipid <: Lipid
TYPE Saccharolipid <: Lipid
TYPE Polyketide <: Lipid
TYPE FattyAcid <: FattyAcyl
TYPE Triacylglycerol <: Glycerolipid
TYPE Phosphatidylcholine <: Glycerophospholipid
TYPE Cholesterol <: SterolLipid
TYPE LipidAssembly <: Entity
TYPE Membrane <: LipidAssembly
TYPE LipoproteinParticle <: LipidAssembly
TYPE BiologicalProcess <: Entity
TYPE BiologicalFunction <: Entity
TYPE Compartment <: Entity
TYPE Organism <: Entity
TYPE Evidence <: Entity
TYPE ProvenanceRecord <: Entity
TYPE Context <: Entity
TYPE ConfidenceScore = Real[0,1]
TYPE ValidationStatus = {VALID, INVALID, UNRESOLVED}
3. TYPED RELATIONS
REL is_a(Entity, Entity)
REL has_component(Entity, ChemicalEntity)
REL has_fatty_acyl_chain(Lipid, FattyAcyl)
REL esterified_to(ChemicalEntity, ChemicalEntity)
REL has_headgroup(Lipid, ChemicalEntity)
REL has_chain_length(FattyAcyl, Integer)
REL has_double_bond_count(FattyAcyl, Integer)
REL has_double_bond_position(FattyAcyl, Integer)
REL has_stereochemistry(ChemicalEntity, String)
REL localised_in(Entity, Compartment)
REL participates_in(Entity, BiologicalProcess)
REL contributes_to(Entity, BiologicalFunction)
REL forms_assembly(Lipid, LipidAssembly)
REL interacts_with(Entity, Entity)
REL converted_to(ChemicalEntity, ChemicalEntity)
REL catalysed_by(BiologicalProcess, Entity)
REL supported_by(Entity, Evidence)
REL derived_from(Entity, ProvenanceRecord)
REL context_of(Entity, Context)
4. CORE CLASSIFICATION
RULE Lipid(x) AND structural_class(x,c) -> is_a(x,c) WHEN c IN LipidClasses
LipidClasses = {FattyAcyl, Glycerolipid, Glycerophospholipid, Sphingolipid, SterolLipid, PrenolLipid, Saccharolipid, Polyketide}
RULE is_a(x,Triacylglycerol) -> is_a(x,Glycerolipid)
RULE is_a(x,Phosphatidylcholine) -> is_a(x,Glycerophospholipid)
RULE is_a(x,Cholesterol) -> is_a(x,SterolLipid)
NOTE Class boundaries follow curated structural definitions; do not infer a class solely from hydrophobicity.
5. STRUCTURAL REPRESENTATION
STRUCT LipidRecord {
id: URI;
preferred_name: String;
aliases: Set[String];
class: LipidClass;
formula: Optional[String];
exact_mass: Optional[Real];
charge: Optional[Integer];
chains: List[ChainRecord];
headgroup: Optional[String];
stereochemistry: Optional[String];
structural_evidence: Set[Evidence];
context: Context;
}
STRUCT ChainRecord {
carbon_count: Integer >= 0;
double_bond_count: Integer >= 0;
double_bond_positions: Optional[List[Integer]];
geometry: Optional[List[{E,Z,UNKNOWN}]];
linkage: {ESTER,ETHER,AMIDE,OTHER,UNKNOWN};
}
CONSTRAINT chain.double_bond_count <= max(0,chain.carbon_count-1)
CONSTRAINT positions_known -> length(double_bond_positions)=double_bond_count
CONSTRAINT formula_known -> chemically_valid_valence(formula, structure)
CONSTRAINT positional_isomer_identity requires explicit positional evidence
6. FUNCTIONAL SEMANTICS
RULE membrane_lipid(x) AND observed_in(x,m) -> contributes_to(x,membrane_structure) [context=m]
RULE triacylglycerol(x) AND stored_in(x,lipid_droplet) -> contributes_to(x,energy_storage)
RULE lipid_mediator(x) AND binds_receptor(x,r) -> participates_in(x,cell_signalling)
RULE sterol(x) AND membrane_association_verified(x) -> contributes_to(x,membrane_properties)
NOTE Functions are context-dependent and are not universal properties of every class member.
7. TRANSFORMATIONS AND CONSERVATION
TRANSFORM esterification: acid + alcohol -> ester + water [conditions_required]
TRANSFORM hydrolysis: ester + water -> acid + alcohol [conditions_required]
TRANSFORM beta_oxidation: fatty_acyl_substrate -> shortened_acyl_product + acetyl_CoA [stoichiometry/context_required]
TRANSFORM desaturation: fatty_acyl_substrate -> unsaturated_product [enzyme/cofactor/context_required]
RULE transformed(x,y,p) -> converted_to(x,y) AND participates_in(x,p) AND participates_in(y,p)
VALIDATE reaction: atom_balance AND charge_balance AND compartment_consistency AND documented_conditions
NOTE Generic transformation schemas are not balanced biochemical reactions until instantiated.
8. GRAPH COMPOSITION
GRAPH G=(V,E) WHERE V=typed_entities AND E=typed_relations
OP traverse(G,origin,relation_filter,max_depth) -> Set[Entity]
OP compose(r1:A->B,r2:B->C) -> relation_path:A->C
OP infer(G,rule_set,context) -> candidate_edges
CONSTRAINT inferred_edge must retain rule_id, premises, context and provenance
CONSTRAINT graph_cycles allowed for interactions; subclass cycles invalid unless explicit equivalence is established
9. SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE(x,y):
REQUIRE same_referent(x,y) AND compatible_structure(x,y)
REQUIRE compatible_stereochemistry(x,y) OR stereochemistry_unresolved_both(x,y)
REQUIRE identity_evidence_sufficient(x,y)
RETURN VERIFIED | REJECTED | UNRESOLVED
RULE synonyms(x,y) -> lexical_match(x,y), NOT automatically identity(x,y)
RULE same_sum_composition(x,y) -> composition_match(x,y), NOT necessarily structural_identity(x,y)
RULE class_match(x,y) -> related_class(x,y), NOT entity_identity(x,y)
10. VALIDATION
VALIDATE lipid_record(x):
check unique_identifier(x)
check allowed_class(x)
check formula_and_charge_if_present(x)
check chain_structure_if_present(x)
check evidence_for_claimed_stereochemistry(x)
check provenance_linkage(x)
RETURN VALID | INVALID | UNRESOLVED
VALIDATE biological_claim(c): evidence_supports(c) AND context_matches(c) AND no_known_contradiction(c)
CONSTRAINT absent_evidence != evidence_of_absence
CONSTRAINT missing_chain_positions -> identity_resolution=UNRESOLVED where positions distinguish isomers
11. CONFIDENCE
CONFIDENCE(c) = bounded_evidence_assessment(c.evidence_quality,c.method_reliability,c.context_fit,c.independence)
RANGE CONFIDENCE(c) IN [0,1]
RULE conflicting_evidence(c) -> flag_for_review(c)
RULE derived_claim(c) -> record_premise_confidences(c)
NOTE Confidence scores are not mathematical proof and must not be invented where no calibrated assessment exists.
12. PROVENANCE
PROVENANCE {
source_uri: URI;
source_title: String;
observation_or_database_id: Optional[String];
evidence_method: Optional[String];
curator: Optional[String];
observed_at: Optional[DateTime];
version: String;
transformations: List[String];
}
RULE every asserted scientific edge -> provenance_required
RULE inferred edge -> preserve supporting premises and inference rule
13. FLOW_HASH
FLOW_HASH(record) = SHA256(canonical_utf8(record_without_flow_hash))
CANONICALISE: stable key order; normalised identifiers; explicit null handling; canonical numerical units; deterministic edge ordering
RULE changed_semantic_content -> recompute FLOW_HASH
NOTE Hash verifies byte-level canonical representation, not scientific truth.
14. UPDATE_MODEL
UPDATE_MODEL(old,new):
detect added_entities, removed_entities, changed_properties, changed_edges
revalidate affected_subgraph
invalidate dependent_inferences when premises change
recompute affected hashes
preserve immutable historical versions and provenance
publish change_summary
15. AI_CONSUMPTION
AI_CONSUMPTION {
parse_as: typed_semantic_graph;
require_context: true;
distinguish: [class, molecular_identity, composition, structure, function, evidence];
inference_mode: rule_constrained;
uncertainty_policy: preserve_unknowns;
output: [claims, graph_edges, validation_status, confidence, provenance, flow_hash];
safety: do_not_infer_unobserved_isomerism_or_function;
}
16. EXAMPLE GRAPH
ENTITY lipid:PC_16_0_18_1 TYPE Phosphatidylcholine
EDGE lipid:PC_16_0_18_1 is_a Glycerophospholipid
PROPERTY lipid:PC_16_0_18_1 sum_composition = "PC 34:1"
PROPERTY lipid:PC_16_0_18_1 chain_composition = "16:0_18:1"
PROPERTY lipid:PC_16_0_18_1 sn_positions = UNKNOWN
PROPERTY lipid:PC_16_0_18_1 double_bond_position = UNKNOWN
VALIDATION identity_at_full_structural_resolution = UNRESOLVED
NOTE Example is schematic; no measurement or external dataset is asserted.
17. INTEGRATION
PARENT: Macromolecular Entities
RELATED: Biological Macromolecule Ontology; Fatty Acid Ontology; Biological Molecule Ontology; Molecular Complex Ontology; Biological Membrane Ontology; Metabolism Ontology
DOMAIN_LINKS: biochemistry, lipidomics, cell biology, molecular biology, nutrition, physiology
END FLOW ALGEBRA
Download Code
Copy to Clipboard