![](bg7.png)
This helps the user to write his texts by making ex-
plicit the syntax of the language and also its static se-
mantics.
If LRC generates an environment for XQuery, we
have: (1) A text is a query. (2) Language syntax
is given by the XQuery grammar defined in (Amer-
Yahia et al., 2005). (3) Dynamic semantics cor-
responds to the evaluation of query results. It is
based on the semantic definition of the XQuery and
Full-Text, including the new productions and func-
tions defined in this paper. (4) Static semantics ver-
ifies, among other things, which elements are valid
operands for each location path operation. Elements
validation is based on the documents DTD or Schema.
To exemplify the XQuery language definition by
an AG to give to LRC, suppose that attribute aScore
stores the score associated to symbols ScoreOrExpr
and ScoreAndExpr defined in Section 4.1. Then, the
production where ScoreOrExpr is derived and the
rule to compute the value of aScore are, respectively:
ScoreOrExpr ::= ScoreAndExpr ”or” ScoreOrExpr
ScoreOrExpr
$
1.aScore =
mf:scoreOr(ScoreAndExpr.aScore,
ScoreOrExpr
$
2.aScore)
Here, the two occurrences of ScoreOrExpr are dis-
tinguished by suffixes
$
1 and
$
2, representing the po-
sition of the symbol in the production. Attribute aS-
core of symbol ScoreOrExpr
$
1 is denoted by Score-
OrExpr
$
1.aScore (the same for ScoreOrExpr
$
2 and
ScoreAndExpr).
The score is calculated by function mf:scoreOr in-
troduced in Section 4.2. It take as arguments at-
tributes aScore of both symbols on the right hand side
of the production.
To compute attribute values, a derivation tree of
queries is first created. Then, each node in the tree
is decorated with its attributes and attribute values
which are computed accordingly to the correspond-
ing rules. These rules define a computation order in
the attributes because they can be dependent on each
other, yielding a dependencies graph.
Each time a text (a query in our case) is changed,
the dependencies graph changes. Then, the incremen-
tal attribute evaluator computes the values of the new
attributes in the graph and the values of existing at-
tributes that depend on the new ones. The incremental
evaluation is obtained via standard function memoiza-
tion. It is out the scope of the paper the presentation
of this method, the interested reader being able to find
details in (Saraiva et al., 2000).
6 CONCLUSION AND FUTURE
WORK
This paper formally defines an extension to XQuery
with selection operations for the interactive/iterative
query construction. This helps the user, not only in
choosing the operations that yield the desired answer,
but also in restricting each intermediate result to the
subset of nodes that pleases the user. The proposed
formal definition can be used to build a processing
system for the interactive edition and processing of
XQuery. As future work, a prototype of a process-
ing system will be built using LRC, as explained in
Section 5.2. For score computations, the method pro-
posed in (Ganc¸arski and Henriques, 2005a) can be
used. Once created, the prototype will be used by real
users to verify the correct understanding and use of
selection operations, as well as the interest of access-
ing intermediate results during query construction.
ACKNOWLEDGEMENTS
The authors are grateful to the Portuguese Fundac¸
˜
ao
para a Ci
ˆ
encia e a Tecnologia for the financial support.
REFERENCES
Amer-Yahia, S., Botev, C., Buxton, S., Case, P., Doerre,
J., McBeath, D., Rys, M., and Shanmugasundaram, J.
(2005). XQuery 1.0 and XPath 2.0 Full-Text Working
Draft. http://www.w3.org/TR/2004/WD-xquery-full-
text-20040709/.
Berglund, A., Boag, S., Chamberlin, D., Fernandez, M.,
Kay, M., Robie, J., and Sim
´
eon, J. (2005). XML
Path Language (XPath) 2.0 W3C Working Draft.
http//www.w3c.org/xpath20/.
Boag, S., Chamberlin, D., Fernandez, M., Florescu, D.,
Robie, J., and Sim
´
eon, J. (2005). XQuery 1.0:
An XML Query Language. W3C Working Draft.
http://www.w3.org/TR/xquery/.
Fuhr, N., Lalmas, M., Malik, S., and Szl
´
avik, Z., editors
(2004). INEX: Initiative for the Evaluation of XML
Retrieval Workshop Proceedings. DELOS Network
of Excellence in Digital Libraries, Schloss Dagstuhl,
Germany.
Ganc¸arski, A. and Henriques, P. (2003). IXDIRQL: an In-
teractive XML Data and Information Retrieval Query
Language. In Proceedings of the 7th ICCC/IFIP
International Conference on Electronic Publishing,
Guimar
˜
aes, Portugal.
Ganc¸arski, A. and Henriques, P. (2005a). A processing en-
vironement for the IXDIRQL XML query language.
In Proceedings of the IADIS Virtual Multi Conference
on Computer Science and Information Systems (MCC-
SIS05).
WEBIST 2006 - INTERNET TECHNOLOGY
154