< ^  >

Example Animal Query #2

Query:

  How long is animal A inside region R?

Strategy:

  • find the scenes where A is inside R

  • extract the interval for which this is true

  • compute the length of the interval

Expressed as:

  AinsideR = [ S | S <- AnimalDB, S.interval(A,R,[(~contains,?,?)]) != Never ]

  AinsideR.interval(A,R,[(~contains,?,?)]).duration


< ^  >