Changeset 648 for TI07-MOLES/trunk/DIF


Ignore:
Timestamp:
22/02/06 14:30:40 (14 years ago)
Author:
ko23
Message:
 
File:
1 edited

Legend:

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

    r326 r648  
    1 for $DE in //dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='badc.nerc.ac.uk' and dgMetadataID/localIdentifier='dataent2'] 
     1for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='repositoryID' and dgMetadataID/localIdentifier='localID'] 
    22return 
    33        <DIF> 
    4         <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DC:', $DE/dgMetadataID/localIdentifier)}</Entry_ID> 
     4        <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DIF:', $DE/dgMetadataID/localIdentifier)}</Entry_ID> 
    55        <Entry_Title>{string($DE/name)}</Entry_Title> 
    66        <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        } 
    723        </Parameters> 
    824        <ISO_Topic_Category> 
    925        </ISO_Topic_Category> 
    10         {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[empty(endDate)] 
    11         order by $DataCuratorRole/startDate empty least 
    12         return  
    13                 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)]  
     26        {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate=''] 
    1427                return  
    15                 <Data_Center> 
    16                 {if (string(local-name($DataCuratorRoleHolder))='dgOrganisation') then 
    17                         (string($DataCuratorRoleHolder/name)) 
    18                 else if (string(local-name($DataCuratorRoleHolder))='dgPerson') then 
    19                         (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))) 
    20                 else ('empty content')} 
    21                 </Data_Center>} 
     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                } 
    2241        <Summary>{string($DE/dgMetadataDescription/abstract/abstractText)}</Summary> 
    2342        <Metadata_Name>[CEOS IDN DIF]</Metadata_Name> 
    2443        <Metadata_Version>9.4</Metadata_Version> 
    2544        </DIF> 
    26 (: Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved. 
    27 <metaInformation> 
    28 <scenarios ><scenario default="yes" name="StubB" userelativepaths="yes" externalpreview="no" url="..\..\..\..\..\..\..\My Documents\ndgBXML\ndgB.xml" outputurl="" processortype="saxon" tcpport="2233" profilemode="7" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" host="" port="8000" user="" password=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="..\..\..\Project File Archive\NERC DataGRID\MetadataModelv1a\ndgmetadata.xsd" srcSchemaRoot="dgMetadata" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template name="xquery_body"><block path="flwr" x="220" y="18"/><block path="flwr/dgMetadataRecord/dgDataEntity/dgDataRoles/dgDataCreator/flwr" x="140" y="126"/><block path="flwr/dgMetadataRecord/dgDataEntity/dgDataRoles/dgDataCurator/flwr" x="180" y="162"/><block path="flwr/dgMetadataRecord/dgDataEntity/flwr" x="220" y="180"/><block path="flwr/dgMetadataRecord/dgDataEntity/flwr/RelatedDeployment/flwr" x="260" y="198"/><block path="flwr/dgMetadataRecord/dgDataEntity/flwr/RelatedDeployment/flwr[1]" x="260" y="109"/><block path="flwr/dgMetadataRecord/dgDataEntity/flwr/RelatedDeployment/flwr[2]" x="180" y="109"/><block path="flwr/dgMetadataRecord/dgDataEntity/flwr[1]" x="220" y="109"/></template></MapperBlockPosition></MapperMetaTag> 
    29 </metaInformation> 
    30 :) 
Note: See TracChangeset for help on using the changeset viewer.