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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI07-MOLES/trunk/DublinCore/XQuery/NDG-DublinCore.xquery@648
Revision 648, 2.8 KB checked in by ko23, 13 years ago (diff)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1declare namespace dc="http://purl.org/dc/elements/1.1/";
2declare namespace oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc";
3for $DE in //dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='repositoryID' and dgMetadataID/localIdentifier='localID']
4return
5<oai_dc:dc>
6        <dc:title>{string($DE/name)}</dc:title>
7        <dc:type>Dataset</dc:type>
8        <dc:identifier>{concat($DE/dgMetadataID/repositoryIdentifier, ':DC:', $DE/dgMetadataID/localIdentifier)}</dc:identifier>
9        <dc:description>{string($DE/dgMetadataDescription/abstract/abstractText)}</dc:description>
10        {for $StructuredKeyword in $DE//(dgStructuredKeyword | dgStdParameterMeasured)[dgValidTermID/ParentListID='http://www.cgd.ucar.edu/cms/eaton/cf-metadata/standard_name.html'    or dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' or dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/projects.html']
11                order by $StructuredKeyword/dgValidTerm
12                return
13                <dc:subject>
14                        {string($StructuredKeyword/dgValidTerm)}
15                </dc:subject>
16        }
17        {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder
18        order by $DataCreatorRole/startDate empty least, $DataCreatorRole/endDate empty least
19        return
20                for $DataCreatorRoleHolder in /*/(dgOrganisation | dgPerson)[((not(exists($DataCreatorRole/endDate)) or empty($DataCreatorRole/endDate)) and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)]                 return
21                <dc:creator>
22                {if (string(local-name($DataCreatorRoleHolder))='dgOrganisation') then
23                        (string($DataCreatorRoleHolder/name))
24                else if (string(local-name($DataCreatorRoleHolder))='dgPerson') then
25                        (string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName))))
26                else ('empty content')}
27                </dc:creator>
28        }
29        {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[empty(endDate)]
30        order by $DataCuratorRole/startDate empty least
31        return
32                for $DataCuratorRoleHolder in /*/(dgOrganisation | dgPerson)[((not(exists($DataCuratorRole/endDate)) or empty($DataCuratorRole/endDate)) and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)]
33                return
34                <dc:publisher>
35                {if (string(local-name($DataCuratorRoleHolder))='dgOrganisation') then
36                        (string($DataCuratorRoleHolder/name))
37                else if (string(local-name($DataCuratorRoleHolder))='dgPerson') then
38                        (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))))
39                else ('empty content')}
40                </dc:publisher>
41        }
42</oai_dc:dc>
Note: See TracBrowser for help on using the repository browser.