FLOW ALGEBRA
Nucleic Acid Ontology — Macromolecular Entities
Kireth Semantic Library | Version 1.0 | 15 October 2026
Authors: Mark Anthony Higgins — Sky (Recursive AI)
Source: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/macromolecular-entities/nucleic-acid-ontology-2.html
PURPOSE
Formalise nucleic acids, nucleotide composition, sequence, structure, molecular roles,
biochemical transformations, and evidence-aware semantic reasoning.
This is an original ontology model aligned to the linked chapter topic; it is not a
verbatim transcription of the chapter's embedded code.
FLOW "NucleicAcidOntology" v1.0
NAMESPACE
biological_entity: BiologicalEntity
macromolecule: Macromolecule
nucleic_acid: NucleicAcid
nucleotide: Nucleotide
nucleoside: Nucleoside
nucleobase: Nucleobase
phosphate: PhosphateGroup
pentose: PentoseSugar
sequence: NucleotideSequence
structure: MolecularStructure
process: BiologicalProcess
evidence: EvidenceRecord
TYPE SYSTEM
entity NucleicAcid <: Macromolecule
id: URI
kind: enum {DNA, RNA, HYBRID, SYNTHETIC_ANALOGUE}
strandedness: enum {SINGLE, DOUBLE, MIXED, UNKNOWN}
topology: enum {LINEAR, CIRCULAR, BRANCHED, UNKNOWN}
sequence: NucleotideSequence?
length_nt: integer?
organism: URI?
cellular_location: URI?
provenance: EvidenceRecord[]
entity Nucleotide
base: Nucleobase
sugar: PentoseSugar
phosphate_count: integer >= 1
modifications: URI[]
entity Nucleoside
base: Nucleobase
sugar: PentoseSugar
entity Nucleobase
identity: enum {ADENINE, GUANINE, CYTOSINE, THYMINE, URACIL, MODIFIED, OTHER}
family: enum {PURINE, PYRIMIDINE, OTHER}
entity PentoseSugar
identity: enum {RIBOSE, DEOXYRIBOSE, MODIFIED}
entity NucleotideSequence
alphabet: enum {DNA, RNA, EXTENDED}
symbols: string
orientation: enum {FIVE_TO_THREE, THREE_TO_FIVE, UNKNOWN}
reference: URI?
entity EvidenceRecord
source: URI
method: string?
timestamp: datetime?
confidence: real in [0,1]
limitations: string[]
RELATIONSHIP SIGNATURES
HAS_MONOMER: NucleicAcid -> Nucleotide
HAS_SEQUENCE: NucleicAcid -> NucleotideSequence
HAS_BASE: Nucleotide -> Nucleobase
HAS_SUGAR: Nucleotide -> PentoseSugar
HAS_PHOSPHATE: Nucleotide -> PhosphateGroup
LINKED_BY: Nucleotide x Nucleotide -> PhosphodiesterBond
COMPLEMENTARY_TO: Nucleobase -> Nucleobase
BASE_PAIRS_WITH: Nucleotide -> Nucleotide
TRANSCRIBED_FROM: RNA -> DNA
REPLICATED_FROM: DNA -> DNA
TRANSLATED_INTO: MessengerRNA -> Polypeptide
CATALYSES: Ribozyme -> BiologicalProcess
ENCODES: NucleicAcid -> BiologicalProduct
REGULATES: RegulatoryRNA -> BiologicalProcess
LOCATED_IN: NucleicAcid -> CellularCompartment
DERIVED_FROM: NucleicAcid -> NucleicAcid
SUPPORTED_BY: Assertion -> EvidenceRecord
CLASSIFICATION RULES
rule DNA_DEFAULT:
IF acid.kind == DNA AND acid is canonical
THEN expected_sugar = DEOXYRIBOSE
expected_alphabet = {A,C,G,T}
EXCEPT chemically_modified_or_noncanonical_instances
rule RNA_DEFAULT:
IF acid.kind == RNA AND acid is canonical
THEN expected_sugar = RIBOSE
expected_alphabet = {A,C,G,U}
EXCEPT chemically_modified_or_noncanonical_instances
rule PURINE:
IF base.identity IN {ADENINE, GUANINE}
THEN base.family = PURINE
rule PYRIMIDINE:
IF base.identity IN {CYTOSINE, THYMINE, URACIL}
THEN base.family = PYRIMIDINE
rule NUCLEOSIDE_VS_NUCLEOTIDE:
IF component = base + sugar AND phosphate_count == 0
THEN classify(component, Nucleoside)
IF component = base + sugar + one_or_more_phosphates
THEN classify(component, Nucleotide)
SEQUENCE AND STRUCTURE
constraint VALID_DNA_SEQUENCE:
canonical(DNA) -> all(symbol IN {A,C,G,T} for symbol IN sequence)
constraint VALID_RNA_SEQUENCE:
canonical(RNA) -> all(symbol IN {A,C,G,U} for symbol IN sequence)
constraint SEQUENCE_LENGTH:
length_nt = count_nucleotide_positions(sequence)
constraint BACKBONE:
canonical_polynucleotide -> successive_monomers_linked_by_3prime_5prime_phosphodiester_bonds
rule CANONICAL_DNA_PAIRING:
A <-> T
G <-> C
rule CANONICAL_RNA_PAIRING:
A <-> U
G <-> C
note PAIRING_CONTEXT:
Complementarity is context-dependent; wobble pairs, mismatches, and modified
nucleotides can occur. Antiparallel orientation applies to canonical duplexes.
note STRUCTURE_LEVELS:
primary = covalent nucleotide sequence
secondary = local base-pairing patterns
tertiary = three-dimensional conformation
quaternary = multi-chain or complex-level assembly where applicable
BIOLOGICAL SUBTYPES
DNA:
genomic_DNA; mitochondrial_DNA; chloroplast_DNA; plasmid_DNA; viral_DNA
RNA:
messenger_RNA; ribosomal_RNA; transfer_RNA; small_nuclear_RNA
small_nucleolar_RNA; microRNA; small_interfering_RNA
long_non_coding_RNA; ribozyme_RNA; viral_RNA
caution:
Subtypes overlap by role, location and origin; they are not necessarily disjoint.
BIOCHEMICAL TRANSFORMATIONS
process DNA_REPLICATION:
inputs: template_DNA, deoxyribonucleoside_triphosphates, replication_machinery
outputs: daughter_DNA
relation: REPLICATED_FROM(daughter_DNA, template_DNA)
constraints: template_dependence, strand_polarity, fidelity_mechanisms
process TRANSCRIPTION:
inputs: DNA_template, ribonucleoside_triphosphates, RNA_polymerase
outputs: RNA_transcript
relation: TRANSCRIBED_FROM(RNA_transcript, DNA_template)
process RNA_PROCESSING:
possible_operations: capping, splicing, polyadenylation, editing, cleavage
applicability: organism_and_RNA_type_dependent
process REVERSE_TRANSCRIPTION:
inputs: RNA_template, reverse_transcriptase, deoxyribonucleoside_triphosphates
outputs: complementary_DNA
note: occurs in specific biological and laboratory contexts
process TRANSLATION:
inputs: coding_mRNA, ribosome, charged_tRNAs, translation_factors
outputs: polypeptide
note: not every RNA is translated
process NUCLEIC_ACID_DEGRADATION:
agents: nucleases, chemical_hydrolysis, environmental_factors
outputs: shorter_oligonucleotides_or_nucleotide_products
FUNCTIONAL SEMANTICS
DNA -> information_storage_and_heritable_template [context_dependent]
mRNA -> coding_information_carrier [where_coding]
rRNA -> ribosome_structural_and_catalytic_component
tRNA -> adaptor_in_translation
regulatory_RNA -> expression_regulation [subtype_dependent]
ribozyme -> RNA_based_catalysis
viral_nucleic_acid -> viral_genome [DNA_or_RNA]
REASONING RULES
rule COMPOSITION_INFERENCE:
IF HAS_MONOMER(acid, nucleotide)
THEN component_of(nucleotide, acid)
rule DNA_RNA_DISTINCTION:
IF canonical(acid) AND sugar = RIBOSE AND uracil_in_sequence
THEN support_classification(acid, RNA)
NOT assert_certain_without_context
rule TRANSCRIPTION_PROVENANCE:
IF TRANSCRIBED_FROM(rna, dna) AND SUPPORTED_BY(assertion, evidence)
THEN propagate_provenance(rna, evidence)
rule FUNCTIONAL_INFERENCE:
IF subtype(rna, transfer_RNA) AND verified_identity(rna)
THEN candidate_function(rna, translation_adaptor)
rule NON_EQUIVALENCE:
DNA != RNA
nucleotide != nucleoside
nucleic_acid != protein
transcription != translation
SEMANTIC_EQUIVALENCE
exact:
"deoxyribonucleic acid" == "DNA"
"ribonucleic acid" == "RNA"
"messenger RNA" == "mRNA"
"transfer RNA" == "tRNA"
"ribosomal RNA" == "rRNA"
contextual:
"polynucleotide" ~ "nucleic acid" ONLY IF chemical_and_structural_scope_matches
"genetic material" ~ "nucleic acid" ONLY IN specified_biological_context
forbidden:
"nucleotide" != "nucleic acid polymer"
"nucleobase" != "nucleotide"
CONFIDENCE
evidence_weight:
experimentally_verified_sequence: HIGH
curated_reference_annotation: HIGH
computational_prediction: VARIABLE
unverified_textual_assertion: LOW
aggregation:
confidence(assertion) = calibrated_evidence_aggregation(
source_quality, method_reliability, independence, consistency, context
)
constraint:
do_not_assign_numeric_certainty_without_calibration
do_not_treat_correlated_sources_as_independent
RECURSIVE_REASONING
input: nucleic_acid_entity
repeat_until fixed_point OR iteration_limit:
resolve_type_and_subtype()
validate_composition_and_sequence()
infer_structural_relations()
infer_process_participation()
check_evidence_and_conflicts()
propagate_qualified_relationships()
terminate_on: stable_graph OR unresolved_conflict OR iteration_limit
safeguard: no_unbounded_self_inference
PROVENANCE_AND_VALIDATION
require_source_for: sequence_claim, structural_claim, functional_claim
detect: conflicting_sequence, invalid_alphabet, missing_orientation
detect: unsupported_function, incorrect_monomer_classification
preserve: source_URI, revision, method, evidence_timestamp
report: inferred_vs_observed, uncertainty, exceptions
FLOW_HASH
canonicalise:
normalise_identifiers
sort_unordered_assertions
preserve_ordered_sequences
include_ontology_version_and_rule_set
digest: SHA256(canonical_serialisation)
note: digest is computed by an implementation, not asserted as a fixed value here
UPDATE_MODEL
on_new_evidence:
verify_source()
compare_with_existing_assertions()
update_versioned_graph_without_destroying_provenance()
recompute_affected_inferences()
recalibrate_confidence()
recompute_FLOW_HASH()
log_changes_and_conflicts()
AI_CONSUMPTION
expose:
typed_entities
typed_relationships
validated_sequences
qualified_inferences
provenance_and_confidence
contradictions_and_unknowns
ontology_version
FLOW_HASH
restrictions:
distinguish_observation_from_inference
preserve_chemical_and_biological_context
never_infer_specific_sequence_from_molecule_class_alone
never_infer_gene_function_from_sequence_without_sufficient_evidence
do_not_conflate_DNA_RNA_and_protein
OUTPUT
entity_graph: validated_typed_graph
reasoning_trace: evidence_linked_inference_steps
confidence_report: calibrated_if_available
update_log: versioned_changes
flow_hash: computed_at_runtime
END FLOW
Download Code
Copy to Clipboard