< ^  >

Example Animal Query #3

Query:

  Find scenes where animal A enters region R from the west side and leaves from the north side.

Strategy:

  • define the notion of entering a region from west and leaving from north

  • extract the 2D-PIR sequence for A and R

  • match it against the defined movement

Expressed as:

  EnterWest = [ (disjoint,before,?), (touches,meets,during),
                (overlaps,overlaps,during), (~contains,during,during) ]

  ExitNorth = [ (~contains,during,during), (overlaps,during,~overlaps),
                (touches,during,~meets), (disjoint,during,after) ]

  [ S | S <- AnimalDB, S.st-seq(A,R).matches(EnterWest + ExitNorth) ]

Would be simpler to do as sketch query.

[Diagram:pic/movsketchq]


< ^  >