FLOW ALGEBRA
TITLE: Containment Ontology
DOMAIN: Relationship Ontologies / Spatial Relationships
SOURCE: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/spatial-relationships/containment-ontology.html
VERSION: 1.0
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; source-page specification not independently verified.
flow "ContainmentOntology" v1.0 {
ontology:
id: "containment-ontology"
parent: "spatial-relationships"
purpose: "Represent and validate topological and geographic containment relationships with explicit boundary, reference-frame and temporal semantics."
types:
SpatialEntity: {id: string, kind: enum[point, line, polygon, solid, region, geographic_feature, other], geometry_id: string?, crs: string?, valid_time: string?}
Geometry: {id: string, geometry_type: string, coordinates: string, crs: string, precision: number?}
ContainmentAssertion: {id: string, contained: string, container: string, predicate: string, boundary_policy: string, timestamp: datetime?, confidence: number, evidence: string[], provenance: string}
Observation: {id: string, method: string, timestamp: datetime, uncertainty: number?, provenance: string}
predicates:
contains(container: SpatialEntity, contained: SpatialEntity)
strictly_contains(container: SpatialEntity, contained: SpatialEntity)
within(contained: SpatialEntity, container: SpatialEntity)
covers(container: SpatialEntity, contained: SpatialEntity)
covered_by(contained: SpatialEntity, container: SpatialEntity)
intersects(a: SpatialEntity, b: SpatialEntity)
touches(a: SpatialEntity, b: SpatialEntity)
disjoint(a: SpatialEntity, b: SpatialEntity)
constraints:
- "Resolve all relationship endpoints to typed spatial entities and valid geometries."
- "Transform geometries into a compatible coordinate reference system before topological evaluation."
- "Specify whether boundary contact is allowed: strict containment and boundary-inclusive coverage differ."
- "Use one declared topology convention consistently; do not equate contains with covers."
- "Containment is not generally symmetric; inverse assertions must reverse the argument order."
- "Do not infer containment from bounding-box overlap, geographic names or proximity alone."
- "Validate geometry, dimensionality, measurement precision and temporal applicability."
- "Confidence must lie within [0, 1]."
inference:
rule inverse_contains:
if contains(a,b)
then within(b,a)
confidence: "preserve source confidence, topology and evidence"
rule inverse_covers:
if covers(a,b)
then covered_by(b,a)
confidence: "preserve source confidence, topology and evidence"
rule containment_transitivity:
if contains(a,b) and contains(b,c) and compatible_topology(a,b,c) and same_valid_time(a,b,c)
then contains(a,c)
confidence: "conservative propagation with recorded inference path"
rule coverage_transitivity:
if covers(a,b) and covers(b,c) and compatible_topology(a,b,c) and same_valid_time(a,b,c)
then covers(a,c)
confidence: "conservative propagation with recorded inference path"
rule strict_containment_implies_disjoint_boundaries:
if strictly_contains(a,b) and valid_geometry(a,b)
then boundaries_do_not_intersect(a,b)
confidence: "dependent on strict-containment definition"
SEMANTIC_EQUIVALENCE:
- "Map contains/within and covers/covered_by as inverse pairs, not interchangeable predicates."
- "Distinguish topological containment from administrative jurisdiction, ownership and organisational membership."
- "Normalise place identifiers and coordinate reference systems while retaining source geometry and epoch."
CONFIDENCE:
range: [0,1]
factors: [geometry_accuracy, boundary_uncertainty, source_reliability, temporal_validity, topology_consistency]
policy: "Do not manufacture certainty by chaining inferred relationships."
VALIDATION:
- "Check geometry validity, CRS compatibility, dimensions, topology convention and boundary policy."
- "Flag incompatible contains/disjoint assertions for the same entities and time."
- "Retain uncertain or competing boundaries with provenance instead of forcing a single answer."
- "Test inverse and transitive rules using valid spatial fixtures."
FLOW_HASH:
algorithm: "SHA-256"
input: "canonicalised ontology version, typed assertions, rules, geometry references and provenance"
note: "Compute hash at execution; no hash value is claimed here."
UPDATE_MODEL:
strategy: "versioned, provenance-preserving incremental update"
steps: [ingest, normalise, validate, compare, reconcile, recompute_inferences, publish]
rollback: true
AI_CONSUMPTION:
representation: "typed spatial knowledge graph with topology-aware, evidence-backed edges"
outputs: [containment_triples, inverse_relations, inferred_relations, boundary_annotations, uncertainty_annotations, provenance_records]
safeguards: [no_unverified_containment, preserve_boundary_semantics, preserve_crs_and_time, no_unjustified_identity_merges]
}
END FLOW ALGEBRA
Download Code
Copy to Clipboard