Changeset 2056 for TI07-MOLES


Ignore:
Timestamp:
25/01/07 16:40:40 (12 years ago)
Author:
ko23
Message:

Second element Address case fixed

Location:
TI07-MOLES/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/DIF/XQuery/DIF2MOLES.xquery

    r2026 r2056  
    77declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    88declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
    9  
     9(: Replacable parameters :) 
    1010declare variable $input_collection as xs:string {'TargetCollection'}; 
    11  
     11declare variable $input_repository as xs:string {'Input_Repository_Code'}; 
     12declare variable $input_repository_local as xs:string {'Input_Repository_LocalID'}; 
     13declare variable $input_entry_id as xs:string {'Input_Entry_ID'}; 
     14declare variable $output_local_id as xs:string {'Output_LocalID'}; 
     15(: Vocab stubs :) 
    1216declare variable $unknown_vocab_id as xs:string {'http://vocab.ndg.nerc.ac.uk/null'}; 
    13  
    1417declare variable $bodc_parameter_discovery_vocab as xs:string {'http://vocab.ndg.nerc.ac.uk/P021'}; 
    15  
    16 declare variable $cf_standard_names as xs:string {'http://www.cgd.ucar.edu/cms/eaton/cf-metadata/standard_name.html'}; 
    17  
    18 (: declare variable $gcmd_science_valids as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html'}; :) 
     18declare variable $cf_standard_names as xs:string {'http://vocab.ndg.nerc.ac.uk/P071'}; 
    1919declare variable $gcmd_science_valids as xs:string {'http://vocab.ndg.nerc.ac.uk/P041'}; 
    2020declare variable $gcmd_project_valids as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/projects.html'}; 
     
    2222declare variable $gcmd_paleotemporal_valids as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/paleotemporal.html'}; 
    2323declare variable $gcmd_iso_topic_list as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/iso_topic_list.html'}; 
    24  
    25 (: declare variable $iso_topic_list as xs:string {'http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_TopicCategoryCode'}; :) 
    2624declare variable $iso_topic_list as xs:string {'http://vocab.ndg.nerc.ac.uk/P051'}; 
    27  
    2825declare variable $ndg_data_provider_vocab as xs:string {'http://vocab.ndg.nerc.ac.uk/N010'}; 
    29  
    30 declare variable $input_repository as xs:string {'Input_Repository_Code'}; 
    31 declare variable $input_repository_local as xs:string {'Input_Repository_LocalID'}; 
    32 declare variable $input_entry_id as xs:string {'Input_Entry_ID'}; 
    33 declare variable $output_local_id as xs:string {'Output_LocalID'}; 
    3426 
    3527declare function f:fix-coord($e as element()) as element()  
     
    5648} ; 
    5749 
     50declare function f:spot-vocab($vocab_root as xs:string, $vocab_uri as xs:string) as xs:boolean  
     51(: See if the vocab pointed if from the vocab pointed at by the vocab_root :) 
     52{ 
     53iif ($vocab_root = substring($vocab_uri, 1, string-length($vocab_root))) then   
     54        true() 
     55else 
     56        false() 
     57} ; 
     58 
    5859for $DIF in collection($input_collection)/dif:DIF[dif:Entry_ID=$input_entry_id] 
    5960return 
  • TI07-MOLES/trunk/DIF/XQuery/NDG-DIF.xquery

    r2008 r2056  
    211211                                    element Contact_Address { 
    212212                                        for $addressline in $DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:addressline 
    213                                             return element address {data($addressline)}, 
     213                                            return element Address {data($addressline)}, 
    214214                                                            if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)) then  
    215215                                            element City {string($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)} 
  • TI07-MOLES/trunk/MDIP/XQueries/MDIP2MOLES.xquery

    r2026 r2056  
    6060                else $e 
    6161        else  $e 
     62} ; 
     63 
     64declare function f:spot-vocab($vocab_root as xs:string, $vocab_uri as xs:string) as xs:boolean  
     65(: See if the vocab pointed if from the vocab pointed at by the vocab_root :) 
     66{ 
     67if ($vocab_root = substring($vocab_uri, 1, string-length($vocab_root))) then   
     68        true() 
     69else 
     70        false() 
    6271} ; 
    6372 
  • TI07-MOLES/trunk/PythonCode/wsgi/ndg_xqueries.py

    r2008 r2056  
    302302element Contact_Address { 
    303303for $addressline in $DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:addressline 
    304 return element address {data($addressline)}, 
     304return element Address {data($addressline)}, 
    305305if (exists($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)) then  
    306306element City {string($DataCuratorRoleHolder/moles:contactDetails/moles:address/moles:city)} 
Note: See TracChangeset for help on using the changeset viewer.