Added queries to help with join details.

Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/6b7aa1de
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/6b7aa1de
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/6b7aa1de

Branch: refs/heads/prestonc/exrt_benchmark_queries
Commit: 6b7aa1de5ac5a1e894a9c0a822e05e6e2aae716e
Parents: f6390c3
Author: Preston Carman <[email protected]>
Authored: Mon Sep 22 20:11:16 2014 -0700
Committer: Preston Carman <[email protected]>
Committed: Mon Sep 22 20:15:08 2014 -0700

----------------------------------------------------------------------
 .../resources/noaa-ghcn-daily/queries/q04.xq    |  8 +++--
 .../noaa-ghcn-daily/queries/q04_count_join.xq   | 34 ++++++++++++++++++++
 .../noaa-ghcn-daily/queries/q04_count_sensor.xq | 29 +++++++++++++++++
 .../queries/q04_count_station.xq                | 28 ++++++++++++++++
 .../noaa-ghcn-daily/queries/q04_sensor.xq       | 27 ----------------
 .../noaa-ghcn-daily/queries/q04_station.xq      | 25 --------------
 .../noaa-ghcn-daily/queries/q05_count_join.xq   | 33 +++++++++++++++++++
 .../noaa-ghcn-daily/queries/q05_count_sensor.xq | 28 ++++++++++++++++
 .../queries/q05_count_station.xq                | 25 ++++++++++++++
 .../noaa-ghcn-daily/queries/q05_sensor.xq       | 28 ----------------
 .../noaa-ghcn-daily/queries/q05_station.xq      | 25 --------------
 .../noaa-ghcn-daily/queries/q06_count_join.xq   | 32 ++++++++++++++++++
 .../noaa-ghcn-daily/queries/q06_count_sensor.xq | 26 +++++++++++++++
 .../queries/q06_count_station.xq                | 24 ++++++++++++++
 .../noaa-ghcn-daily/queries/q06_sensor.xq       | 27 ----------------
 .../noaa-ghcn-daily/queries/q06_station.xq      | 24 --------------
 .../noaa-ghcn-daily/queries/q07_count_join.xq   | 32 ++++++++++++++++++
 .../noaa-ghcn-daily/queries/q07_count_tmax.xq   | 25 ++++++++++++++
 .../noaa-ghcn-daily/queries/q07_count_tmin.xq   | 25 ++++++++++++++
 .../noaa-ghcn-daily/queries/q07_tmax.xq         | 26 ---------------
 .../noaa-ghcn-daily/queries/q07_tmin.xq         | 26 ---------------
 21 files changed, 346 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
index 5b7246d..7d5fd77 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
@@ -15,9 +15,11 @@
    specific language governing permissions and limitations
    under the License. :)
 
-(: XQuery Join Query :)
-(: Find all the weather readings for Washington state for a specific day    :)
-(: 1976/7/4.                                                                  
:)
+(:
+XQuery Join Query
+-------------------
+Find all the weather readings for Washington state for a specific day 
1976/7/4. 
+:)
 let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
 for $s in collection($station_collection)/stationCollection/station
 

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_join.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_join.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_join.xq
new file mode 100644
index 0000000..b28312e
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_join.xq
@@ -0,0 +1,34 @@
+(: 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. :)
+
+(:
+XQuery Join Query
+-------------------
+Find all the weather readings for Washington state for a specific day 
1976/7/4. 
+:)
+fn:count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+
+    where $s/id eq $r/station 
+        and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and 
fn:upper-case(fn:data($x/displayName)) eq "WASHINGTON"))
+        and xs:dateTime(fn:data($r/date)) eq 
xs:dateTime("1976-07-04T00:00:00.000")
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_sensor.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_sensor.xq
new file mode 100644
index 0000000..15b5160
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_sensor.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. :)
+
+(:
+XQuery Join Query
+-------------------
+Count all the weather sensor readings on 1976-07-04.
+:)
+count(
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
+    where $date eq xs:date("1976-07-04")
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_station.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_station.xq
new file mode 100644
index 0000000..d21fe37
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_count_station.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. :)
+
+(:
+XQuery Join Query
+-------------------
+Count all the weather stations for Washington state.
+:)
+count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and 
fn:upper-case(fn:data($x/displayName)) eq "WASHINGTON"))
+    return $s
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
deleted file mode 100644
index 6c7810a..0000000
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
+++ /dev/null
@@ -1,27 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Count all the weather sensor readings on 1976-07-04.                       
:)
-count(
-    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r in collection($sensor_collection)/dataCollection/data
-        
-    let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
-    where $date eq xs:date("1976-07-04")
-    return $r
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
deleted file mode 100644
index 18e627a..0000000
--- 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
+++ /dev/null
@@ -1,25 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Count all the weather stations for Washington state.                       
:)
-count(
-    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
-    for $s in collection($station_collection)/stationCollection/station
-    where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and 
fn:upper-case(fn:data($x/displayName)) eq "WASHINGTON"))
-    return $s
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_join.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_join.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_join.xq
new file mode 100644
index 0000000..b5bbc2e
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_join.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. :)
+
+(: XQuery Join Aggregate Query :)
+(: Find the lowest recorded temperature (TMIN) in the United States for     :)
+(: 2001.                                                                      
:)
+fn:count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    
+    where $s/id eq $r/station
+        and (some $x in $s/locationLabels satisfies ($x/type eq "CNTRY" and 
$x/id eq "FIPS:US"))
+        and $r/dataType eq "TMIN" 
+        and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2001
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_sensor.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_sensor.xq
new file mode 100644
index 0000000..8548742
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_sensor.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. :)
+
+(: XQuery Join Aggregate Query :)
+(: Count all sensor readings for TMIN in 2001.                                
:)
+count(
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    
+    let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
+    where $r/dataType eq "TMIN" 
+        and fn:year-from-date($date) eq 2001
+    return $r/value
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_station.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_station.xq
new file mode 100644
index 0000000..6f3a6b8
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_count_station.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. :)
+
+(: XQuery Join Aggregate Query :)
+(: Count all stations in the United States.                                 :)
+count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    where (some $x in $s/locationLabels satisfies ($x/type eq "CNTRY" and 
$x/id eq "FIPS:US"))
+    return $s
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
deleted file mode 100644
index 8548742..0000000
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
+++ /dev/null
@@ -1,28 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Aggregate Query :)
-(: Count all sensor readings for TMIN in 2001.                                
:)
-count(
-    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r in collection($sensor_collection)/dataCollection/data
-    
-    let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
-    where $r/dataType eq "TMIN" 
-        and fn:year-from-date($date) eq 2001
-    return $r/value
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
deleted file mode 100644
index 6f3a6b8..0000000
--- 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
+++ /dev/null
@@ -1,25 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Aggregate Query :)
-(: Count all stations in the United States.                                 :)
-count(
-    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
-    for $s in collection($station_collection)/stationCollection/station
-    where (some $x in $s/locationLabels satisfies ($x/type eq "CNTRY" and 
$x/id eq "FIPS:US"))
-    return $s
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_join.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_join.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_join.xq
new file mode 100644
index 0000000..9ccfc70
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_join.xq
@@ -0,0 +1,32 @@
+(: 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. :)
+
+(: XQuery Join Query :)
+(: Find the highest recorded temperature (TMAX) for each station for each     
:)
+(: day over the year 2000.                                                    
:)
+fn:count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    
+    where $s/id eq $r/station
+        and $r/dataType eq "TMAX" 
+        and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2000
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_sensor.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_sensor.xq
new file mode 100644
index 0000000..d0a0c0a
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_sensor.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. :)
+
+(: XQuery Join Query :)
+(: Count max temperature (TMAX) readings for 2000-01-01.                       
   :)
+count(
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    where $r/dataType eq "TMAX" 
+       and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2000
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_station.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_station.xq
new file mode 100644
index 0000000..3c1dc98
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_count_station.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. :)
+
+(: XQuery Join Query :)
+(: Count all the stations.                                         :)
+count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    return $s
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
deleted file mode 100644
index 1938151..0000000
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
+++ /dev/null
@@ -1,27 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Count max temperature (TMAX) readings for 2000-01-01.                       
   :)
-count(
-    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r in collection($sensor_collection)/dataCollection/data
-    
-    where $r/dataType eq "TMAX" 
-       and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2000
-    return $r
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_station.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_station.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_station.xq
deleted file mode 100644
index 3c1dc98..0000000
--- 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_station.xq
+++ /dev/null
@@ -1,24 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Count all the stations.                                         :)
-count(
-    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
-    for $s in collection($station_collection)/stationCollection/station
-    return $s
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_join.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_join.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_join.xq
new file mode 100644
index 0000000..a1f6818
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_join.xq
@@ -0,0 +1,32 @@
+(: 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. :)
+
+(: XQuery Join Query :)
+(: Find the all the records for TMIN.                                         
:)
+fn:count(
+    let $sensor_collection_min := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r_min in collection($sensor_collection_min)/dataCollection/data
+    
+    let $sensor_collection_max := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r_max in collection($sensor_collection_max)/dataCollection/data
+    
+    where $r_min/station eq $r_max/station
+        and $r_min/date eq $r_max/date
+        and $r_min/dataType eq "TMIN"
+        and $r_max/dataType eq "TMAX"
+    return $r_max
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmax.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmax.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmax.xq
new file mode 100644
index 0000000..1ec7362
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmax.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. :)
+
+(: XQuery Join Query :)
+(: Find the all the records for TMAX.                                         
:)
+count(
+    let $sensor_collection_max := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r_max in collection($sensor_collection_max)/dataCollection/data
+    where $r_max/dataType eq "TMAX"
+    return $r_max
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmin.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmin.xq
 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmin.xq
new file mode 100644
index 0000000..2391c70
--- /dev/null
+++ 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_count_tmin.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. :)
+
+(: XQuery Join Query :)
+(: Find the all the records for TMIN.                                         
:)
+count(
+    let $sensor_collection_min := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r_min in collection($sensor_collection_min)/dataCollection/data
+    where $r_min/dataType eq "TMIN"
+    return $r_min
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmax.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmax.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmax.xq
deleted file mode 100644
index a48cad5..0000000
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmax.xq
+++ /dev/null
@@ -1,26 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Find the all the records for TMAX.                                         
:)
-count(
-    let $sensor_collection_max := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r_max in collection($sensor_collection_max)/dataCollection/data
-    
-    where $r_max/dataType eq "TMAX"
-    return $r_max
-)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/6b7aa1de/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmin.xq
----------------------------------------------------------------------
diff --git 
a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmin.xq 
b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmin.xq
deleted file mode 100644
index 4a72d0f..0000000
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07_tmin.xq
+++ /dev/null
@@ -1,26 +0,0 @@
-(: 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. :)
-
-(: XQuery Join Query :)
-(: Find the all the records for TMIN.                                         
:)
-count(
-    let $sensor_collection_min := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r_min in collection($sensor_collection_min)/dataCollection/data
-    
-    where $r_min/dataType eq "TMIN"
-    return $r_min
-)
\ No newline at end of file

Reply via email to