source: TI07-MOLES/trunk/MDIP/XQueries/NDG-MDIP.xquery @ 1917

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI07-MOLES/trunk/MDIP/XQueries/NDG-MDIP.xquery@1917
Revision 1917, 1.6 KB checked in by ko23, 13 years ago (diff)

Establish MDIP xqueries

Line 
1declare default element namespace 'http://www.dassh.ac.uk';
2declare namespace moles='http://ndg.nerc.ac.uk/moles';
3declare namespace gco='http://www.isotc211.org/2005/gco';
4declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';
5declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions';
6
7declare variable $ISO_639-2_ns as xs:string{'UKGemini_Langauge_Categories'};
8declare variable $ISO_3166_ns as xs:string{'UKGemini_Land_Area_Categories'};
9
10for $DE in collection('/db/ndg_B_metadata')/moles:dgMetadata/moles:dgMetadataRecord[
11        exists('moles:dgDataEntity')
12        and moles:dgMetadataID/moles:schemeIdentifier='NDG-B0'
13        and moles:dgMetadataID/moles:repositoryIdentifier='grid.bodc.nerc.ac.uk'
14        and moles:dgMetadataID/moles:localIdentifier='HGFS3751']
15return
16element Metadata {
17        element Title {data($DE/moles:name)},
18        if (exists($DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDatasetLanguage)) then
19                for $lang in $DE/moles:dgDataEntity/moles:dgDataSummary/moles:dgDatasetLanguage
20                return
21                        element Language{
22                                element LanguageName {data($lang/dgValidTerm)},
23                                element LanguageVocab {data($lang/dgValidTermID/ParentListID)},
24                                element LanguageCode {data($lang/dgValidTermID/TermID)}
25                        }
26                               
27        else (),
28
29        element Abstract {},
30        for $isoTopic in $DE/moles:dgStructuredKeyword[moles:dgValidTermID/moles:ParentListID='']
31        return element TopicCategory {},
32        for $subject in $DE/moles:dgDataEntity/moles:dgParameterSummary/moles:dgStdParameterMeasured[moles:dgValidTermID/moles:ParentListID='']
33        return element Subject {},
34        element Date {
35                element DatasetStartDate {},
36                element DatasetEndDate {}
37        }
38}
Note: See TracBrowser for help on using the repository browser.