tm_relative_position
ptrb edited this page May 29, 2013
·
2 revisions
tm_relative_position( PostTIME , PostTIME ) : text
Determines the relative position of one instance to another and returns the result as a string according to ISO19108. This means the result is one of the following:
Before, Meets, Overlaps, Begins, BegunBy, During, Contains, Equals, OverlappedBy, Ends, EndedBy, MetBy, After
or NAP if at least one argument-object is not a primitive (see table below).
Please compare Allen's interval algebra.
-- Calendar system...
SELECT tm_relative_position('2013-6-11T9:12','2013-5-30/2016-2-29');
-- result
'During'
-- ...coordinate system...
SELECT tm_relative_position('TCS0028765/9765','TCS0029000/10000');
-- result
'Overlaps'
-- ...or also using an ordinal system.
SELECT tm_relative_position('ORD001Neoproterozoic/Ordovician','ORD001Devonian');
-- result
'Before'
| CAL | TCS | ORD ---|---|---|--- TM_Instant | ✔ | ✔ | ✔ TM_Period | ✔ | ✔ | ✔ MultiInstant | ∼ | ∼ | ∼ MultiPeriod | ∼ | ∼ | ∼ RegularMultiInstant | ∼ | ∼ | ∼ RegularMultiPerid | ∼ | ∼ | ∼ ✔ : Processable
✗ : Call will cause an error
∼ : Callable without error, but returns only a pseudo result