Ignore:
Timestamp:
04/07/06 08:01:47 (14 years ago)
Author:
ko23
Message:

Update queries + Java code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/JavaCode/bulkdestubbxmldb/ndg/services/bulkdestubb/Main.java

    r995 r1276  
    4343        static String test = "for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier='RepositoryID' and localIdentifier='LocalID']] return <empty/>"; 
    4444        static String RawDEMoles = "for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier='RepositoryID' and localIdentifier='LocalID']] return $DE"; 
    45         static String DublinCoreDEQuery = "xquery version '1.0'; declare default element namespace ''; declare namespace dc='http://purl.org/dc/elements/1.1/'; declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc'; for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <oai_dc:dc> <dc:title>{string($DE/name)}</dc:title> <dc:type>Dataset</dc:type> <dc:identifier>{concat($DE/dgMetadataID/repositoryIdentifier, ':DC:', $DE/dgMetadataID/localIdentifier)}</dc:identifier> <dc:description>{string($DE/dgMetadataDescription/abstract/abstractText)}</dc:description> {for $StructuredKeyword in distinct-values($DE//(dgStructuredKeyword | dgStdParameterMeasured)/dgValidTerm) where ($DE//(dgStructuredKeyword | dgStdParameterMeasured)/dgValidTermID/ParentListID='http://www.cgd.ucar.edu/cms/eaton/cf-metadata/standard_name.html' or $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') return <dc:subject> {string($StructuredKeyword)} </dc:subject> } {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder return <dc:creator> {if (exists($DataCreatorRole/dgPersonID)) then for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgPerson[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)] return string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName))) else if (exists($DataCreatorRole/dgOrganisationID)) then for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgOrganisation[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)] return string($DataCreatorRoleHolder/name) else (string('Not known')) } </dc:creator> } {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate=''] return <dc:publisher> {if (exists($DataCuratorRole/dgPersonID)) then for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgPerson[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)] return string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) else if (exists($DataCuratorRole/dgOrganisationID)) then for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/dgOrganisation[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)] return string($DataCuratorRoleHolder/name) else (string('Not known')) } </dc:publisher> } </oai_dc:dc>"; 
    46         static String DIFQuery = "for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[exists('dgDataEntity') and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <DIF> <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DIF:', $DE/dgMetadataID/localIdentifier)}</Entry_ID> <Entry_Title>{string($DE/name)}</Entry_Title> {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)] return <Dataset_Citation> {element Data_Creator {if (exists($DataCreatorRoleHolder/name/initials)) then ( string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName))) ) else ( string($DataCreatorRoleHolder/abbreviation) )} } <Dataset_Title>{string($DE/name)}</Dataset_Title> </Dataset_Citation> } <Parameters> {for $StructuredKeyword in ($DE//(dgStructuredKeyword | dgStdParameterMeasured)[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and ListLevel = 0]) return if (exists($StructuredKeyword/*/dgValidTerm)) then ( <Parameter> {element Category {string($StructuredKeyword/*/dgValidTerm)}} {if (exists($StructuredKeyword//dgValidSubterm) and $StructuredKeyword//dgValidSubterm != '' and $StructuredKeyword//dgValidSubterm != ' ') then ( for $Subterm in $StructuredKeyword//dgValidSubterm[exists(dgValidTerm)] where exists($Subterm/dgValidSubterm) order by $Subterm/ListLevel return if ($Subterm/ListLevel=1) then (element Topic {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=2) then (element Term {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=3) then (element Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=4) then (element Detailed_Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else (element GCMD_Science_Valid {string($Subterm/dgValidSubterm/dgValidTerm)})))) ) else()} </Parameter> ) else() } </Parameters> {for $ISOTopicCategory in ($DE/dgStructuredKeyword[dgValidTermID/ParentListID='ISO 19115 Topic Category']) return element ISO_Topic_Category {$ISOTopicCategory/dgValidTerm} } {for $Keyword in distinct-values($DE//dgStructuredKeyword[ dgValidTermID/ParentListID!='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and dgValidTermID/ParentListID!='ISO 19115 Topic Category' ]/dgValidTerm) return element Keyword {$Keyword} } {for $DepDPT in ($DE/dgDataEntity/RelatedDeployment/DataProductionToolID) return element Sensor_Name {(for $DepDPTName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepDPT/repositoryIdentifier and localIdentifier=$DepDPT/localIdentifier]]/name)) return data($DepDPTName))} } {for $DepObsStn in ($DE/dgDataEntity/RelatedDeployment/ObservationStationID) return element Source_Name {(for $DepObsStnName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepObsStn/repositoryIdentifier and localIdentifier=$DepObsStn/localIdentifier]]/name)) return data($DepObsStnName))} } {for $TemporalRange in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgDateRange) return <Temporal_Coverage> {element Start_Date {data($TemporalRange/DateRangeStart)}} {element End_Date {data($TemporalRange/DateRangeEnd)}} </Temporal_Coverage> } {for $TemporalTerm in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea/dgValidTerm) return element Paleo_Temporal_Coverage { element Chronostratigraphic_Unit {data($TemporalTerm)} } } {for $Data_Set_Progress in ($DE/dgDataEntity/dgDataSummary/dgDataStatus/dgDatasetClosure) return element Data_Set_Progress {$Data_Set_Progress} } {for $BoundingBox in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/BoundingBox) return <Spatial_Coverage> {element Southernmost_Latitude {data($BoundingBox/LimitSouth)}} {element Northernmost_Latitude {data($BoundingBox/LimitNorth)}} {element Westernmost_Latitude {data($BoundingBox/LimitWest)}} {element Easternmost_Latitude {data($BoundingBox/LimitEast)}} </Spatial_Coverage> } {for $Location in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_locations.html']) return element Location {$Location} } {for $DepAct in ($DE/dgDataEntity/RelatedDeployment/ActivityID) return element Project {(for $DepActName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepAct/repositoryIdentifier and localIdentifier=$DepAct/localIdentifier]]/name)) return data($DepActName))} } {if (exists($DE/dgDataEntity/dgDataGranule/accessControlPolicy)) then ( element Access_Constraints {''} ) else () } {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)] return <Data_Center> <Data_Center_Name> {element Short_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else ( string($DataCuratorRoleHolder/abbreviation) )} } {element Long_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else (string($DataCuratorRoleHolder/name))} } </Data_Center_Name> {if (exists($DataCuratorRoleHolder/contactDetails/URI)) then ( element Data_Center_URL {data($DataCuratorRoleHolder/contactDetails/URI)} ) else ()} {for $DGID in $DE/dgDataEntity/dgDataGranule/dataModelID return element Data_Set_ID {concat($DGID/repositoryIdentifier, ':', $DGID/schemeIdentifier, ':', $DGID/localIdentifier)} } <Personnel> {element Role {'Data Center Contact'}} {if (exists($DataCuratorRoleHolder/name/knownAs)) then ( element First_Name {string($DataCuratorRoleHolder/name/knownAs)} ) else if (exists($DataCuratorRoleHolder/name/initials)) then ( element First_Name {string($DataCuratorRoleHolder/name/initials)} ) else ()} {element Last_Name {if (exists($DataCuratorRoleHolder/name/familyName)) then ( string($DataCuratorRoleHolder/name/familyName) ) else (string($DataCuratorRoleHolder/name))} } {if (exists($DataCuratorRole/contactDetails/eMail)) then ( element Email {string($DataCuratorRole/contactDetails/eMail)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/eMail)) then ( element Email {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} {if (exists($DataCuratorRole/contactDetails/telephone)) then ( element Phone {string($DataCuratorRole/contactDetails/telephone)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/telephone)) then ( element Phone {string($DataCuratorRoleHolder/contactDetails/telephone)} ) else () )} {if (exists($DataCuratorRole/contactDetails/fax)) then ( element Fax {string($DataCuratorRole/contactDetails/fax)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/fax)) then ( element Fax {string($DataCuratorRoleHolder/contactDetails/fax)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/addressline)) then ( for $addressline in $DataCuratorRole/contactDetails/address/addressline return element address {$addressline} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/addressline)) then ( for $addressline in $DataCuratorRoleHolder/contactDetails/address/addressline return element address {$addressline} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/city)) then ( element City {string($DataCuratorRole/contactDetails/city)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/city)) then ( element Cityl {string($DataCuratorRoleHolder/contactDetails/city)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/postcode)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/postcode)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element email {string($DataCuratorRoleHolder/contactDetails/postcode)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/country)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/country)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element Postal_Code {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} </Personnel> </Data_Center> } <Summary>{string($DE/dgMetadataDescription/abstract/abstractText)}</Summary> <Related_URL> {element URL_Content_Type {'NDG_B_SERVICE'}} {element URL {data($DE/dgMetadataID/repositoryIdentifier)}} {element Description {'The NDG service for browsing metadata.'}} </Related_URL> {for $DG in $DE/dgDataEntity/dgDataGranule return if ($DG/dataModelID/schemeIdentifier='NDG-A0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://dmgdev1.esc.rl.ac.uk/cgi-bin/ndgDataAccess?datasetSource=dmgdev1.esc.rl.ac.uk&amp;datasetID=', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='CSML-0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://cdat.badc.nerc.ac.uk/cgi-bin/dxui.py?datasetURI_1=/', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='URI') then ( <Related_URL> {element URL {$DG/instance/URI}} {if (exists($DG/instance/instanceComment)) then ( element Description {$DG/instance/instanceComment} ) else ( element Description {'URL to aid in delivering data. Note that this may point directly to the data or, more likely, point to the web site of the curators.'} ) } </Related_URL> ) else () } <Metadata_Name>[CEOS IDN DIF]</Metadata_Name> {element Metadata_Version {'9.4'}} {if (exists($DE/dgMetadataProvenance/RecordCreation)) then ( element DIF_Creation_Date {$DE/dgMetadataProvenance/RecordCreation/CreatedDate} ) else () } {for $MDUpdt in $DE/dgMetadataProvenance/RecordUpdate return element DIF_Revision_History {concat(data($MDUpdt/UpdateDate), ' - ', data($MDUpdt/UpdateSummary), ' - ', data($MDUpdt/UpdatedBy))} } {if (exists($DE/dgMetadataProvenance/RecordReview)) then ( element Future_DIF_Review_Date {$DE/dgMetadataProvenance/RecordReview/ReviewDate} ) else () } </DIF>"; 
    47         static String DIFQuery123 = "for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[exists('dgDataEntity') and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <DIF> <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DIF:', $DE/dgMetadataID/localIdentifier)}</Entry_ID> <Entry_Title>{string($DE/name)}</Entry_Title> {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)] return <Dataset_Citation> {element Data_Creator {if (exists($DataCreatorRoleHolder/name/initials)) then ( string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName))) ) else ( string($DataCreatorRoleHolder/abbreviation) )} } <Dataset_Title>{string($DE/name)}</Dataset_Title> </Dataset_Citation> } <Parameters> {for $StructuredKeyword in ($DE//(dgStructuredKeyword | dgStdParameterMeasured)[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and ListLevel = 0]) return if (exists($StructuredKeyword/*/dgValidTerm)) then ( <Parameter> {element Category {string($StructuredKeyword/*/dgValidTerm)}} {if (exists($StructuredKeyword//dgValidSubterm) and $StructuredKeyword//dgValidSubterm != '' and $StructuredKeyword//dgValidSubterm != ' ') then ( for $Subterm in $StructuredKeyword//dgValidSubterm[exists(dgValidTerm)] where exists($Subterm/dgValidSubterm) order by $Subterm/ListLevel return if ($Subterm/ListLevel=1) then (element Topic {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=2) then (element Term {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=3) then (element Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=4) then (element Detailed_Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else (element GCMD_Science_Valid {string($Subterm/dgValidSubterm/dgValidTerm)})))) ) else()} </Parameter> ) else() } </Parameters> {for $ISOTopicCategory in ($DE/dgStructuredKeyword[dgValidTermID/ParentListID='ISO 19115 Topic Category']) return element ISO_Topic_Category {$ISOTopicCategory/dgValidTerm} } {for $Keyword in distinct-values($DE//dgStructuredKeyword[ dgValidTermID/ParentListID!='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and dgValidTermID/ParentListID!='ISO 19115 Topic Category' ]/dgValidTerm) return element Keyword {$Keyword} } {for $DepDPT in ($DE/dgDataEntity/RelatedDeployment/DataProductionToolID) return element Sensor_Name {(for $DepDPTName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepDPT/repositoryIdentifier and localIdentifier=$DepDPT/localIdentifier]]/name)) return data($DepDPTName))} } {for $DepObsStn in ($DE/dgDataEntity/RelatedDeployment/ObservationStationID) return element Source_Name {(for $DepObsStnName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepObsStn/repositoryIdentifier and localIdentifier=$DepObsStn/localIdentifier]]/name)) return data($DepObsStnName))} } {for $TemporalRange in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgDateRange) return <Temporal_Coverage> {element Start_Date {data($TemporalRange/DateRangeStart)}} {element End_Date {data($TemporalRange/DateRangeEnd)}} </Temporal_Coverage> } {for $TemporalTerm in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea/dgValidTerm) return element Paleo_Temporal_Coverage { element Chronostratigraphic_Unit {data($TemporalTerm)} } } {for $Data_Set_Progress in ($DE/dgDataEntity/dgDataSummary/dgDataStatus/dgDatasetClosure) return element Data_Set_Progress {$Data_Set_Progress} } {for $BoundingBox in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/BoundingBox) return <Spatial_Coverage> {element Southernmost_Latitude {data($BoundingBox/LimitSouth)}} {element Northernmost_Latitude {data($BoundingBox/LimitNorth)}} {element Westernmost_Latitude {data($BoundingBox/LimitWest)}} {element Easternmost_Latitude {data($BoundingBox/LimitEast)}} </Spatial_Coverage> } {for $Location in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_locations.html']) return element Location {$Location} } {for $DepAct in ($DE/dgDataEntity/RelatedDeployment/ActivityID) return element Project {(for $DepActName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepAct/repositoryIdentifier and localIdentifier=$DepAct/localIdentifier]]/name)) return data($DepActName))} } {if (exists($DE/dgDataEntity/dgDataGranule/accessControlPolicy)) then ( element Access_Constraints {''} ) else () } {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)] return <Data_Center> <Data_Center_Name> {element Short_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else ( string($DataCuratorRoleHolder/abbreviation) )} } {element Long_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else (string($DataCuratorRoleHolder/name))} } </Data_Center_Name> {if (exists($DataCuratorRoleHolder/contactDetails/URI)) then ( element Data_Center_URL {data($DataCuratorRoleHolder/contactDetails/URI)} ) else ()} {for $DGID in $DE/dgDataEntity/dgDataGranule/dataModelID return element Data_Set_ID {concat($DGID/repositoryIdentifier, ':', $DGID/schemeIdentifier, ':', $DGID/localIdentifier)} } <Personnel> {element Role {'Data Center Contact'}} {if (exists($DataCuratorRoleHolder/name/knownAs)) then ( element First_Name {string($DataCuratorRoleHolder/name/knownAs)} ) else if (exists($DataCuratorRoleHolder/name/initials)) then ( element First_Name {string($DataCuratorRoleHolder/name/initials)} ) else ()} {element Last_Name {if (exists($DataCuratorRoleHolder/name/familyName)) then ( string($DataCuratorRoleHolder/name/familyName) ) else (string($DataCuratorRoleHolder/name))} } {if (exists($DataCuratorRole/contactDetails/eMail)) then ( element Email {string($DataCuratorRole/contactDetails/eMail)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/eMail)) then ( element Email {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} {if (exists($DataCuratorRole/contactDetails/telephone)) then ( element Phone {string($DataCuratorRole/contactDetails/telephone)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/telephone)) then ( element Phone {string($DataCuratorRoleHolder/contactDetails/telephone)} ) else () )} {if (exists($DataCuratorRole/contactDetails/fax)) then ( element Fax {string($DataCuratorRole/contactDetails/fax)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/fax)) then ( element Fax {string($DataCuratorRoleHolder/contactDetails/fax)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/addressline)) then ( for $addressline in $DataCuratorRole/contactDetails/address/addressline return element address {$addressline} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/addressline)) then ( for $addressline in $DataCuratorRoleHolder/contactDetails/address/addressline return element address {$addressline} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/city)) then ( element City {string($DataCuratorRole/contactDetails/city)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/city)) then ( element Cityl {string($DataCuratorRoleHolder/contactDetails/city)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/postcode)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/postcode)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element email {string($DataCuratorRoleHolder/contactDetails/postcode)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/country)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/country)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element Postal_Code {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} </Personnel> </Data_Center> } <Summary>{string($DE/dgMetadataDescription/abstract/abstractText)}</Summary> <Related_URL> {element URL_Content_Type {'NDG_B_SERVICE'}} {element URL {data($DE/dgMetadataID/repositoryIdentifier)}} {element Description {'The NDG service for browsing metadata.'}} </Related_URL> {for $DG in $DE/dgDataEntity/dgDataGranule return if ($DG/dataModelID/schemeIdentifier='NDG-A0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://dmgdev1.esc.rl.ac.uk/cgi-bin/ndgDataAccess?datasetSource=dmgdev1.esc.rl.ac.uk&amp;datasetID=', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='CSML-0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://cdat.badc.nerc.ac.uk/cgi-bin/dxui.py?datasetURI_1=/', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='URI') then ( <Related_URL> {element URL {$DG/instance/URI}} {if (exists($DG/instance/instanceComment)) then ( element Description {$DG/instance/instanceComment} ) else ( element Description {'URL to aid in delivering data. Note that this may point directly to the data or, more likely, point to the web site of the curators.'} ) } </Related_URL> ) else () } <Metadata_Name>[CEOS IDN DIF]</Metadata_Name> {element Metadata_Version {'9.4'}} {if (exists($DE/DataProvenance/RecordCreation)) then ( element DIF_Creation_Date {$DE/DataProvenance/RecordCreation/CreatedDate} ) else () } {for $MDUpdt in $DE/DataProvenance/RecordUpdate return element DIF_Revision_History {concat(data($MDUpdt/UpdateDate), ' - ', data($MDUpdt/UpdateSummary), ' - ', data($MDUpdt/UpdatedBy))} } {if (exists($DE/DataProvenance/RecordReview)) then ( element Future_DIF_Review_Date {$DE/DataProvenance/RecordReview/ReviewDate} ) else () } </DIF>"; 
    48    
     45        static String DublinCoreDEQuery = "declare namespace dc='http://purl.org/dc/elements/1.1/'; declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc'; for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <oai_dc:dc xmlns:oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc/' xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd'> <dc:title>{string($DE/name)}</dc:title> <dc:type>Dataset</dc:type> <dc:identifier>{concat($DE/dgMetadataID/repositoryIdentifier, ':DC:', $DE/dgMetadataID/localIdentifier)}</dc:identifier> <dc:description>{string($DE/dgMetadataDescription/abstract/abstractText)}</dc:description> {for $StructuredKeyword in distinct-values($DE/dgStructuredKeyword [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']//dgValidTerm) order by $StructuredKeyword return <dc:subject> {string($StructuredKeyword)} </dc:subject> } {for $StructuredKeyword1 in distinct-values($DE/dgDataEntity/dgDataSummary/dgParameterSummary/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']//dgValidTerm) order by $StructuredKeyword1 return <dc:subject> {string($StructuredKeyword1)} </dc:subject> } {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder order by $DataCreatorRole/startDate empty least, $DataCreatorRole/endDate empty least return for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/(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 <dc:creator> {if (string(local-name($DataCreatorRoleHolder))='dgOrganisation') then (string($DataCreatorRoleHolder/name)) else if (string(local-name($DataCreatorRoleHolder))='dgPerson') then (string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName)))) else ('empty content')} </dc:creator> } {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[empty(endDate)] order by $DataCuratorRole/startDate empty least return for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/(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)] return <dc:publisher> {if (string(local-name($DataCuratorRoleHolder))='dgOrganisation') then (string($DataCuratorRoleHolder/name)) else if (string(local-name($DataCuratorRoleHolder))='dgPerson') then (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))) else ('empty content')} </dc:publisher> } </oai_dc:dc>"; 
     46        static String DIFQuery = "for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[exists('dgDataEntity') and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='RepositoryID' and dgMetadataID/localIdentifier='LocalID'] return <DIF xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/' xsi:schemaLocation='http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/ http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/dif_v9.4.xsd'> <Entry_ID>{concat($DE/dgMetadataID/repositoryIdentifier, ':DIF:', $DE/dgMetadataID/localIdentifier)}</Entry_ID> <Entry_Title>{string($DE/name)}</Entry_Title> {for $DataCreatorRole in $DE/dgDataEntity/dgDataRoles/dgDataCreator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCreatorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCreatorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCreatorRole/*/localIdentifier)] return <Dataset_Citation> {element Data_Creator {if (exists($DataCreatorRoleHolder/name/initials)) then ( string(concat(string($DataCreatorRoleHolder/name/initials), ' ', string($DataCreatorRoleHolder/name/familyName))) ) else ( string($DataCreatorRoleHolder/abbreviation) )} } <Dataset_Title>{string($DE/name)}</Dataset_Title> </Dataset_Citation> } {for $StructuredKeyword in ($DE//(dgStructuredKeyword | dgStdParameterMeasured)[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and ListLevel = 0]) return if (exists($StructuredKeyword/*/dgValidTerm)) then ( <Parameters> {element Category {string($StructuredKeyword/*/dgValidTerm)}} {if (exists($StructuredKeyword//dgValidSubterm) and $StructuredKeyword//dgValidSubterm != '' and $StructuredKeyword//dgValidSubterm != ' ') then ( for $Subterm in $StructuredKeyword//dgValidSubterm[exists(dgValidTerm)] where exists($Subterm/dgValidSubterm) order by $Subterm/ListLevel return if ($Subterm/ListLevel=1) then (element Topic {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=2) then (element Term {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=3) then (element Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else ( if ($Subterm/ListLevel=4) then (element Detailed_Variable {string($Subterm/dgValidSubterm/dgValidTerm)}) else (element GCMD_Science_Valid {string($Subterm/dgValidSubterm/dgValidTerm)})))) ) else()} </Parameters> ) else() } {for $ISOTopicCategory in ($DE/dgStructuredKeyword[dgValidTermID/ParentListID='ISO 19115 Topic Category']) return element ISO_Topic_Category {string($ISOTopicCategory/dgValidTerm)} } {for $Keyword in distinct-values($DE//dgStructuredKeyword[ dgValidTermID/ParentListID!='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html' and dgValidTermID/ParentListID!='ISO 19115 Topic Category' ]/dgValidTerm) return element Keyword {string($Keyword)} } {for $DepDPT in ($DE/dgDataEntity/RelatedDeployment/DataProductionToolID) return <Sensor_Name> {for $DepDPTAbbrev in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepDPT/repositoryIdentifier and localIdentifier=$DepDPT/localIdentifier]]/abbreviation)) return element Short_Name {data($DepDPTAbbrev)}} {for $DepDPTName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepDPT/repositoryIdentifier and localIdentifier=$DepDPT/localIdentifier]]/name)) return element Long_Name {data($DepDPTName)} } </Sensor_Name> } {for $DepObsStn in ($DE/dgDataEntity/RelatedDeployment/ObservationStationID) return <Source_Name> {for $DepObsStnAbbrev in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepObsStn/repositoryIdentifier and localIdentifier=$DepObsStn/localIdentifier]]/abbreviation)) return <Short_Name>{data($DepObsStnAbbrev)}</Short_Name>} {for $DepObsStnName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepObsStn/repositoryIdentifier and localIdentifier=$DepObsStn/localIdentifier]]/name)) return <Long_Name>{data($DepObsStnName)}</Long_Name>} </Source_Name> } {for $TemporalRange in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgDateRange) return <Temporal_Coverage> {element Start_Date {data($TemporalRange/DateRangeStart)}} {element End_Date {data($TemporalRange/DateRangeEnd)}} </Temporal_Coverage> } {for $TemporalTerm in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgTemporalCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea/dgValidTerm) return element Paleo_Temporal_Coverage { element Chronostratigraphic_Unit {data($TemporalTerm)} } } {for $Data_Set_Progress in ($DE/dgDataEntity/dgDataSummary/dgDataStatus/dgDatasetClosure) return element Data_Set_Progress {$Data_Set_Progress} } {for $BoundingBox in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/BoundingBox) return <Spatial_Coverage> {element Southernmost_Latitude {data($BoundingBox/LimitSouth)}} {element Northernmost_Latitude {data($BoundingBox/LimitNorth)}} {element Westernmost_Longitude {data($BoundingBox/LimitWest)}} {element Easternmost_Longitude {data($BoundingBox/LimitEast)}} </Spatial_Coverage> } {for $Location in ($DE/dgDataEntity/dgDataSummary/dgDataCoverage/(dgSpatialCoverage | dgSpatioTemporalcoverage/dgSpatioTemporalRange/dgSpatialCoverage)/dgArea[dgValidTermID/ParentListID='http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_locations.html']) return element Location {$Location} } {for $DepAct in ($DE/dgDataEntity/RelatedDeployment/ActivityID) return <Project> {for $DepActAbbrev in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepAct/repositoryIdentifier and localIdentifier=$DepAct/localIdentifier]]/abbreviation)) return <Short_Name>{data($DepActAbbrev)}</Short_Name>} {for $DepActName in distinct-values((collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgMetadataID[schemeIdentifier='NDG-B0' and repositoryIdentifier=$DepAct/repositoryIdentifier and localIdentifier=$DepAct/localIdentifier]]/name)) return <Long_Name>{data($DepActName)}</Long_Name>} </Project> } {if (exists($DE/dgDataEntity/dgDataGranule/accessControlPolicy)) then ( element Access_Constraints {''} ) else () } {for $DataCuratorRole in $DE/dgDataEntity/dgDataRoles/dgDataCurator/dgRoleHolder[not(exists(endDate)) or endDate=''] return for $DataCuratorRoleHolder in collection('/db/ndg_B_metadata')/dgMetadata/*[(dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier=$DataCuratorRole/*/repositoryIdentifier and dgMetadataID/localIdentifier=$DataCuratorRole/*/localIdentifier)] return <Data_Center> <Data_Center_Name> {element Short_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else ( string($DataCuratorRoleHolder/abbreviation) )} } {element Long_Name {if (exists($DataCuratorRoleHolder/name/initials)) then ( string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName))) ) else (string($DataCuratorRoleHolder/name))} } </Data_Center_Name> {if (exists($DataCuratorRoleHolder/contactDetails/URI)) then ( element Data_Center_URL {data($DataCuratorRoleHolder/contactDetails/URI)} ) else ()} {for $DGID in $DE/dgDataEntity/dgDataGranule/dataModelID return element Data_Set_ID {concat($DGID/repositoryIdentifier, ':', $DGID/schemeIdentifier, ':', $DGID/localIdentifier)} } <Personnel> {element Role {'Data Center Contact'}} {if (exists($DataCuratorRoleHolder/name/knownAs)) then ( element First_Name {string($DataCuratorRoleHolder/name/knownAs)} ) else if (exists($DataCuratorRoleHolder/name/initials)) then ( element First_Name {string($DataCuratorRoleHolder/name/initials)} ) else ()} {element Last_Name {if (exists($DataCuratorRoleHolder/name/familyName)) then ( string($DataCuratorRoleHolder/name/familyName) ) else (string($DataCuratorRoleHolder/name))} } {if (exists($DataCuratorRole/contactDetails/eMail)) then ( element Email {string($DataCuratorRole/contactDetails/eMail)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/eMail)) then ( element Email {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} {if (exists($DataCuratorRole/contactDetails/telephone)) then ( element Phone {string($DataCuratorRole/contactDetails/telephone)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/telephone)) then ( element Phone {string($DataCuratorRoleHolder/contactDetails/telephone)} ) else () )} {if (exists($DataCuratorRole/contactDetails/fax)) then ( element Fax {string($DataCuratorRole/contactDetails/fax)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/fax)) then ( element Fax {string($DataCuratorRoleHolder/contactDetails/fax)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/addressline)) then ( for $addressline in $DataCuratorRole/contactDetails/address/addressline return element address {$addressline} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/addressline)) then ( for $addressline in $DataCuratorRoleHolder/contactDetails/address/addressline return element address {$addressline} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/city)) then ( element City {string($DataCuratorRole/contactDetails/city)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/city)) then ( element Cityl {string($DataCuratorRoleHolder/contactDetails/city)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/postcode)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/postcode)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element email {string($DataCuratorRoleHolder/contactDetails/postcode)} ) else () )} {if (exists($DataCuratorRole/contactDetails/address/country)) then ( element Postal_Code {string($DataCuratorRole/contactDetails/country)} ) else ( if (exists($DataCuratorRoleHolder/contactDetails/postcode)) then ( element Postal_Code {string($DataCuratorRoleHolder/contactDetails/eMail)} ) else () )} </Personnel> </Data_Center> } <Summary>{string($DE/dgMetadataDescription/abstract/abstractText)}</Summary> <Related_URL> {element URL_Content_Type {'NDG_B_SERVICE'}} {element URL {data($DE/dgMetadataID/repositoryIdentifier)}} {element Description {'The NDG service for browsing metadata.'}} </Related_URL> {for $DG in $DE/dgDataEntity/dgDataGranule return if ($DG/dataModelID/schemeIdentifier='NDG-A0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://dmgdev1.esc.rl.ac.uk/cgi-bin/ndgDataAccess?datasetSource=dmgdev1.esc.rl.ac.uk&amp;datasetID=', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='CSML-0') then ( <Related_URL> {element URL_Content_Type {'NDG_A_SERVICE'}} {element URL {escape-uri('http://cdat.badc.nerc.ac.uk/cgi-bin/dxui.py?datasetURI_1=/', true())}} {element Description {'The NDG service delivering data via NDG A metadata.'}} </Related_URL> ) else if ($DG/dataModelID/schemeIdentifier='URI') then ( <Related_URL> {element URL {data($DG/instance/URI)}} {if (exists($DG/instance/instanceComment)) then ( element Description {data($DG/instance/instanceComment)} ) else ( element Description {'URL to aid in delivering data. Note that this may point directly to the data or, more likely, point to the web site of the curators.'} ) } </Related_URL> ) else () } <Metadata_Name>[CEOS IDN DIF]</Metadata_Name> {element Metadata_Version {'9.4'}} {if (exists($DE/dgMetadataProvenance/RecordCreation)) then ( element DIF_Creation_Date {data($DE/dgMetadataProvenance/RecordCreation/CreatedDate)} ) else () } {for $MDUpdt in $DE/dgMetadataProvenance/RecordUpdate return element DIF_Revision_History {concat(data($MDUpdt/UpdateDate), ' - ', data($MDUpdt/UpdateSummary), ' - ', data($MDUpdt/UpdatedBy))} } {if (exists($DE/dgMetadataProvenance/RecordReview)) then ( element Future_DIF_Review_Date {data($DE/dgMetadataProvenance/RecordReview/ReviewDate)} ) else () } </DIF>"; 
    4947 
    5048        private static String getNamedParam(String paramName, String[] args) { 
     
    113111                 */ 
    114112        outputType = getNamedParam("format", args); 
    115         if (outputType == "") { 
    116                 user = DefaultUserID; 
    117             } 
     113 
    118114        eXistService = getNamedParam("repository", args); 
    119115        if (eXistService == "") { 
     
    300296                                                xquery = DIFQuery; 
    301297                                                } 
    302                                         else if (outputType.equals("oldDIF")) { 
    303                                                 xquery = DIFQuery123; 
    304                                                 } 
    305298                                        else if (outputType.equals("ISO19115")) {;} 
    306299                                         
Note: See TracChangeset for help on using the changeset viewer.