1 | import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; |
---|
2 | import module namespace utillib='http://ndg.nerc.ac.uk/xquery/lib/utilities' at 'xmldb:exist:///db/xqueryLib/Utilities/utility_xquery_lib.xquery'; |
---|
3 | declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; |
---|
4 | declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'; |
---|
5 | declare namespace moles='http://ndg.nerc.ac.uk/moles'; |
---|
6 | declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; |
---|
7 | |
---|
8 | (: Keep |
---|
9 | declare variable $targetCollection as xs:string {'TargetCollection'}; |
---|
10 | declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; |
---|
11 | declare variable $localIdentifier as xs:string {'LocalID'}; |
---|
12 | :) |
---|
13 | declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; |
---|
14 | declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; |
---|
15 | declare variable $localIdentifier as xs:string {'dataent_CIRA'}; |
---|
16 | |
---|
17 | for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ |
---|
18 | exists('moles:dgDataEntity') |
---|
19 | and moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' |
---|
20 | and moles:dgMetadataID/moles:repositoryIdentifier=$repositoryIdentifier |
---|
21 | and moles:dgMetadataID/moles:localIdentifier=$localIdentifier] |
---|
22 | return |
---|
23 | element DIF { |
---|
24 | attribute xsi:schemaLocation {'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/ http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif_v9.4.xsd'}, |
---|
25 | element Entry_ID {concat($DE/moles:dgMetadataID/moles:repositoryIdentifier, ':DIF:', $DE/moles:dgMetadataID/moles:localIdentifier)}, |
---|
26 | element Entry_Title {string($DE/moles:name)}, |
---|
27 | element Data_Set_Citation { |
---|
28 | for $DataCreatorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder[not(exists(moles:endDate)) or moles:endDate=''][1] |
---|
29 | return |
---|
30 | for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/*[(moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' |
---|
31 | and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/*/moles:repositoryIdentifier |
---|
32 | and moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/*/moles:localIdentifier)] |
---|
33 | return |
---|
34 | element Data_Creator { |
---|
35 | if (exists($DataCreatorRoleHolder/moles:name/moles:initials)) then |
---|
36 | string(concat(string($DataCreatorRoleHolder/moles:name/moles:initials), ' ', string($DataCreatorRoleHolder/moles:name/moles:familyName))) |
---|
37 | else |
---|
38 | string($DataCreatorRoleHolder/moles:abbreviation) |
---|
39 | }, |
---|
40 | element Dataset_Title {string($DE/moles:name)} |
---|
41 | }, |
---|
42 | element Personnel {''}, |
---|
43 | element Discipline {''}, |
---|
44 | for $StructuredKeyword in ($DE//(moles:dgStructuredKeyword | moles:dgStdParameterMeasured)[moles:dgValidTermID/moles:ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and moles:ListLevel = 0]) |
---|
45 | return if (exists($StructuredKeyword/*/moles:dgValidTerm)) then |
---|
46 | element Parameters { |
---|
47 | element Category {string($StructuredKeyword/*/moles:dgValidTerm)}, |
---|
48 | if (exists($StructuredKeyword//moles:dgValidSubterm) |
---|
49 | and $StructuredKeyword//moles:dgValidSubterm != '' |
---|
50 | and $StructuredKeyword//moles:dgValidSubterm != ' ') then |
---|
51 | for $Subterm in $StructuredKeyword//moles:dgValidSubterm[exists(moles:dgValidTerm)] |
---|
52 | where exists($Subterm/moles:dgValidSubterm) |
---|
53 | order by $Subterm/moles:ListLevel |
---|
54 | return |
---|
55 | if ($Subterm/moles:ListLevel=1) then element Topic {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} |
---|
56 | else if ($Subterm/moles:ListLevel=2) then element Term {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} |
---|
57 | else if ($Subterm/moles:ListLevel=3) then element Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} |
---|
58 | else if ($Subterm/moles:ListLevel=4) then element Detailed_Variable {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} |
---|
59 | else element GCMD_Science_Valid {string($Subterm/moles:dgValidSubterm/moles:dgValidTerm)} |
---|
60 | else() |
---|
61 | } |
---|
62 | else(), |
---|
63 | for $ISOTopicCategory in ($DE/moles:dgStructuredKeyword[moles:dgValidTermID/moles:ParentListID='http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode']) |
---|
64 | return |
---|
65 | element ISO_Topic_Category {string($ISOTopicCategory/moles:dgValidTerm)}, |
---|
66 | for $Keyword in distinct-values($DE//moles:dgStructuredKeyword[ |
---|
67 | moles:dgValidTermID/moles:ParentListID!='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' |
---|
68 | and |
---|
69 | moles:dgValidTermID/moles:ParentListID!='http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode' |
---|
70 | ]/moles:dgValidTerm) |
---|
71 | return element Keyword {string($Keyword)}, |
---|
72 | for $DepDPT in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID) |
---|
73 | return |
---|
74 | element Sensor_Name { |
---|
75 | for $DepDPTAbbrev in distinct-values((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:abbreviation)) |
---|
76 | return element Short_Name {data($DepDPTAbbrev)}, |
---|
77 | for $DepDPTName in distinct-values((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepDPT/moles:repositoryIdentifier and moles:localIdentifier=$DepDPT/moles:localIdentifier]]/moles:name)) |
---|
78 | return element Long_Name {data($DepDPTName)} |
---|
79 | }, |
---|
80 | for $DepObsStn in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID) |
---|
81 | return |
---|
82 | element Source_Name { |
---|
83 | for $DepObsStnAbbrev in distinct-values((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:abbreviation)) |
---|
84 | return element Short_Name {data($DepObsStnAbbrev)}, |
---|
85 | for $DepObsStnName in distinct-values((collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepObsStn/moles:repositoryIdentifier and moles:localIdentifier=$DepObsStn/moles:localIdentifier]]/moles:name)) |
---|
86 | return element Long_Name {data($DepObsStnName)} |
---|
87 | }, |
---|
88 | for $TemporalRange in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgDateRange) |
---|
89 | return |
---|
90 | element Temporal_Coverage |
---|
91 | { |
---|
92 | element Start_Date {data($TemporalRange/moles:DateRangeStart)}, |
---|
93 | element End_Date {data($TemporalRange/moles:DateRangeEnd)} |
---|
94 | }, |
---|
95 | for $TemporalTerm in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea/moles:dgValidTerm) |
---|
96 | return element Paleo_Temporal_Coverage {element Chronostratigraphic_Unit {data($TemporalTerm)}}, |
---|
97 | for $Data_Set_Progress in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataStatus/moles:dgDatasetClosure) |
---|
98 | return element Data_Set_Progress {data($Data_Set_Progress)}, |
---|
99 | for $BoundingBox in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:BoundingBox) |
---|
100 | return |
---|
101 | element Spatial_Coverage { |
---|
102 | element Southernmost_Latitude {data($BoundingBox/moles:LimitSouth)}, |
---|
103 | element Northernmost_Latitude {data($BoundingBox/moles:LimitNorth)}, |
---|
104 | element Westernmost_Longitude {data($BoundingBox/moles:LimitWest)}, |
---|
105 | element Easternmost_Longitude {data($BoundingBox/moles:LimitEast)} |
---|
106 | }, |
---|
107 | for $Location in ($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDataCoverage//moles:dgArea[moles:dgValidTermID/moles:ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_locations.html']) |
---|
108 | return element Location {$Location}, |
---|
109 | element Data_Resolution {''}, |
---|
110 | for $DepAct in ($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID) |
---|
111 | return |
---|
112 | element Project { |
---|
113 | for $DepActAbbrev in distinct-values(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:abbreviation) |
---|
114 | return |
---|
115 | element Short_Name {data($DepActAbbrev)}, |
---|
116 | for $DepActName in distinct-values(collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgMetadataID[moles:schemeIdentifier='NDG-B0' and moles:repositoryIdentifier=$DepAct/moles:repositoryIdentifier and moles:localIdentifier=$DepAct/moles:localIdentifier]]/moles:name) |
---|
117 | return |
---|
118 | element Long_Name {data($DepActName)} |
---|
119 | }, |
---|
120 | element Quality {''}, |
---|
121 | if (exists($DE/moles:dgDataEntity/moles:dgDataGranule/moles:accessControlPolicy)) then |
---|
122 | for $DG in $DE/moles:dgDataEntity/moles:dgDataGranule |
---|
123 | return |
---|
124 | element Access_Constraints { |
---|
125 | if (exists($DG/moles:dgGranuleSummary/moles:dgGranuleName)) then |
---|
126 | concat('For data granule ', $DG/moles:dgGranuleSummary/moles:dgGranuleName, ': ') |
---|
127 | else (), |
---|
128 | if (exists($DG/moles:accessControlPolicy/moles:accessControlPolicyURL)) then |
---|
129 | concat('See access control policy at ', escape-uri($DG/moles:accessControlPolicy/moles:accessControlPolicyURL, true())) |
---|
130 | else if (exists($DG/moles:accessControlPolicy/moles:accessControlPolicyText)) then |
---|
131 | data($DG/moles:accessControlPolicy/moles:accessControlPolicyText) |
---|
132 | else |
---|
133 | for $securityCondition in $DG/moles:accessControlPolicy/moles:dgSecurityCondition |
---|
134 | return |
---|
135 | if (exists($securityCondition/moles:conditionExplanationText)) then |
---|
136 | concat('Effect: ', data($securityCondition/moles:effect), ' - ', data($securityCondition/moles:conditionExplanationText)) |
---|
137 | else concat('Effect: ', data($securityCondition/moles:effect), 'needs ', data($securityCondition/moles:attauthRole), ' from ', data($securityCondition/moles:dgAttributeAuthority)) |
---|
138 | } |
---|
139 | else (), |
---|
140 | element Use_Constraints {''}, |
---|
141 | element Data_Set_Language {''}, |
---|
142 | if (exists($DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder)) then |
---|
143 | for $DataCreatorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder |
---|
144 | order by $DataCreatorRole/moles:startDate empty least |
---|
145 | return |
---|
146 | for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/(moles:dgOrganisation | moles:dgPerson) |
---|
147 | [(moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' |
---|
148 | and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:repositoryIdentifier |
---|
149 | and moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:localIdentifier)] |
---|
150 | return |
---|
151 | element Originating_Center { |
---|
152 | if (string(local-name($DataCreatorRoleHolder))='dgOrganisation') then |
---|
153 | (string($DataCreatorRoleHolder/moles:name)) |
---|
154 | else if (string(local-name($DataCreatorRoleHolder))='dgPerson') then |
---|
155 | (string(concat(string($DataCreatorRoleHolder/moles:name/moles:initials), ' ', string($DataCreatorRoleHolder/moles:name/moles:familyName)))) |
---|
156 | else ('empty content') |
---|
157 | } |
---|
158 | else (), |
---|
159 | for $DataCuratorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCurator/moles:dgRoleHolder[not(exists(moles:endDate)) or moles:endDate=''] |
---|
160 | return |
---|
161 | for $DataCuratorRoleHolder in collection($targetCollection)/moles:dgMetadata/*[(moles:dgMetadataID/moles:schemeIdentifier='NDG-B0' |
---|
162 | and moles:dgMetadataID/moles:repositoryIdentifier=$DataCuratorRole/*/moles:repositoryIdentifier |
---|
163 | and moles:dgMetadataID/moles:localIdentifier=$DataCuratorRole/*/moles:localIdentifier)] |
---|
164 | return |
---|
165 | element Data_Center { |
---|
166 | element Data_Center_Name { |
---|
167 | element Short_Name { |
---|
168 | if (exists($DataCuratorRoleHolder/moles:name/moles:initials)) then |
---|
169 | string(concat(string($DataCuratorRoleHolder/moles:name/moles:initials), ' ', string($DataCuratorRoleHolder/moles:name/moles:familyName))) |
---|
170 | else |
---|
171 | string($DataCuratorRoleHolder/moles:abbreviation) |
---|
172 | }, |
---|
173 | element Long_Name { |
---|
174 | if (exists($DataCuratorRoleHolder/moles:name/moles:initials)) then |
---|
175 | string(concat(string($DataCuratorRoleHolder/moles:name/moles:initials), ' ', string($DataCuratorRoleHolder/moles:name/moles:familyName))) |
---|
176 | else string($DataCuratorRoleHolder/moles:name) |
---|
177 | } |
---|
178 | }, |
---|
179 | if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:URI)) then |
---|
180 | element Data_Center_URL {data($DataCuratorRoleHolder/moles:contactDetails/moles:URI)} |
---|
181 | else (), |
---|
182 | for $DGID in $DE/moles:dgDataEntity/moles:dgDataGranule/moles:dataModelID |
---|
183 | return |
---|
184 | element Data_Set_ID {concat($DGID/moles:repositoryIdentifier, ':', $DGID/moles:schemeIdentifier, ':', $DGID/moles:localIdentifier)}, |
---|
185 | element Personnel { |
---|
186 | element Role {'Data Center Contact'}, |
---|
187 | if (exists($DataCuratorRoleHolder/name/knownAs)) then |
---|
188 | element First_Name {string($DataCuratorRoleHolder/moles:name/moles:knownAs)} |
---|
189 | else if (exists($DataCuratorRoleHolder/moles:name/moles:initials)) then |
---|
190 | element First_Name {string($DataCuratorRoleHolder/moles:name/moles:initials)} |
---|
191 | else (), |
---|
192 | element Last_Name { |
---|
193 | if (exists($DataCuratorRoleHolder/moles:name/moles:familyName)) then |
---|
194 | string($DataCuratorRoleHolder/moles:name/moles:familyName) |
---|
195 | else string($DataCuratorRoleHolder/moles:name) |
---|
196 | }, |
---|
197 | if (exists($DataCuratorRole/moles:contactDetails/moles:eMail)) then |
---|
198 | element Email {string($DataCuratorRole/moles:contactDetails/moles:eMail)} |
---|
199 | else |
---|
200 | if (exists($DataCuratorRoleHolder/contactDetails/eMail)) then |
---|
201 | (element Email {string($DataCuratorRoleHolder/moles:contactDetails/moles:eMail)}) |
---|
202 | else (), |
---|
203 | if (exists($DataCuratorRole/moles:contactDetails/moles:telephone)) then |
---|
204 | element Phone {string($DataCuratorRole/moles:contactDetails/moles:telephone)} |
---|
205 | else if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:telephone)) then |
---|
206 | element Phone {string($DataCuratorRoleHolder/moles:contactDetails/moles:telephone)} |
---|
207 | else (), |
---|
208 | if (exists($DataCuratorRole/moles:contactDetails/moles:fax)) then |
---|
209 | element Fax {string($DataCuratorRole/moles:contactDetails/moles:fax)} |
---|
210 | else if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:fax)) then |
---|
211 | element Fax {string($DataCuratorRoleHolder/moles:contactDetails/moles:fax)} |
---|
212 | else (), |
---|
213 | if (exists($DataCuratorRole/moles:contactDetails/moles:address)) then |
---|
214 | element Contact_Address { |
---|
215 | for $addressline in $DataCuratorRole/moles:contactDetails/moles:address/moles:addressline |
---|
216 | return element address {data($addressline)}, |
---|
217 | if (exists($DataCuratorRole/moles:contactDetails/moles:address/moles:city)) then |
---|
218 | element City {string($DataCuratorRole/moles:contactDetails/moles:address/moles:city)} |
---|
219 | else (), |
---|
220 | if (exists($DataCuratorRole/moles:contactDetails/moles:address/moles:postcode)) then |
---|
221 | element Postal_Code {string($DataCuratorRole/moles:contactDetails/moles:address/moles:postcode)} |
---|
222 | else (), |
---|
223 | if (exists($DataCuratorRole/moles:contactDetails/moles:address/moles:country)) then |
---|
224 | element Country {string($DataCuratorRole/moles:contactDetails/moles:address/moles:country)} |
---|
225 | else () |
---|
226 | } |
---|
227 | else if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address)) then |
---|
228 | element Contact_Address { |
---|
229 | for $addressline in $DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:addressline |
---|
230 | return element address {data($addressline)}, |
---|
231 | if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)) then |
---|
232 | element City {string($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)} |
---|
233 | else (), |
---|
234 | if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:postcode)) then |
---|
235 | element Postal_Code {string($DataCuratorRole/moles:contactDetails/moles:postcode)} |
---|
236 | else (), |
---|
237 | if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:country)) then |
---|
238 | element Country {string($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:country)} |
---|
239 | else () |
---|
240 | } |
---|
241 | else () |
---|
242 | } |
---|
243 | }, |
---|
244 | element Distribution {''}, |
---|
245 | element Multimedia_Sample {''}, |
---|
246 | element Reference {''}, |
---|
247 | element Summary {string($DE/moles:dgMetadataDescription/moles:abstract/moles:abstractText)}, |
---|
248 | element Related_URL { |
---|
249 | element URL_Content_Type {'NDG_B_SERVICE'}, |
---|
250 | element URL {data($DE/moles:dgMetadataID/moles:repositoryIdentifier)}, |
---|
251 | element Description {'The NDG service for browsing metadata.'} |
---|
252 | }, |
---|
253 | for $DG in $DE/moles:dgDataEntity/moles:dgDataGranule |
---|
254 | return |
---|
255 | if ($DG/moles:dataModelID/moles:schemeIdentifier='NDG-A0') then |
---|
256 | (element Related_URL { |
---|
257 | element URL_Content_Type {'NDG_A_SERVICE'}, |
---|
258 | if (exists($DG/instance/URI)) then |
---|
259 | element URL {escape-uri($DG/instance/URI, true())} |
---|
260 | else if ($DG/moles:dataModelID/moles:repositoryIdentifier='badc.nerc.ac.uk') then |
---|
261 | element URL {escape-uri('http://dmgdev1.esc.rl.ac.uk/cgi-bin/ndgDataAccess?datasetSource=dmgdev1.esc.rl.ac.uk&datasetID=', true())} |
---|
262 | else ($DG/moles:dataModelID/moles:repositoryIdentifier), |
---|
263 | element Description {'The NDG service delivering data via NDG A metadata.'} |
---|
264 | }, |
---|
265 | element Related_URL { |
---|
266 | element URL_Content_Type {'GET DATA > CSML'}, |
---|
267 | if (exists($DG/instance)) then |
---|
268 | element URL {escape-uri($DG/instance/URI, true())} |
---|
269 | else if ($DG/moles:dataModelID/moles:repositoryIdentifier='badc.nerc.ac.uk') then |
---|
270 | element URL {escape-uri('http://dmgdev1.esc.rl.ac.uk/cgi-bin/ndgDataAccess?datasetSource=dmgdev1.esc.rl.ac.uk&datasetID=', true())} |
---|
271 | else (), |
---|
272 | element Description {'The NDG service delivering data via NDG A metadata. Additional tag to be more in line with latest version of GCMD valids'} |
---|
273 | }) |
---|
274 | else if ($DG/moles:dataModelID/moles:schemeIdentifier='CDML-0') then |
---|
275 | (element Related_URL { |
---|
276 | element URL_Content_Type {'NDG_A_SERVICE'}, |
---|
277 | if (exists($DG/instance)) then |
---|
278 | element URL {escape-uri($DG/instance/URI, true())} |
---|
279 | else if ($DG/moles:dataModelID/moles:repositoryIdentifier='badc.nerc.ac.uk') then |
---|
280 | element URL {escape-uri('http://cdat.badc.nerc.ac.uk/cgi-bin/dxui.py?datasetURI_1=/', true())} |
---|
281 | else (), |
---|
282 | element Description {'The NDG service delivering data via Data extractor. Additional tag to be more in line with latest version of GCMD valids'} |
---|
283 | }, |
---|
284 | element Related_URL { |
---|
285 | element URL_Content_Type {'GET DATA > DX'}, |
---|
286 | if (exists($DG/instance)) then |
---|
287 | element URL {escape-uri($DG/instance/URI, true())} |
---|
288 | else if ($DG/moles:dataModelID/moles:repositoryIdentifier='badc.nerc.ac.uk') then |
---|
289 | element URL {escape-uri('http://cdat.badc.nerc.ac.uk/cgi-bin/dxui.py?datasetURI_1=/', true())} |
---|
290 | else (), |
---|
291 | element Description {'The NDG service delivering data via Data extractor. Additional tag to be more in line with latest version of GCMD valids'} |
---|
292 | }) |
---|
293 | else if ($DG/moles:dataModelID/moles:schemeIdentifier='URI') then |
---|
294 | element Related_URL { |
---|
295 | element URL {data($DG/moles:instance/moles:URI)}, |
---|
296 | if (exists($DG/moles:instance/moles:instanceComment)) then |
---|
297 | element Description {data($DG/moles:instance/moles:instanceComment)} |
---|
298 | else |
---|
299 | element Description {'URL to aid in delivering data. Note that this may point directly to the data or, more likely, point to the web site of the curator.'} |
---|
300 | } |
---|
301 | else (), |
---|
302 | for $RelURL_Desc in ($DE/moles:dgMetadataDescription/moles:descriptionSection/moles:descriptionOnlineReference) |
---|
303 | return |
---|
304 | element Related_URL { |
---|
305 | (:element URL {data($RelURL_Desc)}, this bit just loops through everything in the xpath and conmcats it -just as I thought -put in mroe structure! |
---|
306 | element URL {data($DE/moles:dgMetadataDescription/moles:descriptionSection/moles:descriptionOnlineReference/moles:dgSimpleLink/moles:URI)},:) |
---|
307 | |
---|
308 | element URL {data($RelURL_Desc/moles:dgSimpleLink/moles:URI)}, |
---|
309 | |
---|
310 | (: nothing put here? :) |
---|
311 | element Description {concat(data($RelURL_Desc/moles:dgSimpleLink/moles:name), ' - ', data($RelURL_Desc/moles:notes))} |
---|
312 | }, |
---|
313 | element Parent_DIF {''}, |
---|
314 | element IDN_Node {''}, |
---|
315 | element Originating_Metadata_Node {''}, |
---|
316 | element Metadata_Name {'[CEOS IDN DIF]'}, |
---|
317 | element Metadata_Version {'9.4'}, |
---|
318 | if (exists($DE/moles:dgMetadataProvenance/moles:RecordCreation)) then |
---|
319 | element DIF_Creation_Date {data($DE/moles:dgMetadataProvenance/moles:RecordCreation/moles:CreatedDate)} |
---|
320 | else (), |
---|
321 | for $MDUpdt in $DE/moles:dgMetadataProvenance/moles:RecordUpdate |
---|
322 | return |
---|
323 | element DIF_Revision_History {concat(data($MDUpdt/moles:UpdateDate), ' - ', data($MDUpdt/moles:UpdateSummary), ' - ', data($MDUpdt/moles:UpdatedBy))}, |
---|
324 | if (exists($DE/moles:dgMetadataProvenance/moles:RecordReview)) then |
---|
325 | element Future_DIF_Review_Date {data($DE/moles:dgMetadataProvenance/moles:RecordReview/moles:ReviewDate)} |
---|
326 | else () |
---|
327 | } (: </DIF> :) |
---|