FLOW ALGEBRA
ORGANIC MOLECULE ONTOLOGY
Kireth Semantic Library | Biological Entities | Chemical Foundations of Life
Source: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/chemical-foundations-of-life/organic-molecule-ontology.html
Version: 1.0 | Date: 2026-10-15
Authors: Mark Higgins — Sky (Recursive AI)
Licence: Open Research Licence — unrestricted research, educational and practical reuse.
PURPOSE
Represent organic molecules as typed chemical entities with explicit composition, bonding, functional groups, biochemical roles, transformations, evidence, and cross-domain graph relationships. This is a companion formalisation, not a claim that every relation has been independently experimentally verified.
FLOW "OrganicMoleculeOntology" v1.0
ENTITY_TYPES:
OrganicMolecule <: ChemicalMolecule
Atom <: ChemicalEntity
ChemicalBond <: ChemicalRelation
FunctionalGroup <: MolecularSubstructure
MolecularFormula <: ChemicalRepresentation
StructuralFormula <: ChemicalRepresentation
Stereoisomer <: ChemicalMolecule
Reaction <: ChemicalProcess
BiologicalRole <: FunctionalEntity
EvidenceRecord <: ProvenanceEntity
Context <: SemanticContext
DEFINITIONS:
OrganicMolecule(m) := Molecule(m) AND CarbonContaining(m) AND InScopeOrganicChemistry(m)
InScopeOrganicChemistry(m) := curated_classification(m)
# Carbon-containing substances such as CO2, carbonates and carbides are
# not automatically classified as organic; scope is ontology-specific.
MolecularFormula(m) := element_count_map(m)
MolecularGraph(m) := (atoms(m), bonds(m), bond_orders(m))
FunctionalGroups(m) := recognised_subgraph_matches(MolecularGraph(m))
CORE_CLASSES:
Hydrocarbon: alkane, alkene, alkyne, aromatic_compound
OxygenContaining: alcohol, phenol, ether, aldehyde, ketone, carboxylic_acid, ester
NitrogenContaining: amine, amide, nitrile, nitrogen_heterocycle
SulphurContaining: thiol, thioether, sulphur_heterocycle
PhosphorusContaining: organophosphate, phosphonate
HalogenContaining: organohalogen
BiologicallyRelevant: amino_acid, monosaccharide, fatty_acid, nucleotide,
metabolite, natural_product
# Categories may overlap; classifications are not mutually exclusive.
RELATION_TYPES:
HAS_ATOM: OrganicMolecule -> Atom
HAS_BOND: OrganicMolecule -> ChemicalBond
HAS_FUNCTIONAL_GROUP: OrganicMolecule -> FunctionalGroup
HAS_FORMULA: OrganicMolecule -> MolecularFormula
HAS_STRUCTURE: OrganicMolecule -> StructuralFormula
IS_ISOMER_OF: OrganicMolecule <-> OrganicMolecule
IS_STEREOISOMER_OF: OrganicMolecule <-> OrganicMolecule
PARTICIPATES_IN: OrganicMolecule -> Reaction
IS_REACTANT_IN: OrganicMolecule -> Reaction
IS_PRODUCT_OF: OrganicMolecule -> Reaction
HAS_BIOLOGICAL_ROLE: OrganicMolecule -> BiologicalRole
DERIVED_FROM: OrganicMolecule -> OrganicMolecule
SUPPORTED_BY: Assertion -> EvidenceRecord
VALID_IN_CONTEXT: Assertion -> Context
TYPE_AND_IDENTITY_RULES:
R01: HAS_ATOM(m,a) => OrganicMolecule(m) AND Atom(a)
R02: HAS_FUNCTIONAL_GROUP(m,g) => OrganicMolecule(m) AND FunctionalGroup(g)
R03: SAME_MOLECULAR_FORMULA(a,b) does_not_imply SAME_STRUCTURE(a,b)
R04: SAME_CONNECTIVITY(a,b) does_not_imply SAME_STEREOCHEMISTRY(a,b)
R05: IS_STEREOISOMER_OF(a,b) => IS_ISOMER_OF(a,b)
R06: IS_ISOMER_OF(a,b) => SAME_MOLECULAR_FORMULA(a,b)
R07: EQUIVALENT_REPRESENTATIONS(a,b) requires normalised structure,
stereochemistry, charge, isotope and tautomer policy.
R08: Chemical identity and biological role are distinct relations.
CONSTRAINTS:
C01: Atomic number and element identity must be valid.
C02: Bond valence must be checked with charge, aromaticity and exception handling.
C03: Molecular formula must match atom inventory of a complete structure.
C04: Formal charge and protonation state must be recorded where relevant.
C05: Stereo descriptors must specify applicable centres or geometries.
C06: Reaction stoichiometry must conserve elements and charge in a closed balanced equation.
C07: Biological activity claims require experimental or curated evidence.
C08: Unknown values must remain UNKNOWN rather than inferred as FALSE.
TRANSFORMATIONS:
PARSE(input: SMILES|InChI|Molfile|Formula) -> CandidateStructure
NORMALISE(CandidateStructure, policy) -> CanonicalRepresentation
CLASSIFY(CanonicalRepresentation) -> Set[ChemicalClass]
DETECT_GROUPS(CanonicalRepresentation) -> Set[FunctionalGroup]
MAP_REACTION(reactants, products, conditions) -> ReactionGraph
ALIGN_ONTOLOGIES(chemical_id, biological_id) -> TypedCrossDomainLink
# Parsing and normalisation require a chemical toolkit for actual execution.
INFERENCE:
I01: molecule_has_subgraph(m, hydroxyl_pattern) AND appropriate_context
=> candidate_functional_group(m, alcohol_or_phenol)
I02: validated_reaction(r) AND IS_REACTANT_IN(m,r)
=> participates_in(m,r)
I03: validated_reaction(r) AND IS_PRODUCT_OF(m,r)
=> participates_in(m,r)
I04: curated_metabolic_role(m,role,organism,condition)
=> HAS_BIOLOGICAL_ROLE(m,role) scoped_to (organism,condition)
I05: No biological function follows solely from a molecular formula.
SEMANTIC_EQUIVALENCE:
exact_identity: same normalised molecular entity under declared policy
structural_equivalence: same connectivity with declared stereo treatment
formula_equivalence: same elemental counts, not necessarily same molecule
functional_similarity: shared features; not identity
cross_domain_alignment: mapped identifiers with explicit evidence
guard: never collapse isomers, protonation states or distinct tautomers silently
CONFIDENCE:
score(assertion) in [0,1]
factors: source_reliability, evidence_directness, structure_validation,
reproducibility, contextual_fit, conflict_status
rule: confidence is evidence-based and not a mathematical proof of truth
conflict: preserve competing assertions with separate provenance and scores
PROVENANCE:
each_assertion:
source_id: string
source_type: curated_database|peer_reviewed|experiment|computed|user_supplied
retrieval_date: ISO8601?
method: string?
context: string?
evidence_reference: string?
confidence: float?
version: string
VALIDATION:
validate_types()
validate_chemical_structure()
validate_functional_groups()
validate_reaction_balance()
validate_contextual_claims()
validate_provenance()
validate_equivalence_policy()
on_failure: flag_and_quarantine_assertion; do_not_silently_accept
FLOW_HASH:
canonical_payload := canonical_serialisation(ontology_version,
entity_types, relations, assertions, provenance, equivalence_policy)
FLOW_HASH := SHA256(UTF8(canonical_payload))
# A hash detects changes; it does not establish scientific correctness.
UPDATE_MODEL:
ingest(new_evidence)
-> validate(new_evidence)
-> compare_with_existing_assertions
-> preserve_history_and_conflicts
-> revise_supported_assertions
-> recompute_confidence
-> recompute_FLOW_HASH
-> publish_versioned_graph
AI_CONSUMPTION:
inputs: molecule_identifier, representation, context, query
outputs: typed_entities, relationships, classifications, evidence,
uncertainty, validation_status, graph_version
requirements: cite provenance; distinguish measured from predicted;
state identity policy; report ambiguity and missing data;
prohibit unsupported biological or safety claims.
EXAMPLE_GRAPH:
entity: ethanol
formula: C2H6O
class: alcohol
functional_group: hydroxyl
relation: ethanol HAS_FUNCTIONAL_GROUP hydroxyl
caution: dimethyl_ether also has formula C2H6O but different connectivity
END FLOW
Download Code
Copy to Clipboard