Changeset 2171 for TI07-MOLES/trunk/MDIP


Ignore:
Timestamp:
15/02/07 11:54:01 (13 years ago)
Author:
ko23
Message:

Refactoring intermediate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/MDIP/XQueries/NDG-MDIP.xquery

    r1917 r2171  
     1import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    12declare default element namespace 'http://www.dassh.ac.uk'; 
    23declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    34declare namespace gco='http://www.isotc211.org/2005/gco'; 
    45declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    5 declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
     6declare variable $targetCollection as xs:string {'TargetCollection'}; 
     7declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     8declare variable $localIdentifier as xs:string {'LocalID'}; 
    69 
    7 declare variable $ISO_639-2_ns as xs:string{'UKGemini_Langauge_Categories'}; 
    8 declare variable $ISO_3166_ns as xs:string{'UKGemini_Land_Area_Categories'}; 
     10declare variable $ISO_639-2_ns as xs:string{$voclib:ISO_639-2_ns}; 
     11declare variable $ISO_3166_ns as xs:string{$voclib:ISO_3166_ns}; 
    912 
    10 for $DE in collection('/db/ndg_B_metadata')/moles:dgMetadata/moles:dgMetadataRecord[ 
     13for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
    1114        exists('moles:dgDataEntity')  
    1215        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'] 
     16        and moles:dgMetadataID/moles:repositoryIdentifier=$repositoryIdentifier 
     17        and moles:dgMetadataID/moles:localIdentifier=$localIdentifier] 
    1518return 
    1619element Metadata { 
     
    3033        for $isoTopic in $DE/moles:dgStructuredKeyword[moles:dgValidTermID/moles:ParentListID='']  
    3134        return element TopicCategory {}, 
    32         for $subject in $DE/moles:dgDataEntity/moles:dgParameterSummary/moles:dgStdParameterMeasured[moles:dgValidTermID/moles:ParentListID=''] 
    33         return element Subject {}, 
     35        for $subject in distinct-values($DE/dgDataEntity/dgDataSummary/dgParameterSummary/dgStdParameterMeasured[ 
     36        voclib:spot-vocab($voclib:gcmd_science_valids, dgValidTermID/ParentListID)  
     37        or voclib:spot-vocab($voclib:gcmd_project_valids, dgValidTermID/ParentListID) 
     38        or voclib:spot-vocab($voclib:bodc_parameter_usage_vocab, dgValidTermID/ParentListID) 
     39        or voclib:spot-vocab($voclib:bodc_parameter_discovery_vocab, dgValidTermID/ParentListID) 
     40        ]/dgValidTerm)  
     41        return element Subject {$subject}, 
    3442        element Date { 
    3543                element DatasetStartDate {}, 
Note: See TracChangeset for help on using the changeset viewer.