\section{A use case: retrieving the transitive principles} 

In this section we briefly present one on the many queries that we are using
to test {\MathQL}.4: the one that retrieves the transitive principles stored
in the {\HELM} library. The details on the {\RDF} metadata used to index the
contents of the library can be found in \cite{Sch02,Gui03,GSC03}.
This query, executed in {\MySQL}-mode on an AMD Athlon 1.5 GHz, retrieved 
$55$ {\HELM} objects (out of $41451$) in $4.00s$ (the interpreter worked
for $0.31s$) after having issued $2205$ {\SQL} queries to the underlying
database. This test was executed on April 2 2004 by the Author.

\begin{footnotesize} \begin{verbatim}
gen /"helm"/"aliases" in let $sets = property inverse /"refSort" istrue 
/"h:sort" in $SET, /"h:position" in $MC, /"h:depth" in "0" of "" in let
$prop = property inverse /"refSort" istrue /"h:sort" in $PROP, 
/"h:position" in $MC, /"h:depth" in "2" of "" in let $rels0 = for @uri
in $prop sup add {/"set" = property /"refObj" main /"h:occurrence" istrue
/"h:position" in $MH of @uri} in @uri in let $rels = select @uri from
$rels0 where ex ((count @uri./"set" eq "1") and (@uri./"set" sub $sets))
in let $trans0 = for @uri in $rels sup add {/"rel" = @uri; /"set" = proj
/"set" of @uri} in property inverse /"refObj" main /"h:occurrence" istrue
/"h:position" in $MC, /"h:depth" in "5" of @uri in let $trans1 = for @uri
in $trans0 sup add distr {/"premises" = property /"refObj" main /"h:occur
rence" istrue /"h:position" in $MH of @uri; /"extra" = property /"refObj"
main /"h:occurrence" istrue /"h:position" in {$IC, $IH} of @uri} in @uri
in let $trans = select @uri from $trans1 where ex (not @uri./"extra" and
(@uri./"premises" sub {@uri./"rel", @uri./"set"})) in keep $trans
\end{verbatim} \end{footnotesize} %$

\input{mathql_tests_transitive}
