Skip to main content

Module sparql_mm_observation_query

Module sparql_mm_observation_query 

Source
Expand description

SPARQL-MM spatial+temporal query over vision OBSERVATION quins (D4.03).

Composes the vision-native semantic engine — it does NOT reimplement region / frame filtering. Two existing primitives are joined on the instance hash:

An observation is “in the window” iff its instance appears in BOTH result sets.

§Why the vision-native route (not SparqlMmHandler)

qualia_core_db::sparql_library::sparql_mm::SparqlMmHandler already recognises the hasBoundingBox / hasTrackId predicate hashes this layer emits, and a &[VisionQuin] could be reinterpreted as &[NQuin] (both are 6×u64 #[repr(C)]). Its TEMPORAL dimension, however, keys off ma-ont#mediaTimeMs / hasStartTime payloads in the object field — whereas vision observations carry the frame index in metadata. Routing the temporal half through SparqlMmHandler would therefore silently match nothing (or require inventing media-time edges we do not have). The vision-native primitives model the frame semantics exactly, so they are the route that composes correctly AND compiles cleanly. Documented per the task’s “prefer the one that compiles cleanly” instruction.

§Template-leak safety

VisionQuin holds OBSERVATIONS, never biometric templates. This query returns only instance/subject IDENTITY hashes (u64 node identifiers) and a count — it never emits an object payload (which is where a packed box, or in other quin families a template digest, would live). Callers cannot recover template bytes through this surface.

Structs§

ObsQueryResult
Result of a spatial+temporal observation query: a count plus the instance (subject) hashes that fall inside the window. Never contains object payloads.

Functions§

faces_in_zone_time
Count + identify observation instances whose bounding box intersects the zone [x0,y0,x1,y1] AND whose VisualObservation frame is in [frame_start, frame_end].