1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
\pagebreak
\section{Introduction}
\subsection{This document}
Note: This paper is just a request for comment! Don't expect to find anything in the real implementation !
\\
This draft paper describes the database layout of the Opie PIM applications.
Design goal is a fast and extendable layout on a sql database to support cross referencing.
\subsection{Copyright}
Copyright notice
\copyright 2002, Maximilian Rei{\ss} \& Stefan Eilers \& Holger Freyther
\pagebreak
\section{Relations}
\subsection{About Cross Referencing and Horizontal Data Storage}
Before you read on, it may be helpful to get some information about the solution of ``horizontal'' data storage into the tables and cross referencing.
Some of the tables are just using 4 attributes:
\begin{enumerate}
\item UID: This countains an unique ID for the complete entry.
\item ID: This defines a number to seperate the rows of an entry.
\item Type: Describes the type of this entry.
\item Value: And the data which was described by ``Type'' is stored here.
\end{enumerate}
These kinds of tables are very flexible in what they may contain, due to the fact that the ``Type'' may be without any constraint. Therefore it is perfectly for storing personal information, which may change in the future, or should be increased. The other advantage is the fact that these tables are automatically convertable into XML:
The ``Type'' has just to be converted into an ``attribute'' in a XML-tag. Thats all, and that will work for all future Types !
Let's see how such an entry may look like for the table ``ADDRESSBOOK'':
\begin{tabular}[ht]{|l|l|l|l|}
\hline
\underline{UID} & \underline{ID} & Type & Value\\
\hline
1231& 00& Title& Herr\\
\hline
1231& 01& FirstName& Stefan\\
\hline
1231& 02& LastName& Eilers\\
\hline
\end{tabular}
\\
\\
We need some additional information about this entry, which is stored into the table ``PERSONAL\_DATA\_CONTACT'':
\\
\\
\begin{tabular}[ht]{|l|l|l|l|}
\hline
\underline{UID} & \underline{ID} & Type & Value\\
\hline
2345& 00& Email& eilers@sra.uni-hannover.de, eilers.stefan@epost.de\\
\hline
2345& 01& DefaultEmail& eilers@sra.uni-hannover.de\\
\hline
2345& 02& HomeWebPage& www.sra.uni-hannover.de/$\sim$eilers/\\
\hline
\end{tabular}
\\
\\
The last question is: How to get these information together? This is the job of the cross-referencing-table\footnote{We expecting that the table ``PERSONAL\_DATA\_CONTACT'' was registered in the table ``TABLEID'' as table ``03''!}:
\\
\\
\begin{tabular}[ht]{|l|l|l|l|l|l|}
\hline
\underline{TID1} & \underline{UID1} & \underline{Type1} & \underline{TID2} & \underline{UID2} & \underline{Type2} \\
\hline
01& 1231& & 03& 2345&\\
\hline
\end{tabular}
\\
\\
Type was left empty, due to the fact that we wanted to link the complete entry and not some rows of the entry.
\\
In some cases, it may be useful to reference in a much more smaller granularity than complete entries. What should we do, if we want to store the children of a person ?
The easiest way is to store the children into the table ``PERSONAL\_DATA'':\footnote{We expecting that the table ``PERSONAL\_DATA'' was registered in the table ``TABLEID'' as table ``05''!}\\
\\
\begin{tabular}[ht]{|l|l|l|l|}
\hline
\underline{UID} & \underline{ID} & Type & Value\\
\hline
2344& 11& Children& Amaly, Karl, Clarissa\\
\hline
\end{tabular}\\
\\
and reference it again with the table ``ADDRESSBOOK'':\\
\\
\begin{tabular}[ht]{|l|l|l|l|l|l|}
\hline
\underline{TID1} & \underline{UID1} & \underline{Type1} & \underline{TID2} & \underline{UID2} & \underline{Type2} \\
\hline
01& 1231& & 05& 2344&\\
\hline
\end{tabular}
\\
\\
But what happens if you want to store additional information about the children, as there mobile phone numbers, etc?
In this case we need an entry in addressbook and a reference to this entry. Lets expect ``Amaly'' was stored in the table ``ADDRESSBOOK'' with UID 9213 and Karl with UID 7654. A cross-reference will look like this:\\
\\
\begin{tabular}[ht]{|l|l|l|l|l|l|}
\hline
\underline{TID1} & \underline{UID1} & \underline{Type1} & \underline{TID2} & \underline{UID2} & \underline{Type2} \\
\hline
05& 2344& Children& 01& 9213& \\
\hline
05& 2344& Children& 01& 7654& \\
\hline
\end{tabular}
\\
|