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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI07-MOLES/trunk/DIF/XQuery/NDG-DIF.xquery@681
Revision 648, 2.6 KB checked in by ko23, 14 years ago (diff)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='repositoryID' and dgMetadataID/localIdentifier='localID']
2return
3        <DIF>
4        <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DIF:', $DE/dgMetadataID/localIdentifier)}</Entry_ID>
5        <Entry_Title>{string($DE/name)}</Entry_Title>
6        <Parameters>
7        {for $StructuredKeyword in ($DE//(dgStructuredKeyword | dgStdParameterMeasured))
8                where (($DE//(dgStructuredKeyword | dgStdParameterMeasured)/dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html'        or $DE//(dgStructuredKeyword | dgStdParameterMeasured)/dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/projects.html') and ($DE//(dgStructuredKeyword | dgStdParameterMeasured)/ListLevel = 0))
9                return if (exists($StructuredKeyword/*/dgValidTerm)) then (
10                <Parameter>
11                        {string($StructuredKeyword/*/dgValidTerm)}
12                        {if (exists($StructuredKeyword//dgValidSubterm) and $StructuredKeyword//dgValidSubterm != '' and $StructuredKeyword//dgValidSubterm != ' ') then (
13                        for $Subterm in $StructuredKeyword//dgValidSubterm[exists(dgValidTerm)]
14                        where exists($Subterm/dgValidSubterm)
15                                order by $Subterm/ListLevel
16                                return concat(' &gt; ', string($Subterm/dgValidSubterm/dgValidTerm))
17                                )       
18                        else()}
19                </Parameter>
20                )
21                else()
22        }
23        </Parameters>
24        <ISO_Topic_Category>
25        </ISO_Topic_Category>
26        {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate='']
27                return
28                        <Data_Center>
29                                {if (exists($DataCuratorRole/dgPersonID)) then
30                                        for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgPerson[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)]
31                                                return
32                                                string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))
33                                else if (exists($DataCuratorRole/dgOrganisationID)) then
34                                        for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgOrganisation[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)]
35                                                return
36                                                string($DataCuratorRoleHolder/name)
37                                else ()
38                                }
39                        </Data_Center>
40                }
41        <Summary>{string($DE/dgMetadataDescription/abstract/abstractText)}</Summary>
42        <Metadata_Name>[CEOS IDN DIF]</Metadata_Name>
43        <Metadata_Version>9.4</Metadata_Version>
44        </DIF>
Note: See TracBrowser for help on using the repository browser.