• No results found

4.4 Document Profiles

4.4.2 Comparing Temporal Expressions

To analyze the content of temporal document profiles, there is a need to compare temporal expressions of the types date or time with each other. For this, one has to take care of the different granularities of temporal expressions as was exemplarily shown in Figure 2.1(c) (page 14) where the hierarchical organization of temporal expressions was explained. Independent of the granularity, the normalized value – in the following called chronon – of each temporal expression of the types date and time can be anchored in a timeline.

Timelines

For the representation of different granularities, we assume different timelines for each granularity, e.g., Tday for days and Tmonth for months. For example, “March 11, 2013” can be anchored in Tday and

“September 2013” can be anchored in Tmonth. To explain how to compare two chronons with each other,

we assume the following timelines T = {Tday, Tmonth, Tyear} for day, month, and year, respectively. Of

course, many more timelines exist (e.g., minute, hour, season, etc.) but – for the sake of simplicity – we use only these three timelines.

Temporal Precedence and Containment Relationships

To compare two chronons of the same granularity with each other, we introduce a temporal precedence relationship. Formally, this precedence relationship is defined as follows:

Definition 4.6. (Temporal Precedence Relationship≺T)

Using the temporal precedence relationship ≺T, the relationship between two chronons ti ∈ T0,

tj ∈ T00, with T0= T00, ti 6= tj, can be determined so that either ti≺T tj or tj ≺T ti.

All chronons of the same granularity, i.e., of the same timeline, can now be compared with each other. However, a document typically contains temporal expressions of different granularities so that there is a need to compare two chronons anchored in different timelines. For this, we introduce an additional relationship called temporal containment relationship that is formally defined as follows:

Definition 4.7. (Temporal Containment Relationship⊂T)

Given two chronons ti ∈ T0 and tj ∈ T00, with T0 being more fine grained than T00. The temporal

containment relationship⊂T between tiand tj holds (ti ⊂T tj) if tiis contained in tj.

Temporal Mapping Function

Now, chronons of the same granularity can be compared to each other, and chronons of different timelines can be checked for a containment relationship. However, two chronons can also be of different timelines without a containment relationship. To compare such chronons, we exploit the characteristic of temporal information that it can be organized hierarchically (cf. Section 2.3.1) and introduce a so-called temporal mapping function. This function can be applied to two chronons until they are of the same timeline so that the temporal precedence relationship can be checked for the mapped chronons. The temporal mapping function is defined as follows:

Definition 4.8. (Temporal Mapping FunctionαT)

The temporal mapping function αT(t0i) = t00i maps the chronon t0i ∈ T0to the next coarser timeline, so

4.4 Document Profiles

Algorithm 4.1 Procedure to compare two chronons of any timelines using the temporal precedence relationship ≺T, the temporal containment relationship ⊂T, and the temporal mapping function αT.

1: procedureCompare_Chronons(t1, t2)

2: t∗1= t1, t∗2 = t2 . keep original values of t1and t2

3: if(t1.timeline < t2.timeline) and (t1⊂T t2) then

4: return t∗1contained in t∗2

5: else if(t2.timeline < t1.timeline) and (t2 ⊂T t1) then

6: return t∗2contained in t∗1

7: end if

8: while(t1.timeline < t2.timeline) do

9: t1 = αT(t1)

10: end while

11: while(t2.timeline < t1.timeline) do

12: t2 = αT(t2) 13: end while 14: ift1 ≺T t2then 15: returnt∗1before t∗2 16: else ift2 ≺T t1then 17: returnt∗1after t∗2 18: else 19: returnt1equals t2 20: end if 21: end procedure

Assuming the three example timelines T = {Tday, Tmonth, Tyear}, chronons of the granularity day

can be mapped to the month timeline, and chronons of the granularity month can be mapped to the year timeline by applying the temporal mapping function. For instance, αT(“2013-03-11”) = “2013-03” and

αT(“2013-09”) = “2013”. Of course, the temporal mapping function can also be applied recursively, e.g.,

αT(αT(“2013-03-11”)) = “2013”.

Algorithm to Compare Chronons

Combining the temporal precedence relationship (Definition 4.6), the temporal containment relationship (Definition 4.7), and the temporal mapping function (Definition 4.8), all chronons can be compared with each other independent of their granularities by applying the procedure described in Algorithm 4.1.

In lines 3 to 7, the two chronons are checked for a containment relationship. If there is no containment relationship, t1 and t2 are mapped to the same timeline in lines 8 to 13.7 Then, in lines 14 to 20, the

relationship between the two chronons is determined, and the algorithm returns this relationship.

7For the sake of simplicity, we assume that the temporal hierarchy is linear, i.e., the timelines are organized linearly as in the case of our three example timelines of T = {Tday, Tmonth, Tyear}. However, if the hierarchies were more complex (parallel), the algorithm would only have to be slightly modified: (i) the containment relationship check (lines 3 to 7) would be applied to linearly related chronons only; (ii) instead of checking the timelines of t1and t2to be identical (8 to 13), one would map two non-linear related chronons up to their common governor timeline resulting in “(close to) overlap” relationships, which were to be distinguished from the equal relationship. In addition, we assume that any temporal hierarchy has a single common root timeline even if the hierarchy is not organized completely linear.

4 The Concept of Spatio-temporal Events

t1 t2 timelines mappings relation

2013 2013 Tyear, Tyear – t1= t2 2013 2014 Tyear, Tyear – t1≺T t2 2013 2013-09 Tyear, Tmonth αT(t2) t2⊂T t1 2014 2013-09 Tyear, Tmonth αT(t2) t2≺T t1 2013 2013-03-11 Tyear, Tday αT(αT(t2)) t2⊂T t1 2013 2013-09-13 Tyear, Tday αT(αT(t2)) t2⊂T t1 2014 2013-03-11 Tyear, Tday αT(αT(t2)) t2≺T t1 2014 2013-09-13 Tyear, Tday αT(αT(t2)) t2≺T t1 2013-09 2013-03-11 Tmonth, Tday αT(t2) t2≺T t1 2013-09 2013-09-13 Tmonth, Tday αT(t2) t2⊂T t1 2013-03-11 2013-09-13 Tday, Tday αT(t1), αT(t2) t1≺T t2

Table 4.2: Examples showing how to compare two chronons with each other to determine their temporal relationship. If both chronons are identical, there is an equal relationship between t1and t2 without

any mappings as exemplarily shown for t1= t2= 2013.

... 2013 ... 2013-03-11 2013-09 2013-09-13 2014 Figure 4.2: Hierarchy structure of the example chronons.

Note that our algorithm to compare chronons does not check for all thirteen temporal relations defined by Allen (1983) as briefly introduced in Section 2.3.1. Obviously, the relationship can be determined as equal (line 19) and as before and its inverse (lines 15 and 17). However, we do not distinguish between Allen’s “before” and “meet” relations. In addition, the containment relations (lines 4 and 6) cover Allen’s relations “during”, “starts”, “finishes” and their inverses. Finally, Allen’s overlap relations are not considered here since they can only occur if the temporal hierarchy is not linear or if intervals are compared to chronons. While this will be relevant in Chapter 5, when discussing information retrieval with temporal constraints (i.e., query intervals), comparing intervals to chronons is not relevant for comparing date and time expressions in a temporal document profile.

In Table 4.2, we present some examples how two chronons of our three example granularities are compared with each other and what relationships hold between them. For these examples, we use the following five chronons “2013”, “2014”, “2013-09”, “2013-03-11”, and “2013-09-13”. In Figure 4.2, their temporal hierarchy structure is depicted. By applying Algorithm 4.1 to each pair of chronons, we can determine the temporal relations between all chronons.

Mapping Chronons for Equality

A further procedure that becomes important in Chapter 6 is the mapping of two chronons for equality. While the comparison of two chronons described in Algorithm 4.1 allows to order chronons, this procedure determines how similar two chronons of any timeline are, based on their hierarchical distance. The main assumption is that the smaller the timelines of two chronons, the more similar they can be. As for Algorithm 4.1, the hierarchical organization of chronons is again exploited and the temporal mapping function as well as the temporal precedence relationship are applied. The mapping chronons for equality procedure is described in Algorithm 4.2.

4.4 Document Profiles

Algorithm 4.2Procedure to map two chronons of any timelines until they are equal. The procedure makes use of the temporal precedence relationship ≺T and the temporal mapping function αT.

1: procedureMap_Chronons_for_Equality(t1, t2)

2: map1 = 0, map2 = 0 . tracking the mapping steps of t1and t2

3: t∗1= t1, t∗2 = t2 . keep original values of t1and t2

4: while(t1.timeline < t2.timeline) do

5: t1 = αT(t1)

6: map1= map1+ 1

7: end while

8: while(t2.timeline < t1.timeline) do

9: t2 = αT(t2) 10: map2= map2+ 1 11: end while 12: while(t1 ≺T t2) or (t2 ≺T t1) do 13: t1 = αT(t1) 14: t2 = αT(t2) 15: map1= map1+ 1 16: map2= map2+ 1 17: end while

18: returnt∗1equals t∗2after map1and map2mappings on timeline t1.timeline

19: end procedure

Similar to the procedure to compare two chronons, this procedure maps the chronons t1 and t2to the

same timeline (lines 4 to 11). Then, however, the chronons are further mapped until they are equal, i.e., neither t1 ≺T t2nor t2 ≺T t1(lines 12 to 17). In general, two chronons are more similar to each other

the less mappings are necessary and the finer the timeline of the chronons once they are equal. Thus, it is important to track the number of required mapping steps (lines 2, 6, 10, 15, and 16).

In Table 4.3, we show some examples how to map two chronons for equality. For this, we again use the five chronons “2013”, “2014”, “2013-09”, “2013-03-11”, and “2013-09-13” for which the hierarchy structure is depicted in Figure 4.2. In Table 4.3, it is listed how many mapping steps are necessary to make the two chronons being equal and on which timeline the equal relationship holds. Note that in addition to the three timelines for day, month, and year, we assume a forth timeline Tglobalon which all chronons

become equal. This timeline can be considered as the root of the temporal hierarchy. Thus, the chronons can match on one of the following four timelines T = {Tday, Tmonth, Tyear, Tglobal}. Obviously, if the

equal relationship between two chronons is determined in Tglobal, the two chronons are not very similar

compared to chronons that have been matched earlier.

The examples in Table 4.3 show, for instance, that “2013-09” and “2013-09-13” are quite similar since only one mapping is necessary and they are already equal in Tmonth. In contrast, although there is only

one mapping required for “2013” and “2013-09”, they can be considered less similar since they are equal not till Tyear. Finally, “2014” and “2013-03-11” are not very similar at all since a total of four mappings is

4 The Concept of Spatio-temporal Events

t1 t2 timelines mappings equal at map1map2

2013 2013 Tyear, Tyear – Tyear 0 0

2013 2014 Tyear, Tyear αT(t1), αT(t2) Tglobal 1 1

2013 2013-09 Tyear, Tmonth αT(t2) Tyear 0 1

2014 2013-09 Tyear, Tmonth αT(t1), αT(αT(t2)) Tglobal 1 2

2013 2013-03-11 Tyear, Tday αT(αT(t2)) Tyear 0 2

2013 2013-09-13 Tyear, Tday αT(αT(t2)) Tyear 0 2

2014 2013-03-11 Tyear, Tday αT(t1), αT(αT(αT(t2))) Tglobal 1 3

2014 2013-09-13 Tyear, Tday αT(t1), αT(αT(αT(t2))) Tglobal 1 3

2013-09 2013-03-11 Tmonth, Tday αT(t1), αT(αT(t2)) Tyear 1 2

2013-09 2013-09-13 Tmonth, Tday αT(t2) Tmonth 0 1

2013-03-11 2013-09-13 Tday, Tday αT(αT(t1)), αT(αT(t2)) Tyear 2 2

Table 4.3: Examples showing how to map two chronons for equality. If both chronons are identical, there is an equal relationship between t1and t2without any mappings on the original timeline as

exemplarily shown for t1= t2= 2013.

Summary

In this section, we introduced two algorithms to compare two chronons with each other. While the first algorithm determines the temporal relationship between two chronons, the second algorithm determines how similar two chronons are based on their distance in the temporal hierarchy. Both algorithms will become important when comparing spatio-temporal events with each other (Section 4.4.5), but also when describing spatio-temporal and event-centric search and exploration tasks in Chapter 5 and Chapter 6.