Update of /cvsroot/monetdb/pathfinder/tests/BugTracker/Tests
In directory
23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19343/tests/BugTracker/Tests
Added Files:
Tag: M5XQ
slow_compilation.SF-2898944.mod2.xq
Log Message:
propagated changes of Thursday Nov 19 2009
from the XQFT branch to the M5XQ branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/11/19 - sjoerd:
tests/BugTracker/Tests/slow_compilation.SF-2898944.mod2.xq,1.2.2.1
file slow_compilation.SF-2898944.mod2.xq was added on branch XQFT on
2009-11-19 12:16:02 +0000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/11/19 - sjoerd:
tests/BugTracker/Tests/slow_compilation.SF-2898944.mod2.xq,1.2.2.2
propagated changes of Thursday Nov 19 2009
from the development trunk to the XQFT branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/11/19 - sjoerd:
tests/BugTracker/Tests/slow_compilation.SF-2898944.mod2.xq,1.2
propagated changes of Wednesday Nov 18 2009 - Thursday Nov 19 2009
from the Nov2009 branch to the development trunk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2009/11/18 - stmane:
tests/BugTracker/Tests/slow_compilation.SF-2898944.mod2.xq,1.1.2.1
added test (compilation via pf, only) for
ID: 2898944 "pf takes 'forever' (> 1 hour) to compile particular query"
https://sourceforge.net/tracker/?func=detail&aid=2898944&group_id=56967&atid=482468
Seems to work fine, now;
compiling both queries with both `pf -A` & `pf -M`
takes less than 2 secs on my machine with a debug build.
Set timeout to 6 secs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- NEW FILE: slow_compilation.SF-2898944.mod2.xq ---
module namespace ecv = "http://www.cs.utwente.nl/~belinfan/ecv";
(: this file contains code to apply a given view :)
declare function ecv:print-eprint($entries as element()*) as element()*
{
$entries//fmt/div
};
(: ======================================================================= :)
declare function ecv:generate($doc as xs:string)
as element(tuple)*
{
for $ep in doc($doc)//tuple
where (
(
(
( some $c in $ep//research_groups satisfies contains(upper-case($c),
"EWI-FMT"))
)
)
)
return $ep
};
declare function ecv:apply-view()
as element()
{
ecv:view-from-save("eprints-export-conv.xml")
};
declare function ecv:view-from-save($doc as xs:string)
as element()
{
let $eplvl0 := ecv:generate($doc)
,$human_type := <m> <e k="mastersthesis">Master's Thesis</e>
<e k="article">Article</e>
<e k="inaugural_lecture">Inaugural lecture</e>
<e k="thesis">PhD Thesis</e>
<e k="conference_item">Conference or Workshop Paper</e>
<e k="book_review">Review</e>
<e k="book_section">Book Section</e>
<e k="intreport">Internal Report</e>
<e k="manual">Manual</e>
<e k="book">Book</e>
<e k="patent">Patent</e>
<e k="extreport">External Report</e>
</m>
,$grpvals0 := for $ep in distinct-values($eplvl0//year/text())
order by $ep ascending
return $ep
,$grpvals1 := for $ep in distinct-values($eplvl0//type/text())
order by $ep ascending
return $ep
,$grpvals2 := for $ep in distinct-values($eplvl0//creators_family/text())
order by $ep ascending
return $ep
,$head := (
<li><h2>year</h2>
<ul>
<li><h2>type</h2>
<ul>
<li><h2>creators_family</h2>
</li>
</ul>
</li>
</ul>
</li>
)
,$toc := (: ecv:grouped-toc($eplvl0) :)
let $grpitems0 := for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//year = $g0
return $ep
where not(empty($eplvl1))
return
(
<li><a href="#{$g0}">{$g0}</a>
{
let $grpitems1 := for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//type = $g1
return $ep
where not(empty($eplvl2))
return
(
<li><a href="#{$g0}::{$g1}">{ecv:to-human($g1,
$human_type)}</a>
{
let $grpitems2 := for $g2 in $grpvals2
let $eplvl3 := for $ep in $eplvl2
where $ep//creators_family =
$g2
return $ep
where not(empty($eplvl3))
return
(
<li><a href="#{$g0}::{$g1}::{$g2}">{$g2}</a>
</li>
)
return if (not(empty($grpitems2)))
then <ul>{$grpitems2}</ul>
else ()
}
</li>
)
return if (not(empty($grpitems1)))
then <ul>{$grpitems1}</ul>
else ()
}
</li>
)
return if (not(empty($grpitems0)))
then <ul>{$grpitems0}</ul>
else ()
,$items := (: ecv:grouped-view($eplvl0) :)
for $g0 in $grpvals0
let $eplvl1 := for $ep in $eplvl0
where $ep//year = $g0
return $ep
where not(empty($eplvl1))
return
<div class="year" id="{$g0}"> { (
<h1>{$g0}</h1>,
for $g1 in $grpvals1
let $eplvl2 := for $ep in $eplvl1
where $ep//type = $g1
return $ep
where not(empty($eplvl2))
return
<div class="type" id="{$g0}::{$g1}"> { (
<h2>{ecv:to-human($g1, $human_type)}</h2>,
for $g2 in $grpvals2
let $eplvl3 := for $ep in $eplvl2
where $ep//creators_family = $g2
return $ep
where not(empty($eplvl3))
return
<div class="creators_family" id="{$g0}::{$g1}::{$g2}"> { (
<h3>{$g2}</h3>,
ecv:print-eprint($eplvl3)
) } </div>
) } </div>
) } </div>
return
<div>{
( if (empty($toc))
then ()
else <div class="toc">{$toc}</div>
,
if (empty($items))
then ()
else <div class="items">{$items}</div>
)
}</div>
};
(:
declare function try($v as xs:string) as xs:string { let $a := <t><n t="a">Aap
jaap</n><n t="b">Beep piep piep</n></t> , $r := for $x in $a//n where $x/@t eq
$v return $x/text() return if (empty($r)) then $v else
string-join($r/string(), "") } ;
<div><p>{try("a")}</p><p>{try("b")}</p><p>{try("c")}</p></div>
:)
declare function ecv:to-human($val as xs:string, $m as element())
as xs:string
{
let $r := for $x in $m//e where $x/@k eq $val
return $x
return
if (empty($r))
then $val
else string-join($r/string(), "")
};
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins