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

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

Update of ndg_xqueries.py to include time-out capability

Line 
1declare default element namespace 'http://ndg.nerc.ac.uk/moles';
2element html {
3element table {
4element tr {
5element td {'localIdentifier'},
6element td {'Name'},
7element td {'Deployment'},
8element td {'Data Entities'}
9},
10for $Act in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
11[exists(dgActivity/ActivityDeployment)]
12order by count($Act/dgActivity/ActivityDeployment) descending
13return
14element tr {
15element td {data($Act/dgMetadataID/localIdentifier)}
16,
17element td {data($Act/name)},
18element td {data(count($Act/dgActivity/ActivityDeployment))}
19,
20let $DEDepl := count(collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord/dgDataEntity/RelatedDeployment[ActivityID[localIdentifier=$Act/dgMetadataID/localIdentifier and repositoryIdentifier=$Act/dgMetadataID/repositoryIdentifier]])
21return
22element td {data(
23$DEDepl
24)}
25}
26},
27element table {
28element tr {
29element td {'localIdentifier'},
30element td {'Name'},
31element td {'Deployment'},
32element td {'Data Entities'}
33},
34for $DPT in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
35[exists(dgDataProductionTool/DPTDeployment)]
36order by count($DPT/dgDataProductionTool/DPTDeployment) descending
37return
38element tr {
39element td {data($DPT/dgMetadataID/localIdentifier)}
40,
41element td {data($DPT/name)},
42element td {data(count($DPT/dgDataProductionTool/DPTDeployment))},
43let $DEDepl := count(collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord/dgDataEntity/RelatedDeployment[DataProductionToolID[localIdentifier=$DPT/dgMetadataID/localIdentifier and repositoryIdentifier=$DPT/dgMetadataID/repositoryIdentifier]])
44return
45element td {data(
46$DEDepl
47)}
48}
49},
50element table {
51element tr {
52element td {'localIdentifier'},
53element td {'Name'},
54element td {'Deployment'},
55element td {'Data Entities'}
56},
57for $ObsStn in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
58[exists(dgObservationStation/ObsStationDeployment)]
59order by count($ObsStn/dgObservationStation/ObsStationDeployment) descending
60return
61element tr {
62element td {data($ObsStn/dgMetadataID/localIdentifier)}
63,
64element td {data($ObsStn/name)},
65element td {data(count($ObsStn/dgObservationStation/ObsStationDeployment))}
66,
67let $DEDepl := count(collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord/dgDataEntity/RelatedDeployment[ObservationStationID[localIdentifier=$ObsStn/dgMetadataID/localIdentifier and repositoryIdentifier=$ObsStn/dgMetadataID/repositoryIdentifier]])
68return
69element td {data(
70$DEDepl
71)}
72}
73},
74element table {
75for $DE in collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/dgMetadata/dgMetadataRecord
76[exists(dgDataEntity/RelatedDeployment)]
77order by count($DE/dgDataEntity/RelatedDeployment) descending
78return
79element tr {
80element td {data($DE/dgMetadataID/localIdentifier)}
81,
82element td {data($DE/name)},
83element td {data(count($DE/dgDataEntity/RelatedDeployment))}
84}
85}
86}
Note: See TracBrowser for help on using the repository browser.