Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1331 Implement CEP/ESP support into Drools
  3. JBRULES-1374

Implement the new time relation operators

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    Description

      All this goes back to Allen's interval-based semantics defined in 1983 in his paper "Maintaining Knowledge about temporal relationships". In it the 13 relationships are defined. In fact, we have the "equals" relation, plus 6 further relationships and their inverses (e.g., "before" is the inverse relationship of "after"). I wrote down how to formally interpret the visual representation for all 13 relationships given by Allen on page 4 (see the box at the upper right corner; the pictoral example illustrates best the situation) of the paper, i.e. I expressed them in the format you suggested using the start and end time of the events. Here we go (of course, for all events E must hold: E.startTS <= E.endTS).

      A coincides B: (A.startTS == B.startTS) && (A.endTS == B.endTS)

      A before B: (A.endTS < B.startTS)
      A after B: (A.startTS > B.endTS)

      A meets B: (A.endTS == B.startTS) && (A.startTS <= B.startTS)
      A met-by B: (A.startTS == B.endTS) && (A.startTS >= B.startTS)

      A overlaps B: (A.startTS < B.startTS) && (A.endTS < B.endTS) && (A.endTS > B.startTS)
      A overlapped-by B: (A.startTS > B.startTS) && (A.endTS > B.endTS) && (A.startTS < B.endTS)

      A during B: (A.startTS > B.startTS) && (A.endTS < B.endTS)
      A includes B: (A.startTS < B.startTS) && (A.endTS > B.endTS)

      A starts B: (A.startTS == B.startTS) && (A.endTS < B.endTS)
      A started-by B: (A.startTS == B.startTS) && (A.endTS > B.endTS)

      A finishes B: (A.startTS > B.startTS) && (A.endTS == B.endTS)
      A finished-by B: (A.startTS < B.startTS) && (A.endTS == B.endTS)

      Remark: In the original paper the terms "equals" and "contains" are proposed. Due to the fact that these keywords already exist in Drools, "equals" is replaced by "coincides", and "contains" is substituted by "includes".

      Attachments

        Activity

          People

            etirelli@redhat.com Edson Tirelli
            etirelli@redhat.com Edson Tirelli
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty