1 \subsection{The core language}
3 {\MathQL}.4 consists of a core language and of a basic library. Other
4 user-defined libraries can be added at will. The core language includes the
5 \TT{property} operator mentioned in \subsecref{HighAccess} that queries the
6 underlying {\RDF} database and the infrastructure to post-process the
7 query results. The components of this infrastructure are listed below:
12 Explicit sets of attributed values.
14 An explicit {\av} set can be placed in a query in two forms:
15 as a single quoted string, like \verb+"this is a query result"+, that
16 evaluates in a single {\av} with that value and no attributes, or as a full
17 {\av} set in the syntax shown in the previous sections but sorrounded by
18 square brackets, like \verb+["head" attr {"attribute-name" = "contents"}]+.
20 In the second form, the contents of an attribute can be the result of a query,
22 \verb+["head" attr {"attribute-name" = property /"metadata" of "resource"}]+.
24 In this case the contents of the attribute are the head strings of the query
25 result, whose attributes (if any) are discarded.
30 Variables for {\av} sets (called \emph{set variables}) can be assigned using
31 a standard \emph{let-in} construction and may appear wherever an {\av} set
32 ({\ie} a query result) is allowed.
34 The assignment has the form:
35 \TT{let \$}\EM{variable} \TT{=} \EM{av-set} \TT{in} \EM{av-set}
38 \verb+let $var = "contents" in ["head" attr {"attribute-name" = $var}]+.
40 The scope rules of {\MathQL} variables are tipical for an imperative
41 programming language and any case of assignment propagation will be indicated.
44 Sequential composition.
46 This construction has the form: \EM{av-set} \TT{;;} \EM{av-set} and works as
47 follows: the two {\av} sets are evaluated one after the other and the first
48 one is discarded but the variables assigned in the first {\av} set are
49 available to the second one.
59 Attributed values can be used to store any auxiliary information needed during
61 In particular, {\MathQL} provides variables for {\av}'s which, in its textual
62 syntax, are identifiers%
63 \footnote{To be understood as in programming languages.}
64 preceded by the @ sign, as in \TT{@variable}, and that are introduced by the
65 \TT{for} and \TT{select} constructions to be explained below.