http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q04.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q04.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q04.xq new file mode 100644 index 0000000..44a3e1d --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q04.xq @@ -0,0 +1,26 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection := "open_auctions" +for $b in collection($collection)/site/open_auctions/open_auction +where + some $pr1 in $b/bidder/personref, + $pr2 in $b/bidder/personref + satisfies $pr1/@person eq "person20" and $pr2/@person eq "person51" and $pr1 << $pr2 +return <history>{$b/reserve/text()}</history>
http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q05.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q05.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q05.xq new file mode 100644 index 0000000..e8d5b9c --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q05.xq @@ -0,0 +1,25 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +count( + let $collection := "closed_auctions" + for $i in collection($collection)/site/closed_auctions/closed_auction + where $i/price/text() >= 40 + return $i/price +) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q06.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q06.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q06.xq new file mode 100644 index 0000000..9327abe --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q06.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection := "regions" +for $b in collection($collection)/site/regions +return count($b//item) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q07.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q07.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q07.xq new file mode 100644 index 0000000..848f468 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q07.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection := "XMarkData" +for $p in collection($collection)/site +return count($p//description) + count($p//annotation) + count($p//emailaddress) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q08.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q08.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q08.xq new file mode 100644 index 0000000..fa6c1ea --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q08.xq @@ -0,0 +1,28 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "people" +for $p in collection($collection1)/site/people/person + let $a := count( + let $collection2 := "vxquery-xtest/src/test/resources/TestSources/XMarkData/closed_auctions/" + for $t in collection($collection2)/site/closed_auctions/closed_auction + where $t/buyer/@person = $p/@id + return $t + ) + return <item person="{$p/name/text()}">{$a}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q09.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q09.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q09.xq new file mode 100644 index 0000000..6ef31b7 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q09.xq @@ -0,0 +1,33 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection3 := "people" +for $p in collection($collection3)/site/people/person +let $a := + let $collection1 := "closed_auctions" + for $t in collection($collection1)/site/closed_auctions/closed_auction + where $p/@id = $t/buyer/@person + return + let $n := + let $collection2 := "regions" + for $t2 in collection($collection2)/site/regions/europe/item + where $t/itemref/@item = $t2/@id + return $t2 + return <item>{$n/name/text()}</item> +return <person name="{$p/name/text()}">{$a}</person> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q10.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q10.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q10.xq new file mode 100644 index 0000000..83ad0e0 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q10.xq @@ -0,0 +1,46 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "people" +for $i in distinct-values(collection($collection1)/site/people/person/profile/interest/@category) +let $p := + let $collection2 := "people" + for $t in collection($collection2)/site/people/person + where $t/profile/interest/@category = $i + return + <personne> + <statistiques> + <sexe>{$t/profile/gender/text()}</sexe> + <age>{$t/profile/age/text()}</age> + <education>{$t/profile/education/text()}</education> + <revenu>{fn:data($t/profile/@income)}</revenu> + </statistiques> + <coordonnees> + <nom>{$t/name/text()}</nom> + <rue>{$t/address/street/text()}</rue> + <ville>{$t/address/city/text()}</ville> + <pays>{$t/address/country/text()}</pays> + <reseau> + <courrier>{$t/emailaddress/text()}</courrier> + <pagePerso>{$t/homepage/text()}</pagePerso> + </reseau> + </coordonnees> + <cartePaiement>{$t/creditcard/text()}</cartePaiement> + </personne> +return <categorie>{<id>{$i}</id>, $p}</categorie> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q11.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q11.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q11.xq new file mode 100644 index 0000000..1d3d439 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q11.xq @@ -0,0 +1,27 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "people" +for $p in collection($collection1)/site/people/person +let $l := + let $collection2 := "open_auctions" + for $i in collection($collection2)/site/open_auctions/open_auction/initial + where $p/profile/@income > 5000 * exactly-one($i/text()) + return $i +return <items name="{$p/name/text()}">{count($l)}</items> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q12.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q12.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q12.xq new file mode 100644 index 0000000..ca08443 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q12.xq @@ -0,0 +1,28 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "people" +for $p in collection($collection1)/site/people/person +let $l := + let $collection2 := "open_auctions" + for $i in collection($collection2)/site/open_auctions/open_auction/initial + where $p/profile/@income > 5000 * exactly-one($i/text()) + return $i +where $p/profile/@income > 50000 +return <items person="{$p/profile/@income}">{count($l)}</items> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q13.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q13.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q13.xq new file mode 100644 index 0000000..8d75d4a --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q13.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "regions" +for $i in collection($collection1)/site/regions/australia/item +return <item name="{$i/name/text()}">{$i/description}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q14.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q14.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q14.xq new file mode 100644 index 0000000..d3b6218 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q14.xq @@ -0,0 +1,23 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "XMarkData" +for $i in collection($collection1)/site//item +where contains(string(exactly-one($i/description)), "gold") +return $i/name/text() http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q15.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q15.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q15.xq new file mode 100644 index 0000000..260e93a --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q15.xq @@ -0,0 +1,29 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "closed_auctions" +for $i in collection($collection1)/site/closed_auctions/closed_auction/annotation/description/parlist/ + listitem/ + parlist/ + listitem/ + text/ + emph/ + keyword/ + text() +return <text>{$a}</text> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q16.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q16.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q16.xq new file mode 100644 index 0000000..548e7ed --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q16.xq @@ -0,0 +1,30 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "closed_auctions" +for $a in collection($collection1)/site/closed_auctions/closed_auction +where + not( + empty( + $a/annotation/description/parlist/listitem/parlist/listitem/text/emph/ + keyword/ + text() + ) + ) +return <person id="{$a/seller/@person}"/> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q17.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q17.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q17.xq new file mode 100644 index 0000000..67c1c76 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q17.xq @@ -0,0 +1,23 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "people" +for $p in collection($collection1)/site/people/person +where empty($p/homepage/text()) +return <person name="{$p/name/text()}"/> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q18.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q18.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q18.xq new file mode 100644 index 0000000..c466796 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q18.xq @@ -0,0 +1,28 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +declare namespace local = "http://www.foobar.org"; +declare function local:convert($v as xs:decimal?) as xs:decimal? +{ + 2.20371 * $v (: convert Dfl to Euro :) +}; + +let $collection1 := "open_auctions" +for $i in collection($collection1)/site/open_auctions/open_auction +return local:convert(zero-or-one($i/reserve)) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q19.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q19.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q19.xq new file mode 100644 index 0000000..2030838 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q19.xq @@ -0,0 +1,24 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $collection1 := "regions" +for $b in collection($collection1)/site/regions/*/item +let $k := $b/name/text() +order by zero-or-one($b/location) ascending empty greatest +return <item name="{$k}">{$b/location/text()}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q20.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q20.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q20.xq new file mode 100644 index 0000000..6c65c9e --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Modified/q20.xq @@ -0,0 +1,58 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +<result> + <preferred> + { + count( + let $collection1 := "people" + for $b in collection($collection1)/site/people/person/profile[@income >= 100000] + return $b + ) + } + </preferred> + <standard> + { + count( + let $collection2 := "people" + for $c in collection($collection2)/site/people/person/profile[@income < 100000 and @income >= 30000] + return $c + ) + } + </standard> + <challenge> + { + count( + let $collection3 := "people" + for $d in collection($collection3)/site/people/person/profile[@income < 30000] + return $d + ) + } + </challenge> + <na> + { + count( + let $collection4 := "people" + for $p in collection($collection4)/site/people/person + where empty($p/profile/@income) + return $p + ) + } + </na> +</result> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q01.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q01.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q01.xq new file mode 100644 index 0000000..6488c90 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q01.xq @@ -0,0 +1,27 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction/site/people/person[@id = "person0"] return $b/name/text() + + + + + + http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q02.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q02.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q02.xq new file mode 100644 index 0000000..ed424a8 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q02.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction/site/open_auctions/open_auction +return <increase>{$b/bidder[1]/increase/text()}</increase> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q03.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q03.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q03.xq new file mode 100644 index 0000000..ae182b9 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q03.xq @@ -0,0 +1,26 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction/site/open_auctions/open_auction +where zero-or-one($b/bidder[1]/increase/text()) * 2 <= $b/bidder[last()]/increase/text() +return + <increase + first="{$b/bidder[1]/increase/text()}" + last="{$b/bidder[last()]/increase/text()}"/> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q04.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q04.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q04.xq new file mode 100644 index 0000000..0efa06e --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q04.xq @@ -0,0 +1,27 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction/site/open_auctions/open_auction +where + some $pr1 in $b/bidder/personref[@person = "person20"], + $pr2 in $b/bidder/personref[@person = "person51"] + satisfies $pr1 << $pr2 +return <history>{$b/reserve/text()}</history> + http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q05.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q05.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q05.xq new file mode 100644 index 0000000..879d86e --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q05.xq @@ -0,0 +1,25 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +count( + for $i in $auction/site/closed_auctions/closed_auction + where $i/price/text() >= 40 + return $i/price +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q06.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q06.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q06.xq new file mode 100644 index 0000000..6ece7c5 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q06.xq @@ -0,0 +1,21 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction//site/regions return count($b//item) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q07.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q07.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q07.xq new file mode 100644 index 0000000..aeb9d60 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q07.xq @@ -0,0 +1,23 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $p in $auction/site +return + count($p//description) + count($p//annotation) + count($p//emailaddress) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q08.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q08.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q08.xq new file mode 100644 index 0000000..111b3f9 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q08.xq @@ -0,0 +1,26 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $p in $auction/site/people/person +let $a := + for $t in $auction/site/closed_auctions/closed_auction + where $t/buyer/@person = $p/@id + return $t +return <item person="{$p/name/text()}">{count($a)}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q09.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q09.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q09.xq new file mode 100644 index 0000000..b4bd45c --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q09.xq @@ -0,0 +1,31 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +let $ca := $auction/site/closed_auctions/closed_auction return +let + $ei := $auction/site/regions/europe/item +for $p in $auction/site/people/person +let $a := + for $t in $ca + where $p/@id = $t/buyer/@person + return + let $n := for $t2 in $ei where $t/itemref/@item = $t2/@id return $t2 + return <item>{$n/name/text()}</item> +return <person name="{$p/name/text()}">{$a}</person> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q10.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q10.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q10.xq new file mode 100644 index 0000000..de528ef --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q10.xq @@ -0,0 +1,46 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $i in + distinct-values($auction/site/people/person/profile/interest/@category) +let $p := + for $t in $auction/site/people/person + where $t/profile/interest/@category = $i + return + <personne> + <statistiques> + <sexe>{$t/profile/gender/text()}</sexe> + <age>{$t/profile/age/text()}</age> + <education>{$t/profile/education/text()}</education> + <revenu>{fn:data($t/profile/@income)}</revenu> + </statistiques> + <coordonnees> + <nom>{$t/name/text()}</nom> + <rue>{$t/address/street/text()}</rue> + <ville>{$t/address/city/text()}</ville> + <pays>{$t/address/country/text()}</pays> + <reseau> + <courrier>{$t/emailaddress/text()}</courrier> + <pagePerso>{$t/homepage/text()}</pagePerso> + </reseau> + </coordonnees> + <cartePaiement>{$t/creditcard/text()}</cartePaiement> + </personne> +return <categorie>{<id>{$i}</id>, $p}</categorie> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q11.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q11.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q11.xq new file mode 100644 index 0000000..f642d2b --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q11.xq @@ -0,0 +1,26 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $p in $auction/site/people/person +let $l := + for $i in $auction/site/open_auctions/open_auction/initial + where $p/profile/@income > 5000 * exactly-one($i/text()) + return $i +return <items name="{$p/name/text()}">{count($l)}</items> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q12.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q12.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q12.xq new file mode 100644 index 0000000..21bb358 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q12.xq @@ -0,0 +1,27 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $p in $auction/site/people/person +let $l := + for $i in $auction/site/open_auctions/open_auction/initial + where $p/profile/@income > 5000 * exactly-one($i/text()) + return $i +where $p/profile/@income > 50000 +return <items person="{$p/profile/@income}">{count($l)}</items> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q13.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q13.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q13.xq new file mode 100644 index 0000000..1a386a4 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q13.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $i in $auction/site/regions/australia/item +return <item name="{$i/name/text()}">{$i/description}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q14.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q14.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q14.xq new file mode 100644 index 0000000..4d29c47 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q14.xq @@ -0,0 +1,23 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $i in $auction/site//item +where contains(string(exactly-one($i/description)), "gold") +return $i/name/text() http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q15.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q15.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q15.xq new file mode 100644 index 0000000..0411e29 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q15.xq @@ -0,0 +1,30 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $a in + $auction/site/closed_auctions/closed_auction/annotation/description/parlist/ + listitem/ + parlist/ + listitem/ + text/ + emph/ + keyword/ + text() +return <text>{$a}</text> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q16.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q16.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q16.xq new file mode 100644 index 0000000..45c20aa --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q16.xq @@ -0,0 +1,30 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $a in $auction/site/closed_auctions/closed_auction +where + not( + empty( + $a/annotation/description/parlist/listitem/parlist/listitem/text/emph/ + keyword/ + text() + ) + ) +return <person id="{$a/seller/@person}"/> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q17.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q17.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q17.xq new file mode 100644 index 0000000..d1e67f1 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q17.xq @@ -0,0 +1,23 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $p in $auction/site/people/person +where empty($p/homepage/text()) +return <person name="{$p/name/text()}"/> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q18.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q18.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q18.xq new file mode 100644 index 0000000..368223d --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q18.xq @@ -0,0 +1,28 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +declare namespace local = "http://www.foobar.org"; +declare function local:convert($v as xs:decimal?) as xs:decimal? +{ + 2.20371 * $v (: convert Dfl to Euro :) +}; + +let $auction := doc("auction_data") return +for $i in $auction/site/open_auctions/open_auction +return local:convert(zero-or-one($i/reserve)) http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q19.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q19.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q19.xq new file mode 100644 index 0000000..4f57a35 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q19.xq @@ -0,0 +1,24 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +for $b in $auction/site/regions//item +let $k := $b/name/text() +order by zero-or-one($b/location) ascending empty greatest +return <item name="{$k}">{$b/location/text()}</item> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q20.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q20.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q20.xq new file mode 100644 index 0000000..c6d3e92 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/q20.xq @@ -0,0 +1,45 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $auction := doc("auction_data") return +<result> + <preferred> + {count($auction/site/people/person/profile[@income >= 100000])} + </preferred> + <standard> + { + count( + $auction/site/people/person/ + profile[@income < 100000 and @income >= 30000] + ) + } + </standard> + <challenge> + {count($auction/site/people/person/profile[@income < 30000])} + </challenge> + <na> + { + count( + for $p in $auction/site/people/person + where empty($p/profile/@income) + return $p + ) + } + </na> +</result> http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query1.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query1.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query1.xq new file mode 100644 index 0000000..4938f64 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query1.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $test := "auction_data" +for $x in ($test) +return $x \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/b6f8d454/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query2.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query2.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query2.xq new file mode 100644 index 0000000..4bd3ab8 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/XMark/Original/simple_query2.xq @@ -0,0 +1,22 @@ +(: Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. :) + +(: XMark Query see README.md for full details. :) + +let $test := "auction_data" +for $b in doc($test)/site/catgraph +return $b
