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

Update queries + Java code

File:
1 edited

Legend:

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

    r648 r1276  
    1 declare namespace dc="http://purl.org/dc/elements/1.1/"; 
    2 declare namespace oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc"; 
    3 for $DE in //dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='repositoryID' and dgMetadataID/localIdentifier='localID'] 
     1declare namespace dc='http://purl.org/dc/elements/1.1/'; 
     2declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc'; 
     3declare variable $gcmd_science_valids as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/gcmd_parameters.html'}; 
     4declare variable $gcmd_project_valids as xs:string {'http://gcmd.gsfc.nasa.gov/Resources/valids/projects.html'}; 
     5declare variable $cf_standard_names as xs:string {'http://www.cgd.ucar.edu/cms/eaton/cf-metadata/standard_name.html'}; 
     6 
     7for $DE in collection('/db/ndg_B_metadata')/dgMetadata/dgMetadataRecord[dgDataEntity!='' and dgMetadataID/schemeIdentifier='NDG-B0' and dgMetadataID/repositoryIdentifier='badc.nerc.ac.uk' and dgMetadataID/localIdentifier='dataent3'] 
    48return  
    5 <oai_dc:dc> 
     9<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'> 
    610        <dc:title>{string($DE/name)}</dc:title> 
    711        <dc:type>Dataset</dc:type> 
    812        <dc:identifier>{concat($DE/dgMetadataID/repositoryIdentifier, ':DC:', $DE/dgMetadataID/localIdentifier)}</dc:identifier> 
    913        <dc:description>{string($DE/dgMetadataDescription/abstract/abstractText)}</dc:description> 
    10         {for $StructuredKeyword in $DE//(dgStructuredKeyword | 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']  
    11                 order by $StructuredKeyword/dgValidTerm 
     14        {for $StructuredKeyword in distinct-values($DE/dgStructuredKeyword [dgValidTermID/ParentListID=$cf_standard_names or dgValidTermID/ParentListID=$gcmd_science_valids or dgValidTermID/ParentListID=$gcmd_project_valids]//dgValidTerm)  
     15                order by $StructuredKeyword 
    1216                return  
    1317                <dc:subject> 
    14                         {string($StructuredKeyword/dgValidTerm)} 
     18                        {string($StructuredKeyword)} 
     19                </dc:subject> 
     20        } 
     21        {for $StructuredKeyword1 in distinct-values($DE/dgDataEntity/dgDataSummary/dgParameterSummary/dgStdParameterMeasured[dgValidTermID/ParentListID=$cf_standard_names or dgValidTermID/ParentListID=$gcmd_science_valids or dgValidTermID/ParentListID=$gcmd_project_valids]//dgValidTerm)  
     22                order by $StructuredKeyword1 
     23                return  
     24                <dc:subject> 
     25                        {string($StructuredKeyword1)} 
    1526                </dc:subject> 
    1627        } 
     
    1829        order by $DataCreatorRole/startDate empty least, $DataCreatorRole/endDate empty least 
    1930        return  
    20                 for $DataCreatorRoleHolder in /*/(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  
     31                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  
    2132                <dc:creator> 
    2233                {if (string(local-name($DataCreatorRoleHolder))='dgOrganisation') then 
     
    3041        order by $DataCuratorRole/startDate empty least 
    3142        return  
    32                 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)]  
     43                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)]  
    3344                return  
    3445                <dc:publisher> 
Note: See TracChangeset for help on using the changeset viewer.