FLOW ALGEBRA
Keystone Species Ontology — Full Flow Algebra v1.0
Kireth Semantic Library | 2026-10-26
Authors: Mark Higgins — Sky (Recursive AI)
Source topic: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/ecological-entities/keystone-species-ontology.html
Status: Proposed formalisation; not a verbatim extraction or validated executable implementation.
flow "KeystoneSpeciesOntology" v1.0
# 01 — PURPOSE
# Model context-dependent, disproportionately influential species in ecological communities.
# Keystone status is an evidence-based ecological role, not a permanent taxonomic trait.
ontology:
id: "kireth:ecology:keystone-species"
parent: "kireth:ecology:ecological-entity"
locale: "en-GB"
scope: [species, population, community, ecosystem, interaction, evidence]
# 02 — TYPED ENTITIES
entity Species:
id: iri
scientific_name: str
taxon_id: iri?
entity Population:
id: iri
species: Species
ecosystem_id: iri
abundance: float? # non-negative; explicit units and survey context
entity Ecosystem:
id: iri
biome_id: iri?
spatial_extent: str
temporal_extent: str
entity Community:
id: iri
ecosystem: Ecosystem
member_populations: set<Population>
entity EcologicalInteraction:
id: iri
source_population: Population
target_population: Population?
interaction_type: enum[predation, herbivory, competition, facilitation,
mutualism, parasitism, habitat_engineering, other]
effect_direction: enum[positive, negative, mixed, unknown]
evidence_id: iri?
entity EcologicalFunction:
id: iri
function_type: enum[trophic_regulation, habitat_formation, nutrient_cycling,
disturbance_mediation, resource_provision, other]
measurement: float?
units: str?
entity KeystoneAssessment:
id: iri
focal_population: Population
community: Community
reference_state: str
counterfactual: str
measured_effect: float?
effect_metric: str?
relative_abundance: float?
disproportionate_effect: bool?
classification: enum[supported, not_supported, uncertain]
confidence: float
evidence_ids: set<iri>
assessed_at: datetime
entity Evidence:
id: iri
method: enum[removal_experiment, natural_experiment, longitudinal_observation,
comparative_study, mechanistic_model, expert_assessment]
citation: str
uncertainty: str?
limitations: str?
# 03 — RELATIONSHIP TYPES
relationship MEMBER_OF(Population, Community)
relationship INHABITS(Population, Ecosystem)
relationship INTERACTS_WITH(Population, Population)
relationship CONTRIBUTES_TO(Population, EcologicalFunction)
relationship MODULATES(Population, EcologicalInteraction)
relationship ASSESSED_IN(KeystoneAssessment, Community)
relationship SUPPORTED_BY(KeystoneAssessment, Evidence)
relationship DEPENDS_ON(EcologicalFunction, Population)
relationship CASCADES_TO(EcologicalInteraction, EcologicalInteraction)
# 04 — DERIVED CONCEPTS
# Impact may be estimated from observed or modelled change relative to a
# specified counterfactual. A simple ratio is illustrative, not a universal
# ecological definition or threshold.
function relative_impact(effect_magnitude: float, relative_abundance: float) -> float?:
require effect_magnitude >= 0
require 0 <= relative_abundance <= 1
if relative_abundance == 0: return null
return effect_magnitude / relative_abundance
function evaluate_keystone(a: KeystoneAssessment) -> str:
require 0 <= a.confidence <= 1
if a.evidence_ids is empty: return "uncertain"
if a.disproportionate_effect == null: return "uncertain"
if a.disproportionate_effect == true and a.confidence >= 0.8:
return "supported"
if a.disproportionate_effect == false and a.confidence >= 0.8:
return "not_supported"
return "uncertain"
# 0.8 is a configurable workflow threshold, not an ecological constant.
# 05 — INFERENCE RULES
rule "ContextSpecificKeystone":
when assessment.classification == supported
infer KEYSTONE_IN(assessment.focal_population, assessment.community,
assessment.reference_state)
rule "PossibleTrophicCascade":
when predator_population regulates prey_population
and prey_population influences third_population
and supported_evidence_exists
infer POSSIBLE_INDIRECT_EFFECT(predator_population, third_population)
confidence: derived_from_evidence
rule "HabitatEngineeringEffect":
when population alters habitat_structure
and habitat_structure affects community_members
infer POSSIBLE_COMMUNITY_WIDE_EFFECT(population)
require independent_validation
rule "ContextTransferRestriction":
when KEYSTONE_IN(population, community_A, reference_A)
do_not_infer KEYSTONE_IN(population, community_B, reference_B)
unless evidence_supports_transfer
# 06 — INVARIANTS AND VALIDATION
invariant "SpeciesIdentity": Population.species.id != null
invariant "CommunityMembership": assessment.focal_population in assessment.community.member_populations
invariant "ConfidenceRange": 0 <= assessment.confidence <= 1
invariant "AbundanceRange": relative_abundance == null or 0 <= relative_abundance <= 1
invariant "EvidenceRequired": classification == supported implies size(evidence_ids) > 0
invariant "CounterfactualRequired": classification == supported implies counterfactual != ""
invariant "NoUniversalKeystone": keystone_role is indexed by ecological_context
invariant "NoAutomaticCausality": observational_association != proven_causal_effect
# 07 — SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE:
"keystone species": context_dependent_ecological_role
"keystone taxon": related_term_not_always_exact_equivalent
"foundation species": overlapping_but_distinct_concept
"ecosystem engineer": overlapping_but_distinct_concept
"dominant species": abundance_based_role_not_synonymous
"indicator species": monitoring_role_not_synonymous
# 08 — CONFIDENCE AND PROVENANCE
CONFIDENCE:
scale: [0.0, 1.0]
factors: [study_design, replication, effect_size, measurement_uncertainty,
temporal_coverage, spatial_coverage, causal_identification]
rule: "Do not infer certainty from the label 'keystone'."
PROVENANCE:
required: [source_id, observation_or_model, date, ecosystem_context]
recommended: [citation, data_version, methodology, limitations]
# 09 — FLOW HASH
FLOW_HASH:
algorithm: sha256
canonicalise: [ontology_id, version, entity_ids, typed_relations,
assessment_context, evidence_ids, inference_rules]
exclude: [presentation_whitespace, nonsemantic_comments]
output: lowercase_hex_digest
note: "Compute from canonical serialisation; no digest is invented here."
# 10 — UPDATE MODEL
UPDATE_MODEL:
events: [new_field_evidence, revised_population_estimate,
ecosystem_change, reanalysis, contradictory_evidence]
operations: [validate, version, recompute_assessments,
invalidate_stale_inferences, preserve_provenance]
never_overwrite: historical_assessments
# 11 — AI CONSUMPTION
AI_CONSUMPTION:
expose: [typed_entities, relationship_graph, assessment_context,
confidence, evidence, counterfactual, limitations, flow_hash]
response_rules:
- "State the ecosystem and timeframe when calling a species keystone."
- "Separate observed effects from modelled predictions."
- "Distinguish correlation, mechanism and experimentally supported causation."
- "Do not confuse high abundance with disproportionate influence."
- "Report uncertainty and competing interpretations."
# 12 — ILLUSTRATIVE CASE (NOT ASSERTED OBSERVATIONAL DATA)
example:
species: "Hypothetical predator species"
community: "Example coastal food web"
mechanism: "Predator suppresses grazer, indirectly benefiting vegetation"
assessment: uncertain
reason: "No study citation or measured counterfactual supplied"
# 13 — CROSS-ONTOLOGY LINKS
links:
- ecological-entity-ontology
- individual-organism-entity-ontology
- population-ontology
- biological-community-ontology
- ecosystem-ontology
- food-chain-ontology
- trophic-level-ontology
- predator-ontology
- prey-ontology
- ecological-niche-ontology
# END FLOW
Download Code
Copy to Clipboard