source: TI07-MOLES/trunk/StubB/XQuery/DeploymentCount.xquery @ 2512

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI07-MOLES/trunk/StubB/XQuery/DeploymentCount.xquery@2512
Revision 2512, 1.7 KB checked in by ko23, 12 years ago (diff)

Update deployment count query

Line 
1declare default element namespace 'http://ndg.nerc.ac.uk/moles';
2element html {
3element table {
4for $Act in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
5[exists(dgActivity/ActivityDeployment)]
6order by count($Act/dgActivity/ActivityDeployment) descending
7return
8element tr {
9element td {data($Act/dgMetadataID/localIdentifier)}
10,
11element td {data($Act/name)},
12element td {data(count($Act/dgActivity/ActivityDeployment))}
13}
14},
15element table {
16for $DPT in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
17[exists(dgDataProductionTool/DPTDeployment)]
18order by count($DPT/dgDataProductionTool/DPTDeployment) descending
19return
20element tr {
21element td {data($DPT/dgMetadataID/localIdentifier)}
22,
23element td {data($DPT/name)},
24element td {data(count($DPT/dgDataProductionTool/DPTDeployment))}
25}
26},
27element table {
28for $ObsStn in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
29[exists(dgObservationStation/ObsStationDeployment)]
30order by count($ObsStn/dgObservationStation/ObsStationDeployment) descending
31return
32element tr {
33element td {data($ObsStn/dgMetadataID/localIdentifier)}
34,
35element td {data($ObsStn/name)},
36element td {data(count($ObsStn/dgObservationStation/ObsStationDeployment))}
37}
38},
39element table {
40for $DE in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
41[exists(dgDataEntity/RelatedDeployment)]
42order by count($DE/dgDataEntity/RelatedDeployment) descending
43return
44element tr {
45element td {data($DE/dgMetadataID/localIdentifier)}
46,
47element td {data($DE/name)},
48element td {data(count($DE/dgDataEntity/RelatedDeployment))}
49}
50}
51}
52
Note: See TracBrowser for help on using the repository browser.