FLOW ALGEBRA
Viral Variant Ontology — Kireth Semantic Library
Version: 1.0 | Locale: en-GB
Source reference: https://kirethresearch.org/booksai-core/entity-graph/biological-entities/viral-and-subcellular-infectious-entities/viral-variant-ontology.html
Status: Independently constructed formalisation; not a verified transcription of the webpage.
Authors: Mark Higgins — Sky (Recursive AI)
flow "ViralVariantOntology" v1.0
# DOMAIN
ontology.id: "biological.viral_and_subcellular_infectious_entities.viral_variant"
ontology.label: "Viral Variant Ontology"
ontology.parent: "Virus Ontology"
ontology.scope: "Classification and evidence-based description of viral genetic variants and lineages"
# TYPED ENTITIES
entity ViralVariant: ViralEntity {
id: URI
label: str
reference_virus: URI
defining_mutations: list[URI]
lineage: URI?
first_observed: date?
evidence: list[URI]
confidence: float[0..1]
}
entity ViralLineage: ViralEntity { id: URI; parent_lineage: URI?; classification_scheme: str? }
entity ViralGenome: GeneticEntity { id: URI; sequence_accession: str?; reference_accession: str? }
entity GeneticMutation: GeneticChange { id: URI; position: str?; reference_allele: str?; alternate_allele: str?; mutation_type: str? }
entity ViralSample: BiologicalSample { id: URI; collection_date: date?; location: str? }
entity SequenceEvidence: Evidence { id: URI; accession: str?; method: str?; quality_status: str? }
entity PhenotypicObservation: Evidence { id: URI; phenotype: str; experimental_context: str; uncertainty: str? }
entity ClassificationAssertion: Assertion { id: URI; scheme: str; version: str; assigned_at: date? }
# RELATIONSHIPS
relationship VARIANT_OF(ViralVariant, Virus)
relationship HAS_GENOME(ViralVariant, ViralGenome)
relationship HAS_DEFINING_MUTATION(ViralVariant, GeneticMutation)
relationship MEMBER_OF_LINEAGE(ViralVariant, ViralLineage)
relationship DESCENDS_FROM(ViralLineage, ViralLineage)
relationship OBSERVED_IN(ViralVariant, ViralSample)
relationship SUPPORTED_BY(Assertion, Evidence)
relationship ASSIGNED_CLASSIFICATION(ViralVariant, ClassificationAssertion)
relationship HAS_OBSERVED_PHENOTYPE(ViralVariant, PhenotypicObservation)
relationship SEMANTIC_EQUIVALENCE(Entity, Entity, context: str)
# CONSTRAINTS
constraint confidence_range: 0.0 <= confidence <= 1.0
constraint mutation_requires_reference: GeneticMutation.position requires reference_genome identifier
constraint sequence_identity: identical lineage names do not imply identical genomes
constraint lineage_versioning: classification labels must retain scheme and version
constraint non_determinism: mutation presence alone does not establish altered transmissibility, virulence, immune escape, or drug resistance
constraint sampling_bias: first_observed is not necessarily time_of_origin
constraint taxonomy: variant, strain, lineage and species are distinct concepts; do not treat as interchangeable
# INFERENCE RULES
rule "sequence-supported-variant":
when ViralSample has quality-controlled sequence evidence and a supported defining mutation set
then infer candidate ViralVariant assignment
confidence from evidence quality and classification agreement
rule "lineage-membership":
when variant genome matches versioned lineage assignment criteria
then infer MEMBER_OF_LINEAGE with classification provenance
rule "phenotype-requires-evidence":
when experimentally measured phenotype is linked to a variant under stated conditions
then infer HAS_OBSERVED_PHENOTYPE
do_not_infer population-level causal effect without suitable supporting evidence
rule "updated-classification":
when a lineage scheme is revised
then preserve historical classification and append new versioned assertion
# CONFIDENCE
CONFIDENCE(assertion) := calibrated_score(
evidence_quality,
sample_coverage,
classification_consistency,
method_validity,
uncertainty
)
CONFIDENCE never substitutes for evidence or validation.
# SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE(a,b) := true only when
same_referent(a,b) AND compatible_scheme_version(a,b)
Alias matching alone yields candidate equivalence, not identity.
# PROVENANCE
PROVENANCE(assertion) := {
source_identifier,
accession_or_publication,
collection_date?,
classification_scheme_version?,
inference_rule_version,
generated_at,
evidence_quality
}
# FLOW HASH
FLOW_HASH(record) := SHA256(canonical_serialisation(
ontology.id, entity.id, typed_relations, evidence_ids,
classification_versions, inference_rule_version
))
# Cryptographic hashing is a specification requirement; this text file does not compute hashes.
# UPDATE MODEL
UPDATE_MODEL(event):
validate_schema(event)
append_evidence(event)
re_evaluate_affected_assertions()
preserve_previous_versions()
recompute_confidence()
recompute_flow_hash()
publish_audit_trail()
# AI CONSUMPTION
AI_CONSUMPTION:
output: typed_entity_graph
require: evidence_linked_assertions
include: confidence, provenance, version, uncertainty
distinguish: observed_fact, inferred_relationship, hypothesis
prohibit: unsupported phenotype claims and unqualified risk rankings
# EXAMPLE (ILLUSTRATIVE ONLY)
example:
variant: "Example Variant A"
reference_virus: "Example Virus"
lineage: "Example Lineage 1"
defining_mutations: ["example-change-1"]
status: "hypothetical; not a real-world classification"
end flow
Download Code
Copy to Clipboard