1 | declare default element namespace 'http://ndg.nerc.ac.uk/moles/activity'; |
---|
2 | declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; |
---|
3 | declare namespace moles='http://ndg.nerc.ac.uk/moles'; |
---|
4 | |
---|
5 | import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; |
---|
6 | import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; |
---|
7 | (: |
---|
8 | Will return when scope problem sussed... ;( |
---|
9 | import module namespace stubblib='http://ndg.nerc.ac.uk/xquery/lib/stubb' at 'xmldb:exist:///db/xqueryLib/StubB/stubb_xquery_lib.xquery'; |
---|
10 | :) |
---|
11 | declare variable $targetCollection as xs:string {'TargetCollection'}; |
---|
12 | declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; |
---|
13 | declare variable $localIdentifier as xs:string {'LocalID'}; |
---|
14 | |
---|
15 | declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
16 | (: Returns a 'stubB' style activity record to expand an activity record :) |
---|
17 | (: Security not implemented here yet :) |
---|
18 | { |
---|
19 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
20 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
21 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
22 | return |
---|
23 | if ($found = 0) then |
---|
24 | element {$out-element-name} { |
---|
25 | element error {'not found'}, |
---|
26 | element repositoryIdentifier {$repid}, |
---|
27 | element localIdentifier {$locid} |
---|
28 | } |
---|
29 | else ( |
---|
30 | for $SRAct in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
31 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
32 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
33 | return |
---|
34 | element {$out-element-name} { |
---|
35 | ($SRAct/moles:dgMetadataID), |
---|
36 | ($SRAct/moles:dgMetadataDescription), |
---|
37 | ($SRAct/moles:name), |
---|
38 | ($SRAct/moles:abbreviation), |
---|
39 | element dgActivity { |
---|
40 | if (exists($SRAct/*/moles:dgActivityDataCollection)) then |
---|
41 | ($SRAct/*/moles:dgActivityDataCollection) |
---|
42 | else if (exists($SRAct/*/moles:dgActivityDataProject)) then |
---|
43 | ($SRAct/*/moles:dgActivityDataProject) |
---|
44 | else if (exists($SRAct/*/dgActivityDataCampaign)) then |
---|
45 | ($SRAct/moles:dgActivity/moles:dgActivityDataCampaign) |
---|
46 | else |
---|
47 | ($SRAct/moles:dgActivity/moles:dgActivityDataInvestigation), |
---|
48 | ($SRAct/moles:dgActivity/moles:dgActivityCoverage), |
---|
49 | ($SRAct/moles:dgActivity/moles:dgActivityDuration) |
---|
50 | } (: </dgActivity> :) |
---|
51 | } (: </activity> :) |
---|
52 | ) |
---|
53 | } ; |
---|
54 | |
---|
55 | declare function f:return-stub-dataentity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
56 | (: Returns a 'stubB' style observation station record to expand an data entity record :) |
---|
57 | (: Security not implemented yet :) |
---|
58 | { |
---|
59 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
60 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
61 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
62 | return |
---|
63 | if ($found = 0) then |
---|
64 | element {$out-element-name} { |
---|
65 | element error {'not found'}, |
---|
66 | element repositoryIdentifier {$repid}, |
---|
67 | element localIdentifier {$locid} |
---|
68 | } |
---|
69 | else ( |
---|
70 | for $SRDE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
71 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
72 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
73 | return |
---|
74 | element {$out-element-name} { |
---|
75 | ($SRDE/moles:dgMetadataID), |
---|
76 | ($SRDE/moles:dgMetadataDescription), |
---|
77 | ($SRDE/moles:name), |
---|
78 | ($SRDE/moles:abbreviation), |
---|
79 | element dgDataEntity { |
---|
80 | ($SRDE/moles:dgDataEntity/moles:dgDataSetType), |
---|
81 | ($SRDE/moles:dgDataEntity/moles:dgDataGranule), |
---|
82 | ($SRDE/moles:dgDataEntity/moles:dgDataSummary) |
---|
83 | } (: </dgDataEntity> :) |
---|
84 | } |
---|
85 | ) |
---|
86 | } ; |
---|
87 | |
---|
88 | declare function f:return-stub-dpt($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
89 | (: Returns a 'stubB' style dpt record to expand a dpt record :) |
---|
90 | (: Security not implemented yet :) |
---|
91 | { |
---|
92 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
93 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
94 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
95 | return |
---|
96 | if ($found = 0) then |
---|
97 | element {$out-element-name} { |
---|
98 | element error {'not found'}, |
---|
99 | element repositoryIdentifier {$repid}, |
---|
100 | element localIdentifier {$locid} |
---|
101 | } |
---|
102 | else ( |
---|
103 | for $SRDPT in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
104 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
105 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
106 | return |
---|
107 | element {$out-element-name} { |
---|
108 | $SRDPT/moles:dgMetadataID, |
---|
109 | $SRDPT/moles:dgMetadataDescription, |
---|
110 | $SRDPT/moles:name, |
---|
111 | $SRDPT/moles:abbreviation, |
---|
112 | $SRDPT/moles:logos, |
---|
113 | element dgDataProductionTool { |
---|
114 | $SRDPT/moles:dgDataProductionTool/moles:contactDetails, |
---|
115 | if (exists($SRDPT/moles:dgDataProductionTool/moles:dgModel)) then |
---|
116 | $SRDPT/moles:dgDataProductionTool/moles:dgModel |
---|
117 | else (), |
---|
118 | if (exists($SRDPT/moles:dgDataProductionTool/moles:dgInstrument)) then |
---|
119 | $SRDPT/moles:dgDataProductionTool/moles:dgInstrument |
---|
120 | else () |
---|
121 | } (: </dgDataProductionTool> :) |
---|
122 | } (: </dataproductiontool> :) |
---|
123 | ) |
---|
124 | } ; |
---|
125 | |
---|
126 | declare function f:return-stub-obsstn($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
127 | (: Returns a 'stubB' style observation station record to expand an observation station record :) |
---|
128 | (: Security not implemented here yet; :) |
---|
129 | { |
---|
130 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
131 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
132 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
133 | return |
---|
134 | if ($found = 0) then |
---|
135 | element {$out-element-name} { |
---|
136 | element error {'not found'}, |
---|
137 | element repositoryIdentifier {$repid}, |
---|
138 | element localIdentifier {$locid} |
---|
139 | } |
---|
140 | else ( |
---|
141 | for $SRObsStn in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
142 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
143 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
144 | return |
---|
145 | element {$out-element-name} { |
---|
146 | ($SRObsStn/moles:dgMetadataID), |
---|
147 | ($SRObsStn/moles:dgMetadataDescription), |
---|
148 | ($SRObsStn/moles:name), |
---|
149 | ($SRObsStn/moles:abbreviation), |
---|
150 | element dgObservationStation { |
---|
151 | ($SRObsStn/moles:dgObservationStation/moles:contactDetails), |
---|
152 | if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform)) then |
---|
153 | element dgStationaryPlatform { |
---|
154 | $SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:position, |
---|
155 | if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/dgLandStation)) then element dgLandStation {''} |
---|
156 | else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/dgMooring)) then element dgMooring {''} |
---|
157 | else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/dgStationGroup)) then element dgStationGroup {''} |
---|
158 | else () |
---|
159 | } |
---|
160 | else if (exists($SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform)) then |
---|
161 | $SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform |
---|
162 | else () |
---|
163 | } (: </dgObservationStation> :) |
---|
164 | } |
---|
165 | ) |
---|
166 | } ; |
---|
167 | |
---|
168 | declare function f:return-stub-person($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
169 | (: Returns a 'stubB' style observation station record to expand a person record :) |
---|
170 | (: Security not implemented yet :) |
---|
171 | { |
---|
172 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgPerson[ |
---|
173 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
174 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
175 | return |
---|
176 | if ($found = 0) then |
---|
177 | element {$out-element-name} { |
---|
178 | element error {'not found'}, |
---|
179 | element repositoryIdentifier {$repid}, |
---|
180 | element localIdentifier {$locid} |
---|
181 | } |
---|
182 | else ( |
---|
183 | for $person in collection($targetCollection)/moles:dgMetadata/moles:dgPerson[ |
---|
184 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
185 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
186 | return |
---|
187 | element {$out-element-name} |
---|
188 | { |
---|
189 | ($person/moles:name), |
---|
190 | ($person/moles:contactDetails), |
---|
191 | ($person/moles:dgMetadataID) |
---|
192 | } |
---|
193 | ) |
---|
194 | } ; |
---|
195 | |
---|
196 | declare function f:return-stub-organisation($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element() |
---|
197 | (: Returns a 'stubB' style observation station record to expand an organisation record :) |
---|
198 | (: Security not implemented yet :) |
---|
199 | { |
---|
200 | let $found := count(collection($targetCollection)/moles:dgMetadata/moles:dgOrganisation[ |
---|
201 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
202 | and moles:dgMetadataID/moles:localIdentifier=$locid]) |
---|
203 | return |
---|
204 | if ($found = 0) then |
---|
205 | element {$out-element-name} { |
---|
206 | element error {'not found'}, |
---|
207 | element repositoryIdentifier {$repid}, |
---|
208 | element localIdentifier {$locid} |
---|
209 | } |
---|
210 | else ( |
---|
211 | for $org in collection($targetCollection)/moles:dgMetadata/moles:dgOrganisation[ |
---|
212 | moles:dgMetadataID/moles:repositoryIdentifier=$repid |
---|
213 | and moles:dgMetadataID/moles:localIdentifier=$locid] |
---|
214 | return |
---|
215 | element {$out-element-name} { |
---|
216 | $org/moles:dgMetadataID, |
---|
217 | $org/moles:name, |
---|
218 | $org/moles:abbreviation, |
---|
219 | $org/moles:contactDetails, |
---|
220 | $org/moles:logos |
---|
221 | } |
---|
222 | ) |
---|
223 | } ; |
---|
224 | |
---|
225 | for $Act in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
226 | moles:dgActivity!='' |
---|
227 | and moles:dgMetadataID[ |
---|
228 | moles:schemeIdentifier='NDG-B0' |
---|
229 | and moles:repositoryIdentifier=$repositoryIdentifier |
---|
230 | and moles:localIdentifier=$localIdentifier]] |
---|
231 | return |
---|
232 | utillib:strip-namespace(element dgMetadataRecord { |
---|
233 | element dgMetadataID { |
---|
234 | element schemeIdentifier {'NDG-B1'}, |
---|
235 | (element repositoryIdentifier {data($Act/moles:dgMetadataID/moles:repositoryIdentifier)}), |
---|
236 | element localIdentifier {data($Act/moles:dgMetadataID/moles:localIdentifier)} |
---|
237 | }, |
---|
238 | $Act/moles:dgMetadataDescription, |
---|
239 | $Act/moles:name, |
---|
240 | $Act/moles:abbreviation, |
---|
241 | element dgActivity { |
---|
242 | for $RelatedActivities in $Act/dgActivity/moles:relatedActivity |
---|
243 | return |
---|
244 | element relatedActivity { |
---|
245 | $RelatedActivities/moles:activityRelation, |
---|
246 | f:return-stub-activity('activity', data($RelatedActivities/moles:relatedActivityID/moles:repositoryIdentifier), data($RelatedActivities/moles:relatedActivityID/moles:localIdentifier)) |
---|
247 | }, (: </relatedActivity> :) |
---|
248 | if (exists($Act/moles:dgActivity/moles:dgActivityDataCollection)) then ($Act/moles:dgActivity/moles:dgActivityDataCollection) |
---|
249 | else if (exists($Act/moles:dgActivity/moles:dgActivityDataProject)) then ($Act/moles:dgActivity/moles:dgActivityDataProject) |
---|
250 | else if (exists($Act/moles:dgActivity/moles:dgActivityDataInvestigation)) then ($Act/moles:dgActivity/moles:dgActivityDataInvestigation) |
---|
251 | else if (exists($Act/moles:dgActivity/moles:dgActivityDataCampaign)) then ($Act/moles:dgActivity/moles:dgActivityDataCampaign) |
---|
252 | else (), |
---|
253 | element dgActivityRole { |
---|
254 | element dgInvestigator { |
---|
255 | element dgPrincipalInvestigator { |
---|
256 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgPrincipalInvestigator/moles:dgMetadataID), |
---|
257 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgPrincipalInvestigator/moles:roleName), |
---|
258 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgPrincipalInvestigator/moles:abbreviation), |
---|
259 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgPrincipalInvestigator/moles:contactDetails), |
---|
260 | for $PIRole in $Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgPrincipalInvestigator/moles:dgRoleHolder |
---|
261 | order by $PIRole/moles:startDate empty least, $PIRole/moles:endDate empty least |
---|
262 | return |
---|
263 | element dgRoleHolder { |
---|
264 | if (exists($PIRole/moles:dgOrganisationID)) then |
---|
265 | f:return-stub-organisation('organisation', data($PIRole/moles:dgOrganisationID/moles:repositoryIdentifier), data($PIRole/moles:dgOrganisationID/moles:localIdentifier)) |
---|
266 | else if (exists($PIRole/moles:dgPersonID)) then |
---|
267 | f:return-stub-person('person', string($PIRole/moles:dgPersonID/moles:repositoryIdentifier), string($PIRole/moles:dgPersonID/moles:localIdentifier)) |
---|
268 | else (), |
---|
269 | ($PIRole/moles:startDate), |
---|
270 | if (exists($PIRole/moles:endDate)) then |
---|
271 | ($PIRole/moles:endDate) |
---|
272 | else (), |
---|
273 | if (exists($PIRole/moles:localName)) then |
---|
274 | ($PIRole/moles:localName) |
---|
275 | else () |
---|
276 | } (: </dgRoleHolder> :) |
---|
277 | }, (: </dgPrincipalInvestigator> :) |
---|
278 | for $CI in $Act/moles:dgActivity/moles:dgActivityRole/moles:dgInvestigator/moles:dgCoInvestigator |
---|
279 | return |
---|
280 | element dgCoInvestigator { |
---|
281 | ($CI/moles:dgMetadataID), |
---|
282 | ($CI/moles:roleName), |
---|
283 | ($CI/moles:abbreviation), |
---|
284 | ($CI/moles:contactDetails), |
---|
285 | for $CIRole in $CI/moles:dgRoleHolder |
---|
286 | order by $CIRole/moles:startDate empty least, $CIRole/moles:endDate empty least |
---|
287 | return |
---|
288 | element dgRoleHolder { |
---|
289 | if (exists(CIRole/moles:dgOrganisationID)) then |
---|
290 | f:return-stub-organisation('organisation', data($CIRole/moles:dgOrganisationID/moles:repositoryIdentifier), data($CIRole/moles:dgOrganisationID/moles:localIdentifier)) |
---|
291 | else if (exists($CIRole/moles:dgPersonID)) then |
---|
292 | f:return-stub-person('person', string($CIRole/moles:dgPersonID/moles:repositoryIdentifier), string($CIRole/moles:dgPersonID/moles:localIdentifier)) |
---|
293 | else (), |
---|
294 | ($CIRole/moles:startDate), |
---|
295 | if (exists($CIRole/moles:endDate)) then |
---|
296 | ($CIRole/moles:endDate) |
---|
297 | else (), |
---|
298 | if (exists($CIRole/moles:localName)) then |
---|
299 | ($CIRole/moles:localName) |
---|
300 | else () |
---|
301 | } (: </dgRoleHolder> :) |
---|
302 | } (: </dgCoInvestigator> :) |
---|
303 | }, (: </dgInvestigator> :) |
---|
304 | if (exists($Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact)) then ( |
---|
305 | element dgTechnicalContact { |
---|
306 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact/moles:dgMetadataID), |
---|
307 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact/moles:roleName), |
---|
308 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact/moles:abbreviation), |
---|
309 | ($Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact/moles:contactDetails), |
---|
310 | for $TechConRole in $Act/moles:dgActivity/moles:dgActivityRole/moles:dgTechnicalContact/moles:dgRoleHolder |
---|
311 | order by $TechConRole/moles:startDate empty least, $TechConRole/moles:endDate empty least |
---|
312 | return |
---|
313 | element dgRoleHolder { |
---|
314 | if (exists($TechConRole/moles:dgOrganisationID)) then |
---|
315 | f:return-stub-organisation('organisation', data($TechConRole/moles:dgOrganisationID/moles:repositoryIdentifier), data($TechConRole/moles:dgOrganisationID/moles:localIdentifier)) |
---|
316 | else if (exists($TechConRole/moles:dgPersonID)) then |
---|
317 | f:return-stub-person('person', string($TechConRole/moles:dgPersonID/moles:repositoryIdentifier), string($TechConRole/moles:dgPersonID/moles:localIdentifier)) |
---|
318 | else (), |
---|
319 | ($TechConRole/moles:startDate), |
---|
320 | if (exists($TechConRole/moles:endDate)) then |
---|
321 | ($TechConRole/moles:endDate) |
---|
322 | else (), |
---|
323 | if (exists($TechConRole/moles:localName)) then |
---|
324 | ($TechConRole/moles:localName) |
---|
325 | else () |
---|
326 | } (: </dgRoleHolder> :) |
---|
327 | } (: </dgTechnicalContact> :) |
---|
328 | ) |
---|
329 | else (), |
---|
330 | if (exists($Act/dgActivity/dgActivityRole/dgProjectManager)) then ( |
---|
331 | element dgProjectManager { |
---|
332 | ($Act/dgActivity/dgActivityRole/dgProjectManager/dgMetadataID), |
---|
333 | ($Act/dgActivity/dgActivityRole/dgProjectManager/roleName), |
---|
334 | ($Act/dgActivity/dgActivityRole/dgProjectManager/abbreviation), |
---|
335 | ($Act/dgActivity/dgActivityRole/dgProjectManager/contactDetails), |
---|
336 | for $PMRole in $Act/dgActivity/dgActivityRole/dgProjectManager/dgRoleHolder |
---|
337 | order by $PMRole/startDate empty least, $PMRole/endDate empty least |
---|
338 | return |
---|
339 | element dgRoleHolder { |
---|
340 | if (exists($PMRole/moles:dgOrganisationID)) then |
---|
341 | f:return-stub-organisation('organisation', data($PMRole/moles:dgOrganisationID/moles:repositoryIdentifier), data($PMRole/moles:dgOrganisationID/moles:localIdentifier)) |
---|
342 | else if (exists($PMRole/moles:dgPersonID)) then |
---|
343 | f:return-stub-person('person', string($PMRole/moles:dgPersonID/moles:repositoryIdentifier), string($PMRole/moles:dgPersonID/moles:localIdentifier)) |
---|
344 | else (), |
---|
345 | ($PMRole/startDate), |
---|
346 | if (exists($PMRole/moles:endDate)) then |
---|
347 | ($PMRole/moles:endDate) |
---|
348 | else (), |
---|
349 | if (exists($PMRole/moles:localName)) then |
---|
350 | ($PMRole/moles:localName) |
---|
351 | else () |
---|
352 | } (: </dgRoleHolder> :) |
---|
353 | } (: </dgProjectManager> :) |
---|
354 | ) |
---|
355 | else () |
---|
356 | }, (: </dgActivityRole> :) |
---|
357 | for $RelDep in $Act/moles:dgActivity/moles:ActivityDeployment |
---|
358 | return |
---|
359 | element ActivityDeployment { |
---|
360 | ($RelDep/moles:DateStart), |
---|
361 | if (exists($RelDep/moles:DateEnd)) then |
---|
362 | ($RelDep/moles:DateEnd) |
---|
363 | else (), |
---|
364 | ($RelDep/moles:dgMetadataID), |
---|
365 | f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), |
---|
366 | f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), |
---|
367 | for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord |
---|
368 | where $DE/moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier |
---|
369 | and $DE/moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier |
---|
370 | return |
---|
371 | f:return-stub-dataentity('dataentity', data($DE/moles:dgMetadataID/moles:repositoryIdentifier), data($DE/moles:dgMetadataID/moles:localIdentifier)) |
---|
372 | }, (: </ActivityDeployment> :) |
---|
373 | if (exists($Act/dgActivityCoverage)) then |
---|
374 | ($Act/dgActivityCoverage) |
---|
375 | else (), |
---|
376 | if (exists($Act/dgActivityDuration)) then |
---|
377 | ($Act/dgActivityDuration) |
---|
378 | else () |
---|
379 | } , (: </dgActivity> :) |
---|
380 | for $strkwrd in $Act/moles:dgStructuredKeyword return $strkwrd, |
---|
381 | if (exists($Act/moles:dgMetadataProvenance)) then $Act/moles:dgMetadataProvenance else (), |
---|
382 | if (exists($Act/moles:dgMetadataSecurity)) then $Act/moles:dgMetadataSecurity else () |
---|
383 | } (:</dgMRecord>:) |
---|
384 | ) (: End namespace strip :) |
---|