source: TI07-MOLES/trunk/DIF/XQuery/NDG-DIF.xquery @ 2572

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