Query Operators Semantics

From RDF Stream Processing Community Group

Temporal Operators

Temporal and semantic relatedness are two important aspects to be addressed by the RSP group. While the semantic relatedness between streaming RDF triples may be captured through certain background knowledge (e.g., an ontology), their temporal relatedness should be captured through a set of temporal operators. Allen's interval algebra, as a calculus for temporal reasoning, may serve as a good basis for defining temporal operators in RSP (see Figure 1 below).

Figure 1: Allen's interval algebra

The Allen's interval algebra defines 13 possible relations between two intervals. For an RDF stream model defined on time intervals, it would be therefore possible to define the same 13 relations (temporal operators). In contrast, an RDF stream model defined on time points enables us to distinguish only between 2 temporal relatedness (i.e., “before” and “equal”). Finally, a comparison between a time point and a time interval enables 11 different relations to be distinguished (i.e., all except overlaps and equals).

Sequence

For a purpose of sketching the semantics of temporal operators, let us consider an RDF stream model based on time intervals, i.e., an RDF stream is a set of triple occurrences <<s,p,o>, t_1, t_2> where <s,p,o> is an RDF triple and t_1 and t_2 are the start and the end of an interval that the triple is defined on. Prerequisite to consider triples defined on intervals, instead of RDF graphs defined on intervals, is not required (what follows could be defined on graphs too).

If m denotes a triple <s,p,o>, then we can represent <<s,p,o>, t_1, t_2> simply as <m, t_1, t_2>. The operator: Before or Sequence (SEQ) joins two triples <m, t_1, t_2> and <m’, t_3, t_4> only if <m, t_1, t_2> occurs strictly before <m’, t_3, t_4>, i.e., t_2 < t_3.

Other Temporal Operators

While the semantics of all 13 temporal relations from Allen’s algebra is distinct, from the operational point of view it is possible to modify an algorithm which detects the sequence (Before) in order to implement the other Allen’s operators. Below one can see the sketch of the required modifications.

  • Before or Sequence (SEQ): joins <m, t_1, t_2> and <m’, t_3, t_4> where t_2 < t_3.
  • Meets: modified SEQ operator such that t_2 = t_3.
  • Overlaps: modified SEQ operator such that t_2 > t_3.
  • Starts: modified SEQ operator such that t_1 = t_3 & t_2 < t_4.
  • During: modified SEQ operator such that t_1 > t_3 & t_2 < t_4.
  • Finishes: modified SEQ operator such that t_2 = t_4 & t_1 > t_3.
  • Equal: modified SEQ operator such that t_1 = t_3 & t_2 > t_4.

Remark: all operator except Equal have their inverse versions.

Alasdair: Why are there the second conditions on starts and finishes? Why is equal not a special case of these two operators?