FLOW ALGEBRA — MICROBIAL COMMUNITY ONTOLOGY
Version: 1.0 | Locale: en-GB | 23 October 2026
Authors: Mark Higgins — Sky (Recursive AI)
Source: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/microbial-entities/microbial-community-ontology.html
Status: Independently constructed formalisation; embedded source specification not available for direct comparison.
flow "MicrobialCommunityOntology" v1.0
# ---------- TYPES ----------
type MicrobialCommunity <: BiologicalCommunity
type MicrobialPopulation <: BiologicalPopulation
type Microorganism <: BiologicalOrganism
type Taxon <: BiologicalClassification
type Habitat <: Environment
type EnvironmentalFactor <: MeasurableFactor
type FunctionalGuild <: EcologicalGroup
type MetabolicProcess <: BiologicalProcess
type Interaction <: EcologicalRelationship
type Sample <: ObservationMaterial
type Observation <: EvidenceRecord
# ---------- ENTITY SCHEMA ----------
entity MicrobialCommunity {
id: Identifier
name: String
habitat: Habitat?
populations: Set<MicrobialPopulation>
sampling_time: Timestamp?
spatial_scope: SpatialRegion?
confidence: Real[0,1]
provenance: Set<Observation>
}
entity MicrobialPopulation {
id: Identifier
taxon: Taxon?
abundance: NonNegativeReal?
abundance_unit: String?
functional_guilds: Set<FunctionalGuild>
}
entity Observation {
id: Identifier
method: String
sample_id: Identifier?
timestamp: Timestamp?
source: String
quality: Real[0,1]
}
# ---------- TYPED RELATIONS ----------
relation HAS_POPULATION(MicrobialCommunity, MicrobialPopulation)
relation HAS_MEMBER(MicrobialPopulation, Microorganism)
relation OCCURS_IN(MicrobialCommunity, Habitat)
relation BELONGS_TO_TAXON(MicrobialPopulation, Taxon)
relation PERFORMS_FUNCTION(MicrobialPopulation, MetabolicProcess)
relation IN_GUILD(MicrobialPopulation, FunctionalGuild)
relation INTERACTS_WITH(MicrobialPopulation, MicrobialPopulation, Interaction)
relation INFLUENCED_BY(MicrobialCommunity, EnvironmentalFactor)
relation OBSERVED_IN(MicrobialCommunity, Sample)
relation SUPPORTED_BY(Assertion, Observation)
relation PART_OF(MicrobialCommunity, MicrobialCommunity)
# ---------- CONSTRAINTS ----------
constraint population_membership:
HAS_POPULATION(c,p) => c:MicrobialCommunity and p:MicrobialPopulation
constraint no_self_part:
not PART_OF(c,c)
constraint nonnegative_abundance:
p.abundance != null => p.abundance >= 0
constraint confidence_bounds:
forall a:Assertion, 0 <= CONFIDENCE(a) <= 1
constraint observational_scope:
observed_absence != proven_absence
constraint taxonomic_resolution:
uncertain_taxon != confirmed_species_identification
# ---------- INFERENCE ----------
rule community_contains_taxon:
HAS_POPULATION(c,p) and BELONGS_TO_TAXON(p,t)
=> CONTAINS_TAXON(c,t) [derived]
rule community_function:
HAS_POPULATION(c,p) and PERFORMS_FUNCTION(p,f)
=> HAS_POTENTIAL_FUNCTION(c,f) [derived, not proof of measured activity]
rule shared_habitat:
OCCURS_IN(c1,h) and OCCURS_IN(c2,h)
=> SHARES_HABITAT(c1,c2) [derived]
rule observed_interaction:
INTERACTS_WITH(p1,p2,i) and HAS_POPULATION(c,p1) and HAS_POPULATION(c,p2)
=> HAS_DOCUMENTED_INTERACTION(c,i) [requires evidence]
rule environmental_association:
INFLUENCED_BY(c,e) and SUPPORTED_BY(INFLUENCED_BY(c,e),o)
=> HAS_EVIDENCED_ENVIRONMENTAL_ASSOCIATION(c,e)
# ---------- COMMUNITY METRICS ----------
metric richness(c) := count(distinct confirmed taxa in c)
metric relative_abundance(p,c) := abundance(p) / sum_abundance(c)
precondition: compatible quantitative measurement units and sum_abundance(c)>0
metric shannon(c) := -sum_i(p_i * ln(p_i))
precondition: complete, comparable relative abundance vector; p_i>0
metric evenness(c) := shannon(c) / ln(richness(c))
precondition: richness(c)>1
note: Sampling bias, sequencing depth and detection limits must accompany metric interpretations.
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE("microbial assemblage", "microbial community")
scope: ecological usage; contextual, not unconditional identity
SEMANTIC_EQUIVALENCE("microbiota", "microbial community")
scope: context-dependent; distinguish from microbiome (which may include environment and functions)
SEMANTIC_EQUIVALENCE("biofilm", "microbial community")
scope: false as strict equivalence; biofilm is one organised community form
# ---------- CONFIDENCE ----------
CONFIDENCE(assertion) := clamp(
evidence_quality * method_reliability * taxonomic_resolution_factor * replication_factor,
0, 1)
note: Factors require calibration; formula is a declared heuristic, not empirical probability.
# ---------- PROVENANCE ----------
PROVENANCE(assertion) := {
observation_ids, source, collection_time, location_scope,
assay_method, processing_pipeline, version, reviewer
}
# ---------- FLOW HASH ----------
FLOW_HASH(assertion) := SHA256(canonical_serialisation(
ontology_version, subject, predicate, object, evidence_ids, scope
))
# ---------- UPDATE MODEL ----------
UPDATE_MODEL(new_observation):
validate_schema(new_observation)
retain_prior_evidence()
reconcile_taxonomic_identifiers()
recompute_affected_metrics()
recompute_confidence()
append_versioned_provenance()
invalidate_stale_derived_assertions()
recompute_FLOW_HASH()
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION {
expose: [entities, typed_relations, constraints, evidence, inference,
confidence, provenance, flow_hash, version]
preserve: [sample_scope, method, units, uncertainty, taxonomic_rank]
prohibit: [invented_abundance, unsupported_causality,
treating_potential_function_as_measured_activity]
output: evidence-linked, machine-readable community graph
}
# ---------- EXAMPLE (ILLUSTRATIVE ONLY) ----------
community C1: MicrobialCommunity { name: "Illustrative soil community" }
population P1: MicrobialPopulation { taxon: "Bacteria", abundance: null }
HAS_POPULATION(C1,P1)
OCCURS_IN(C1,"Soil habitat")
# No numerical abundance or taxonomic precision inferred from this example.
end flow
Download Code
Copy to Clipboard