Database Reference
In-Depth Information
row
r
q
(
D
) is defined as follows: let
q
be expressed in
RA
(if
q
is an SQL query, a
∈
standard translation to
RA
exists). Then we define
Lin
(
r
) recursively:
if
q
is of the form
p
L
(
E
), for
E
an
RA
expression, then
l
t
0
2
t
0
½
Lin
ð
r
Þ¼
f
E
j
r
¼
L
g;
where
t
0
[
L
] denotes the subtuple of
t
0
with schema
L
.
if
q
is of the form
s
c
(
E
), for
E
an
RA
expression, then
l
t
0
2
t
0
¼
t
0
Þ
Lin
ð
r
Þ¼f
E
j
r
^
c
ð
is true
g;
where
c
(
t
0
) denotes the evaluation of condition
c
on tuple
t
0
.
if
q
is of the form
E
1
./
c
E
2
, for
E
1
and
E
2
RA
expressions, then
l
Lin
ð
r
Þ¼
f
t
1
2
E
1
;
t
2
2
E
2
j
r
¼
t
1
t
2
^
c
ð
t
1
t
2
Þ
g;
where
t
1
t
2
denotes tuple concatenation.
if
q
is of the form
GB
A,f(B)
(
E
), for
E
an
RA
expression, then
l
n
o
½A
t
0
½A
t
0
2
Lin
ð
r
Þ¼
Er
¼
where A is any subset of attributes of the schema of
E
, and f(B) is a sequence of
aggregate functions applied to corresponding attributes in the schema of
E
.
if
q
is of the form
E
1
E
2
, then
l
t
0
2
t
0
¼
t
00
ð
t
0
¼
t
00
Þ
Lin
ð
r
Þ¼
f
E
1
j
r
^:9
g
Note that the lineage of row
r
q
(
D
) always comes from rels (
q
). We compute
∈
Lin
(
q
(
D
))
¼[
r
∈
q
(
D
)
Lin
(
r
) and attach the user content to the set of rowids of rows
in
Lin
(
R
).
As for
Content
, it can be one of the following:
l
A
tag
is a single keyword, syntactically denoted by a string with no separators
(commas, whitespaces, etc.). Semantically, it is usually a word in some natural
language. We note that in some social sites, complex tags are allowed. Some
sites do not allow them, forcing users to combine several words into a single
string (“baby_picture”). We do not enter into this issue here and, for simplicity,
consider tags to be single words.
l
A
comment
is a piece of text, usually a fragment in some natural language.
Syntactically, it is denoted by a string where separators are allowed.
l
A
tuple
is a sequence of
pairs
; it takes the form ((
att
1
,
val
1
),
,(
att
n
,
val
n
))
where each
att
i
is an attribute name and each
val
i
is a value (1
...
i
n
).
Search WWH ::
Custom Search