Changeset 995 for TI07-MOLES


Ignore:
Timestamp:
24/05/06 08:52:02 (13 years ago)
Author:
ko23
Message:

Tiiping irror in bulkde fixed...

Location:
TI07-MOLES/trunk/JavaCode
Files:
2 edited

Legend:

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

    r967 r995  
    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"; 
    4545        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> } <Personnel/> <Discipline/>  <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 (<Topic>{string($Subterm/dgValidSubterm/dgValidTerm)}</Topic>)  else ( if ($Subterm/ListLevel=2) then (<Term>{string($Subterm/dgValidSubterm/dgValidTerm)}</Term>)  else ( if ($Subterm/ListLevel=3) then (<Variable>{string($Subterm/dgValidSubterm/dgValidTerm)}</Variable>)  else ( if ($Subterm/ListLevel=4) then (<Detailed_Variable>{string($Subterm/dgValidSubterm/dgValidTerm)}</Detailed_Variable>)  else (<GCMD_Science_Valid>{string($Subterm/dgValidSubterm/dgValidTerm)}</GCMD_Science_Valid>)))) )  else()} </Parameter> ) else() } </Parameters> {for $ISOTopicCategory in ($DE/dgStructuredKeyword[dgValidTermID/ParentListID='ISO 19115 Topic Category']) return  <ISO_Topic_Category>{$ISOTopicCategory/dgValidTerm}</ISO_Topic_Category> }  <ISO_Topic_Category/> <Keyword/> <Sensor_Name/> <Source_Name/> <Temporal_Coverage/> <Paleo_Temporal_Coverage/> <Data_Set_Progress/> <Spatial_Coverage/> <Location/> <Data_Resolution/> <Project/> <Quality/> <Access_Constraints/> <Use_Constraints/> <Data_Set_Language/> <Originating_Center/>  {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> <Metadata_Name>[CEOS IDN DIF]</Metadata_Name> <Metadata_Version>9.4</Metadata_Version> </DIF>"; 
     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>"; 
    4748   
    4849 
     
    136137        if(outputType.compareTo("")== 0) { 
    137138            System.out.println("Missing repository and/or local ID.\n"); 
    138             System.out.println("Correct execution syntax: java -jar returnstubb.jar [parametername parametervalue]"); 
     139            System.out.println("Correct execution syntax: java -jar bulkdestubb.jar [parametername parametervalue]"); 
    139140            System.out.println("Mandatory parameters are:\n"); 
    140141            System.out.println("\tformat - see " + IDIssuesDoc + " for legal values\n"); 
     
    154155                                outputType.equals("test") || 
    155156                                outputType.equals("DC") || 
    156                                 outputType.equals("DIF")) {;} 
     157                                outputType.equals("DIF") ||  
     158                                outputType.equals("oldDIF")) {;} 
    157159                else if (outputType.equals("ISO19115")) { 
    158160                        outputType="ISO19115"; 
     
    166168                if (debug) {System.out.println("outputType = " + outputType);} 
    167169 
    168                 if (args.length == 2) {eXistService = args[1];} 
    169         else {eXistService = DefaulteXistService;} 
    170                 if (debug) { 
    171                         System.out.println("eXist service = " + eXistService); 
    172                 } 
    173                  
    174170                // Set output directory 
    175171                targetDirectory = System.getProperty("user.dir"); 
     
    304300                                                xquery = DIFQuery; 
    305301                                                } 
     302                                        else if (outputType.equals("oldDIF")) { 
     303                                                xquery = DIFQuery123; 
     304                                                } 
    306305                                        else if (outputType.equals("ISO19115")) {;} 
    307306                                         
Note: See TracChangeset for help on using the changeset viewer.