Ignore:
Timestamp:
09/05/07 16:23:59 (13 years ago)
Author:
ko23
Message:

Updated DIF queries

File:
1 edited

Legend:

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

    r2450 r2464  
    55declare namespace dc='http://purl.org/dc/elements/1.1/'; 
    66declare namespace oai_dc='http://www.openarchives.org/OAI/2.0/oai_dc/'; 
     7(: 
    78declare variable $targetCollection as xs:string {'TargetCollection'}; 
    89declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    910declare variable $localIdentifier as xs:string {'LocalID'}; 
     11:) 
     12 
     13declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
     14declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
     15declare variable $localIdentifier as xs:string {'dataent_ATSR'}; 
    1016 
    1117for $DE in collection($targetCollection)/dgMetadata/dgMetadataRecord[ 
     
    2026        element dc:type {'Dataset'}, 
    2127        element dc:identifier {concat($DE/dgMetadataID/repositoryIdentifier, $utillib:moles_id_separator, 'DC', $utillib:moles_id_separator, $DE/dgMetadataID/localIdentifier)}, 
     28        for $identifiers in $DE/dgMetadataDescription/descriptionSection/descriptionOnlineReference[ 
     29        voclib:spot-vocab($voclib:ndg_online_reference_classes_vocab, dgReferenceClass/dgValidTermID/ParentListID)  
     30        and  
     31        dgReferenceClass/dgValidTerm='DataPage'] 
     32        return element dc:identifier {data($identifiers/dgSimpleLink/URI)}, 
    2233        element dc:description {string($DE/dgMetadataDescription/abstract/abstractText)}, 
    2334        element dc:date 
     
    2536                if (exists($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate)) then 
    2637                        for $updatedate in ($DE/(dgMetadataProvenance | DataProvenance)/RecordUpdate/UpdateDate) 
    27                                 order by xs:dateTime($updatedate) 
     38                                order by xs:date($updatedate) 
    2839                        return data($updatedate[1]) 
    2940                else 
     
    7990                                else if (string(local-name($DataCuratorRoleHolder))='dgPerson') then 
    8091                                        (string(concat(string($DataCuratorRoleHolder/name/initials), ' ', string($DataCuratorRoleHolder/name/familyName)))) 
    81                                 else ('empty content'), 
    82                                 for $identifiers in $DE/dgMetadataDescription/descriptionSection/descriptionOnlineReference[voclib:spot-vocab($voclib:ndg_online_reference_classes_vocab, dgReferenceClass/dgValidTermID/ParentListID and dgReferenceClass/dgValidTerm='DataPage')] 
    83         return element dc:identifier {$identifiers/dgSimpleLink/URI} 
    84                                  
     92                                else ('empty content') 
    8593} 
    8694}  (: </oai_dc:dc> :) 
Note: See TracChangeset for help on using the changeset viewer.