]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mathql/doc/mathql_introduction_core.tex
updating and structuring
[helm.git] / helm / mathql / doc / mathql_introduction_core.tex
diff --git a/helm/mathql/doc/mathql_introduction_core.tex b/helm/mathql/doc/mathql_introduction_core.tex
new file mode 100644 (file)
index 0000000..fbb2d95
--- /dev/null
@@ -0,0 +1,67 @@
+\subsection{The core language} 
+
+{\MathQL}.4 consists of a core language and of a basic library. Other
+user-defined libraries can be added at will. The core language includes the
+\TT{property} operator mentioned in \subsecref{HighAccess} that queries the
+underlying {\RDF} database and the infrastructure to post-process the
+query results. The components of this infrastructure are listed below:
+
+\begin{itemize}
+
+\item 
+Explicit sets of attributed values.
+
+An explicit {\av} set can be placed in a query in two forms: 
+as a single quoted string, like \verb+"this is a query result"+, that
+evaluates in a single {\av} with that value and no attributes, or as a full
+{\av} set in the syntax shown in the previous sections but sorrounded by
+square brackets, like \verb+["head" attr {"attribute-name" = "contents"}]+.
+\newline
+In the second form, the contents of an attribute can be the result of a query,
+like
+\verb+["head" attr {"attribute-name" = property /"metadata" of "resource"}]+.
+\newline
+In this case the contents of the attribute are the head strings of the query
+result, whose attributes (if any) are discarded. 
+
+\item 
+Variable assignment.
+
+Variables for {\av} sets (called \emph{set variables}) can be assigned using
+a standard \emph{let-in} construction and may appear wherever an {\av} set
+({\ie} a query result) is allowed.  
+\newline
+The assignment has the form: 
+\TT{let \$}\EM{variable} \TT{=} \EM{av-set} \TT{in} \EM{av-set}
+so we can write:
+\newline
+\verb+let $var = "contents" in ["head" attr {"attribute-name" = $var}]+.
+
+The scope rules of {\MathQL} variables are tipical for an imperative
+programming language and any case of assignment propagation will be indicated.
+
+\item 
+Sequential composition.
+
+This construction has the form: \EM{av-set} \TT{;;} \EM{av-set} and works as
+follows: the two {\av} sets are evaluated one after the other and the first
+one is discarded but the variables assigned in the first {\av} set are
+available to the second one.  
+
+\item 
+Bounded iteration.
+
+
+\end{itemize}
+
+\xcomment {
+
+Attributed values can be used to store any auxiliary information needed during
+query execution.
+In particular, {\MathQL} provides variables for {\av}'s which, in its textual
+syntax, are identifiers%
+\footnote{To be understood as in programming languages.}
+preceded by the @ sign, as in \TT{@variable}, and that are introduced by the
+\TT{for} and \TT{select} constructions to be explained below.
+
+} % \xcomment