FLOW ALGEBRA
TITLE: Direction Relationship Ontology
DOMAIN: Spatial Relationships / Direction
SOURCE: https://kirethresearch.org/booksai-core/ontologies/relationship-ontologies/spatial-relationships/direction-relationship-ontology.html
VERSION: 1.0
AUTHORS: Mark Anthony Higgins — Sky (Recursive AI)
STATUS: Companion formalisation; source-page specification not independently verified.
flow "DirectionRelationshipOntology" v1.0 {
ontology:
id: "direction-relationship-ontology"
parent: "spatial-relationships"
purpose: "Represent and validate directional relations between spatial entities in explicit reference frames and temporal contexts."
types:
SpatialEntity: {id: string, geometry_ref: string?, location_ref: string?}
ReferenceFrame: {id: string, kind: enum[geographic, projected, local, body_relative, astronomical, other], crs: string?, orientation: string?, epoch: datetime?}
Direction: {kind: enum[north, south, east, west, northeast, northwest, southeast, southwest, above, below, left, right, forward, backward, bearing, vector], bearing_degrees: number?, vector: number[]?, unit: string?}
Observation: {id: string, timestamp: datetime?, method: string, uncertainty: number?, provenance: string}
DirectionRelation: {id: string, subject: string, object: string, direction: Direction, frame: string, timestamp: datetime?, confidence: number, evidence: string[]}
predicates:
direction_of(a: SpatialEntity, b: SpatialEntity, d: Direction, frame: ReferenceFrame)
north_of(a: SpatialEntity, b: SpatialEntity, frame: ReferenceFrame)
east_of(a: SpatialEntity, b: SpatialEntity, frame: ReferenceFrame)
above(a: SpatialEntity, b: SpatialEntity, frame: ReferenceFrame)
bearing_from(a: SpatialEntity, b: SpatialEntity, angle: number, frame: ReferenceFrame)
oriented_relative_to(a: SpatialEntity, b: SpatialEntity, frame: ReferenceFrame)
constraints:
- "Every directional assertion must resolve both spatial endpoints and a reference frame."
- "Confidence must lie within [0, 1]."
- "Bearing angles use degrees normalised to [0, 360); zero direction and rotation convention must be declared."
- "Body-relative directions require observer orientation and observation time when applicable."
- "Do not compare coordinates from incompatible CRS without a validated transformation."
- "Direction is not automatically transitive across mixed frames, curved surfaces, or moving reference points."
- "Vertical direction must identify its gravity, altitude or coordinate-axis convention."
inference:
rule inverse_cardinal:
if north_of(a,b,f) and same_frame_and_epoch(a,b,f)
then south_of(b,a,f)
confidence: "inherit evidence and uncertainty"
rule inverse_bearing:
if bearing_from(a,b,theta,f) and planar_euclidean_frame(f) and valid_positions(a,b)
then bearing_from(b,a,(theta + 180) mod 360,f)
confidence: "preserve measurement uncertainty; do not apply blindly to geodesic initial bearings"
rule relative_direction:
if direction_of(a,b,d,f) and transform_valid(f,g)
then direction_of(a,b,transform_direction(d,f,g),g)
confidence: "account for transformation uncertainty"
SEMANTIC_EQUIVALENCE:
- "Normalise directional aliases only within matching frame and orientation conventions."
- "Distinguish north-of, bearing, facing, movement direction and line-of-sight."
- "Preserve CRS, epoch, reference point and direction precision."
CONFIDENCE:
range: [0,1]
factors: [position_uncertainty, orientation_uncertainty, reference_frame_quality, source_reliability, temporal_validity]
policy: "Never increase certainty merely by composing directional inferences."
VALIDATION:
- "Check typed endpoints, frame compatibility, angle normalisation, time and provenance."
- "Flag contradictory directions under equivalent contexts, accounting for uncertainty and tolerances."
- "Reject unsupported inverse or transitive conclusions."
FLOW_HASH:
algorithm: "SHA-256"
input: "canonicalised ontology version, typed assertions, rules, frame definitions and provenance"
note: "Compute hash at execution; no hash value is claimed here."
UPDATE_MODEL:
strategy: "versioned, provenance-preserving incremental update"
steps: [ingest, normalise, transform_frames, validate, compare, reconcile, recompute_inferences, publish]
rollback: true
AI_CONSUMPTION:
representation: "typed spatial knowledge graph with frame-aware directional edges"
outputs: [direction_triples, reference_frame_annotations, bearing_values, uncertainty_annotations, provenance_records]
safeguards: [no_frame_free_direction_claims, no_unsupported_transitivity, preserve_orientation_and_epoch]
}
END FLOW ALGEBRA
Download Code
Copy to Clipboard