FLOW ALGEBRA
Ontology: Spatial Metadata Ontology
Domain: Metadata Ontologies > Spatial Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/spatial-metadata/spatial-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "SpatialMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: SpatialMetadata
subject: SpatialMetadata
purpose:
- represent spatial characteristics of resources
- encode geographic and geometric location
- describe spatial extent and reference systems
- preserve spatial context for discovery and reuse
- support machine-readable spatial reasoning
# ---------- CORE ENTITY ----------
entity SpatialMetadata:
type: MetadataEntity
describes: SpatialResource
requires:
- spatial_context
may_include:
- location
- coordinates
- coordinate_reference_system
- geometry
- spatial_extent
- bounding_box
- spatial_resolution
- spatial_scale
- elevation
- spatial_accuracy
- spatial_relationship
- place_name
- place_identifier
- provenance
entity SpatialResource:
type: Resource
has_metadata: SpatialMetadata
entity SpatialLocation:
type: SpatialEntity
may_be:
- PointLocation
- NamedLocation
- GeographicArea
- GeometricRegion
entity Coordinate:
type: SpatialPositionValue
components:
- horizontal_position
- vertical_position_optional
interpreted_by: CoordinateReferenceSystem
entity CoordinateReferenceSystem:
type: SpatialReferenceFramework
defines:
- datum
- coordinate_system
- projection_optional
- axis_order
- units
entity Geometry:
type: SpatialRepresentation
forms:
- Point
- LineString
- Polygon
- MultiPoint
- MultiLineString
- MultiPolygon
- GeometryCollection
entity SpatialExtent:
type: SpatialCoverage
represents: GeographicOrGeometricBounds
entity BoundingBox:
type: SpatialExtentRepresentation
requires:
- minimum_position
- maximum_position
entity SpatialResolution:
type: SpatialGranularity
describes: MinimumMeaningfulSpatialDetail
entity SpatialAccuracy:
type: QualityMetadata
describes: PositionalReliability
# ---------- RELATIONSHIPS ----------
relationships:
SpatialMetadata -> DESCRIBES -> SpatialResource
SpatialResource -> HAS_LOCATION -> SpatialLocation
SpatialLocation -> MAY_HAVE_COORDINATE -> Coordinate
Coordinate -> USES -> CoordinateReferenceSystem
SpatialResource -> MAY_HAVE_GEOMETRY -> Geometry
Geometry -> DEFINES -> SpatialExtent
SpatialExtent -> MAY_HAVE_BOUNDING_BOX -> BoundingBox
SpatialMetadata -> MAY_DECLARE -> SpatialResolution
SpatialMetadata -> MAY_DECLARE -> SpatialAccuracy
SpatialLocation -> MAY_HAVE -> Elevation
NamedLocation -> MAY_HAVE -> PlaceIdentifier
SpatialEntity -> MAY_HAVE_RELATIONSHIP -> SpatialEntity
SpatialMetadata -> MAY_REFERENCE -> Provenance
# ---------- LOCATION RULES ----------
rule location_identity:
IF location is represented by coordinates
THEN coordinates MUST be interpretable within a spatial reference context
rule named_location:
IF place_name is used
THEN preserve associated jurisdiction or identifier where available
to reduce geographic ambiguity
rule coordinate_reference:
IF coordinates are present
THEN CoordinateReferenceSystem SHOULD be explicit
unless representation has an unambiguous standard CRS
# ---------- COORDINATE RULES ----------
rule coordinate_order:
coordinate axis order MUST follow declared CRS semantics
rule coordinate_validity:
FOR each Coordinate
VALIDATE values according_to CoordinateReferenceSystem
rule vertical_reference:
IF elevation is supplied
THEN vertical datum or reference SHOULD be declared
# ---------- GEOMETRY ----------
rule geometry_validity:
Geometry MUST conform to its declared geometry type
rule polygon:
IF Geometry.type = Polygon
THEN boundary SHOULD form valid closed rings
according_to encoding semantics
rule geometry_extent:
IF Geometry exists
THEN SpatialExtent may_be derived from Geometry
rule bounding_box:
IF BoundingBox exists
THEN minimum_position MUST NOT exceed maximum_position
under declared axis semantics
# ---------- SPATIAL RELATIONSHIPS ----------
spatial_relationships:
topological:
- equals
- disjoint
- intersects
- touches
- crosses
- within
- contains
- overlaps
directional:
- north_of
- south_of
- east_of
- west_of
- above
- below
distance:
- near
- far
- distance_from
rule inverse:
IF A contains B
THEN B within A
rule symmetry:
IF A intersects B
THEN B intersects A
rule distance_semantics:
IF distance relationship is asserted
THEN measurement unit SHOULD be explicit
rule near_semantics:
IF A near B
THEN threshold or contextual definition SHOULD be available
for deterministic machine interpretation
# ---------- RESOLUTION / ACCURACY / SCALE ----------
rule resolution:
SpatialResolution describes represented spatial detail
AND MUST NOT automatically imply SpatialAccuracy
rule accuracy:
SpatialAccuracy describes positional reliability
AND MUST NOT be inferred solely from coordinate decimal precision
rule scale:
IF SpatialScale affects valid interpretation
THEN preserve scale metadata during transformation and reuse
# ---------- CRS TRANSFORMATION ----------
operation transform(source_coordinate, target_crs):
require:
- source_coordinate
- source_crs
- target_crs
preserve:
- source_coordinate
- source_crs
- transformation_method
- provenance
output:
- transformed_coordinate
- target_crs
- confidence
rule transformation_safety:
DO NOT transform spatial coordinates
IF source reference system is unknown or materially ambiguous
# ---------- VALIDATION ----------
validation:
require:
- spatial_context
validate_if_present:
- coordinates
- coordinate_reference_system
- geometry
- spatial_extent
- bounding_box
- spatial_resolution
- spatial_accuracy
- elevation
reject:
- invalid_coordinate_for_declared_crs
- contradictory_spatial_extent
- invalid_geometry
- unresolved_axis_order where deterministic processing is required
- incompatible_spatial_reference_comparison
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"spatial metadata" ~= "location metadata" WHEN describing spatial context
"spatial metadata" ~= "geospatial metadata" WHEN geographic reference applies
"CRS" ~= "coordinate reference system"
"spatial extent" ~= "geographic extent" WHEN geographic semantics apply
"bounding box" ~= "bounding rectangle" WHEN representation semantics match
"spatial resolution" ~= "spatial granularity" WHEN describing minimum represented detail
PRESERVE distinctions:
spatial_resolution != spatial_accuracy
coordinate_precision != spatial_accuracy
location != geometry
geometry != spatial_extent
named_place != coordinate
coordinate_reference_system != coordinate_system
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_spatial_assertion:
score: 1.00
explicit_coordinates_with_crs:
score: 1.00
geometry_derived_extent:
score: 0.95
valid_crs_transformation:
score: 0.95
authoritative_place_resolution:
score: 0.90
inferred_spatial_relationship:
score: 0.85
ambiguous_location:
score: <= 0.60
action: preserve uncertainty
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_spatial_metadata_update:
- preserve prior value where provenance requires
- validate new spatial representation
- validate reference system
- recalculate dependent spatial properties
- record provenance
on_geometry_update:
- validate geometry
- recalculate spatial extent
- recalculate bounding box
- reassess spatial relationships
- update provenance
on_crs_update:
- preserve original coordinates
- preserve original CRS
- transform only when transformation is valid
- record transformation method
- revalidate derived relationships
on_location_update:
- update location identity
- resolve geographic ambiguity
- revalidate extent and relationships
- preserve change provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- entities
- relationships
- spatial_rules
- geometry_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- normalise_whitespace
- preserve_case_sensitive_identifiers
- sort_unordered_property_sets
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- metadata ontology
- spatial reasoning model
- spatial validation model
- semantic retrieval structure
operations:
- identify spatial resources
- resolve locations
- interpret coordinates
- validate CRS
- analyse geometry
- calculate spatial extent
- evaluate spatial relationships
- compare spatial resources
- preserve provenance
- expose uncertainty
constraints:
- never_invent_coordinates
- never_assume_crs_without evidence
- never_assume_axis_order_without evidence
- never_equate_precision_with_accuracy
- never_discard_original_spatial_reference
- never_compare_incompatible_spatial_representations_without transformation
# ---------- QUERY MODEL ----------
query:
input:
- resource
- location_constraint
- coordinate_constraint
- geometry_constraint
- spatial_relationship
- extent_constraint
- resolution_constraint
resolve:
1. identify SpatialResource
2. retrieve SpatialMetadata
3. resolve location representation
4. identify CoordinateReferenceSystem
5. normalise compatible representations
6. evaluate Geometry and SpatialExtent
7. apply requested spatial relationships
8. validate resolution and accuracy
9. rank results by confidence
output:
- matched_resource
- location
- geometry
- spatial_extent
- reference_system
- spatial_relationships
- confidence
- provenance
# ---------- INFERENCE ----------
inference:
IF coordinate AND valid CRS exist
THEN infer SpatialLocation
WITH confidence = 0.95
IF valid Geometry exists
THEN derive SpatialExtent
WITH confidence = 0.95
IF geometry A spatially contains geometry B
under compatible CRS
THEN infer B WITHIN A
WITH confidence = 0.95
IF authoritative PlaceIdentifier resolves uniquely
THEN associate NamedLocation
WITH confidence >= 0.90
IF spatial representation is ambiguous
THEN do_not_force_resolution
AND preserve candidate interpretations
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: SpatialMetadata
spatial_context: machine_interpretable
coordinate_reference: explicit_where_required
geometry: preserved
spatial_extent: resolvable
spatial_relationships: machine_reasonable
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard