Changeset 2575


Ignore:
Timestamp:
11/06/07 16:24:18 (12 years ago)
Author:
ko23
Message:

XQuery betas

Location:
TI07-MOLES/trunk
Files:
6 edited

Legend:

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

    r2572 r2575  
    2525            for $DataCreatorRole in $DE/moles:dgDataEntity/moles:dgDataRoles/moles:dgDataCreator/moles:dgRoleHolder[not(exists(moles:endDate)) or moles:endDate=''][1] 
    2626                return  
    27                     for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/*[( 
    28                                moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/*/moles:repositoryIdentifier 
    29                                and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/*/moles:localIdentifier)] 
     27                    for $DataCreatorRoleHolder in collection($targetCollection)/moles:dgMetadata/(dgOrganisation | dgPerson)[( 
     28                               moles:dgMetadataID/moles:localIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:repositoryIdentifier 
     29                               and moles:dgMetadataID/moles:repositoryIdentifier=$DataCreatorRole/(moles:dgOrganisationID | moles:dgPersonID)/moles:localIdentifier)] 
    3030                        return  
    3131                            element Dataset_Creator { 
  • TI07-MOLES/trunk/DublinCore/XQuery/NDG-DublinCore.xquery

    r2482 r2575  
    1717for $DE in collection($targetCollection)/dgMetadata/dgMetadataRecord[ 
    1818exists('dgDataEntity')  
    19 and dgMetadataID/schemeIdentifier='NDG-B0'  
    2019and dgMetadataID/repositoryIdentifier=$repositoryIdentifier 
    2120and dgMetadataID/localIdentifier=$localIdentifier] 
     
    2625        element dc:type {'Dataset'}, 
    2726        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'] 
     27        for $identifiers in $DE/(dgMetadataDescription/descriptionSection/descriptionOnlineReference | abstract/abstractOnlineReference)[ 
     28                exists(dgReferenceClass/dgValidTermID/ParentListID) 
     29                and 
     30                voclib:spot-vocab($voclib:ndg_online_reference_classes_vocab, dgReferenceClass/dgValidTermID/ParentListID)  
     31                and 
     32                dgReferenceClass/dgValidTerm='DataPage'] 
    3233        return element dc:identifier {data($identifiers/dgSimpleLink/URI)}, 
    3334        element dc:description {string($DE/dgMetadataDescription/abstract/abstractText)}, 
  • TI07-MOLES/trunk/StubB/XQuery/NDG-ActStubB.xquery

    r2482 r2575  
    3131($SRAct/moles:name), 
    3232($SRAct/moles:abbreviation), 
    33 ($SRAct/moles:logos), 
    34 element dgActivity { 
    35 if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCollection)) then  
    36 ($SRAct/*/moles:dgActivityDataCollection) 
    37 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataProject)) then  
    38 ($SRAct/*/moles:dgActivityDataProject) 
    39 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCampaign)) then 
    40 ($SRAct/moles:dgActivity/moles:dgActivityDataCampaign) 
    41 else  
    42 ($SRAct/moles:dgActivity/moles:dgActivityDataInvestigation),  
    43 ($SRAct/moles:dgActivity/moles:dgActivityCoverage), 
    44 ($SRAct/moles:dgActivity/moles:dgActivityDuration) 
    45 } (: </dgActivity> :)  
     33($SRAct/moles:logos) 
    4634} (: </activity> :)  
    4735} ; 
     
    5745($SRDE/moles:dgMetadataDescription), 
    5846($SRDE/moles:name), 
    59 ($SRDE/moles:abbreviation), 
    60 element dgDataEntity { 
    61 ($SRDE/moles:dgDataEntity/moles:dgDataSetType), 
    62 ($SRDE/moles:dgDataEntity/moles:dgDataGranule), 
    63 ($SRDE/moles:dgDataEntity/moles:dgDataSummary) 
     47($SRDE/moles:abbreviation) 
    6448} (: </dgDataEntity> :)         
    65 } 
    6649} ; 
    6750 
     
    8164$SRDPT/moles:name, 
    8265$SRDPT/moles:abbreviation, 
    83 $SRDPT/moles:logos, 
    84 element dgDataProductionTool { 
    85 $SRDPT/moles:dgDataProductionTool/moles:contactDetails, 
    86 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgModel)) then 
    87 $SRDPT/moles:dgDataProductionTool/moles:dgModel 
    88 else (), 
    89 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgInstrument)) then 
    90 $SRDPT/moles:dgDataProductionTool/moles:dgInstrument 
    91 else () 
    92 } (: </dgDataProductionTool> :) 
     66$SRDPT/moles:logos 
    9367} (: </dataproductiontool> :) 
    9468} ; 
     
    10983($SRObsStn/moles:name), 
    11084($SRObsStn/moles:abbreviation), 
    111 ($SRObsStn/moles:logos), 
    112 element dgObservationStation { 
    113 ($SRObsStn/moles:dgObservationStation/moles:contactDetails), 
    114 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform)) then 
    115 element dgStationaryPlatform { 
    116 $SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:position, 
    117 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgLandStation)) then element dgLandStation {''} 
    118 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgMooring)) then element dgMooring {''} 
    119 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgStationGroup)) then element dgStationGroup {''} 
    120 else () 
    121 } 
    122 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform)) then  
    123 $SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform 
    124 else () 
    125 } (: </dgObservationStation> :) 
     85($SRObsStn/moles:logos) 
    12686} 
    12787} ; 
     
    296256        else () 
    297257    }, (: </dgActivityRole> :) 
    298     for $RelDep in $Act/moles:dgActivity/moles:ActivityDeployment 
    299         return 
    300         element ActivityDeployment { 
    301             ($RelDep/moles:DateStart), 
    302             if (exists($RelDep/moles:DateEnd)) then  
    303                 ($RelDep/moles:DateEnd) 
    304             else (), 
    305             ($RelDep/moles:dgMetadataID), 
    306             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    307             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    308                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    309 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    310 return 
    311 f:return-stub-dataentity('dataentity', $DE) 
    312         }, (: </ActivityDeployment> :) 
     258element DeploymentSummary { 
     259element dptList { 
     260for $DepDPTRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     261for $DepDPTLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     262let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     263return $DepDPT  
     264}, 
     265element obsStnList { 
     266for $DepObsStnRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     267for $DepObsStnLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     268let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     269return $DepObsStn  
     270}, 
     271element dataEntityList { 
     272for $DE in  
     273collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     274/moles:DataProductionToolID 
     275[moles:localIdentifier=$Act/moles:dgMetadataID/moles:localIdentifier 
     276and moles:repositoryIdentifier=$Act/moles:dgMetadataID/moles:repositoryIdentifier]] 
     277order by $DE/moles:dgMetadataID 
     278return f:return-stub-dataentity('dataentity', $DE) 
     279} 
     280}, (: </DeploymentSummary> :) 
    313281        if (exists($Act/dgActivityCoverage)) then 
    314282            ($Act/dgActivityCoverage) 
  • TI07-MOLES/trunk/StubB/XQuery/NDG-DEStubB.xquery

    r2482 r2575  
    3131($SRAct/moles:name), 
    3232($SRAct/moles:abbreviation), 
    33 ($SRAct/moles:logos), 
    34 element dgActivity { 
    35 if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCollection)) then  
    36 ($SRAct/*/moles:dgActivityDataCollection) 
    37 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataProject)) then  
    38 ($SRAct/*/moles:dgActivityDataProject) 
    39 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCampaign)) then 
    40 ($SRAct/moles:dgActivity/moles:dgActivityDataCampaign) 
    41 else  
    42 ($SRAct/moles:dgActivity/moles:dgActivityDataInvestigation),  
    43 ($SRAct/moles:dgActivity/moles:dgActivityCoverage), 
    44 ($SRAct/moles:dgActivity/moles:dgActivityDuration) 
    45 } (: </dgActivity> :)  
     33($SRAct/moles:logos) 
    4634} (: </activity> :)  
    4735} ; 
     
    5745($SRDE/moles:dgMetadataDescription), 
    5846($SRDE/moles:name), 
    59 ($SRDE/moles:abbreviation), 
    60 element dgDataEntity { 
    61 ($SRDE/moles:dgDataEntity/moles:dgDataSetType), 
    62 ($SRDE/moles:dgDataEntity/moles:dgDataGranule), 
    63 ($SRDE/moles:dgDataEntity/moles:dgDataSummary) 
     47($SRDE/moles:abbreviation) 
    6448} (: </dgDataEntity> :)         
    65 } 
    6649} ; 
    6750 
     
    8164$SRDPT/moles:name, 
    8265$SRDPT/moles:abbreviation, 
    83 $SRDPT/moles:logos, 
    84 element dgDataProductionTool { 
    85 $SRDPT/moles:dgDataProductionTool/moles:contactDetails, 
    86 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgModel)) then 
    87 $SRDPT/moles:dgDataProductionTool/moles:dgModel 
    88 else (), 
    89 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgInstrument)) then 
    90 $SRDPT/moles:dgDataProductionTool/moles:dgInstrument 
    91 else () 
    92 } (: </dgDataProductionTool> :) 
     66$SRDPT/moles:logos 
    9367} (: </dataproductiontool> :) 
    9468} ; 
     
    10983($SRObsStn/moles:name), 
    11084($SRObsStn/moles:abbreviation), 
    111 ($SRObsStn/moles:logos), 
    112 element dgObservationStation { 
    113 ($SRObsStn/moles:dgObservationStation/moles:contactDetails), 
    114 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform)) then 
    115 element dgStationaryPlatform { 
    116 $SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:position, 
    117 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgLandStation)) then element dgLandStation {''} 
    118 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgMooring)) then element dgMooring {''} 
    119 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgStationGroup)) then element dgStationGroup {''} 
    120 else () 
    121 } 
    122 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform)) then  
    123 $SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform 
    124 else () 
    125 } (: </dgObservationStation> :) 
     85($SRObsStn/moles:logos) 
    12686} 
    12787} ; 
     
    250210            else () 
    251211        } , (: </dgDataRoles> :) 
    252         for $RelDep in $DE/moles:dgDataEntity/moles:RelatedDeployment 
    253             return 
    254             element RelatedDeployment { 
    255             $RelDep/moles:DateStart, 
    256             $RelDep/moles:DateEnd, 
    257             $RelDep/moles:dgMetadataID, 
    258             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    259             f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)), 
    260             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    261             $RelDep/moles:Coverage 
    262         } (: </RelatedDeployment> :)  
    263         , 
     212element DeploymentSummary { 
     213element activityList { 
     214for $DepActRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     215for $DepActLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ActivityID/moles:localIdentifier) 
     216let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     217return $DepAct  
     218}, 
     219element dptList { 
     220for $DepDPTRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     221for $DepDPTLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     222let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     223return $DepDPT  
     224}, 
     225element obsStnList { 
     226for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     227for $DepObsStnLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     228let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     229return $DepObsStn  
     230} 
     231} (: </DeploymentSummary> :) , 
    264232        for $RelatedDataEntity in $DE/moles:dgDataEntity/moles:dgRelatedDataEntity 
    265233            return 
  • TI07-MOLES/trunk/StubB/XQuery/NDG-DPTStubB.xquery

    r2482 r2575  
    3131($SRAct/moles:name), 
    3232($SRAct/moles:abbreviation), 
    33 ($SRAct/moles:logos), 
    34 element dgActivity { 
    35 if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCollection)) then  
    36 ($SRAct/*/moles:dgActivityDataCollection) 
    37 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataProject)) then  
    38 ($SRAct/*/moles:dgActivityDataProject) 
    39 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCampaign)) then 
    40 ($SRAct/moles:dgActivity/moles:dgActivityDataCampaign) 
    41 else  
    42 ($SRAct/moles:dgActivity/moles:dgActivityDataInvestigation),  
    43 ($SRAct/moles:dgActivity/moles:dgActivityCoverage), 
    44 ($SRAct/moles:dgActivity/moles:dgActivityDuration) 
    45 } (: </dgActivity> :)  
     33($SRAct/moles:logos) 
    4634} (: </activity> :)  
    4735} ; 
     
    5745($SRDE/moles:dgMetadataDescription), 
    5846($SRDE/moles:name), 
    59 ($SRDE/moles:abbreviation), 
    60 element dgDataEntity { 
    61 ($SRDE/moles:dgDataEntity/moles:dgDataSetType), 
    62 ($SRDE/moles:dgDataEntity/moles:dgDataGranule), 
    63 ($SRDE/moles:dgDataEntity/moles:dgDataSummary) 
     47($SRDE/moles:abbreviation) 
    6448} (: </dgDataEntity> :)         
    65 } 
    6649} ; 
    6750 
     
    8164$SRDPT/moles:name, 
    8265$SRDPT/moles:abbreviation, 
    83 $SRDPT/moles:logos, 
    84 element dgDataProductionTool { 
    85 $SRDPT/moles:dgDataProductionTool/moles:contactDetails, 
    86 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgModel)) then 
    87 $SRDPT/moles:dgDataProductionTool/moles:dgModel 
    88 else (), 
    89 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgInstrument)) then 
    90 $SRDPT/moles:dgDataProductionTool/moles:dgInstrument 
    91 else () 
    92 } (: </dgDataProductionTool> :) 
     66$SRDPT/moles:logos 
    9367} (: </dataproductiontool> :) 
    9468} ; 
     
    10983($SRObsStn/moles:name), 
    11084($SRObsStn/moles:abbreviation), 
    111 ($SRObsStn/moles:logos), 
    112 element dgObservationStation { 
    113 ($SRObsStn/moles:dgObservationStation/moles:contactDetails), 
    114 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform)) then 
    115 element dgStationaryPlatform { 
    116 $SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:position, 
    117 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgLandStation)) then element dgLandStation {''} 
    118 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgMooring)) then element dgMooring {''} 
    119 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgStationGroup)) then element dgStationGroup {''} 
    120 else () 
    121 } 
    122 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform)) then  
    123 $SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform 
    124 else () 
    125 } (: </dgObservationStation> :) 
     85($SRObsStn/moles:logos) 
    12686} 
    12787} ; 
     
    189149        element dgDPTRoles {'Roles are available, and will be added soon'}  
    190150     else(), 
    191     for $RelDep in $DPT/moles:dgDataProductionTool/moles:DPTDeployment  
    192     return  
    193         element DPTDeployment {  
    194             $RelDep/moles:DateStart, 
    195             $RelDep/moles:DateEnd, 
    196             $RelDep/moles:dgMetadataID, 
    197             f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    198             f:return-stub-obsstn('observationstation', data($RelDep/moles:ObservationStationID/moles:repositoryIdentifier), data($RelDep/moles:ObservationStationID/moles:localIdentifier)), 
    199                 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier 
    200 and moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier] 
    201 return 
    202 f:return-stub-dataentity('dataentity', $DE), 
    203             $RelDep/moles:Coverage 
    204         } (: </DPTDeployment> :)  
    205     } (: </dgDataProductionTool> :),  
     151element DeploymentSummary { 
     152element activityList { 
     153for $DepActRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     154for $DepActLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ActivityID/moles:localIdentifier) 
     155let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     156return $DepAct  
     157}, 
     158element obsStnList { 
     159for $DepObsStnRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
     160for $DepObsStnLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     161let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
     162return $DepObsStn  
     163}, 
     164element dataEntityList { 
     165for $DE in  
     166collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     167/moles:DataProductionToolID 
     168[moles:localIdentifier=$DPT/moles:dgMetadataID/moles:localIdentifier 
     169and moles:repositoryIdentifier=$DPT/moles:dgMetadataID/moles:repositoryIdentifier]] 
     170order by $DE/moles:dgMetadataID 
     171return f:return-stub-dataentity('dataentity', $DE) 
     172} 
     173} (: </DeploymentSummary> :) 
     174} (: </dgDataProductionTool> :),  
    206175    for $strkwrd in $DPT/moles:dgStructuredKeyword return $strkwrd, 
    207176    if (exists($DPT/moles:dgMetadataProvenance)) then $DPT/moles:dgMetadataProvenance else (), 
  • TI07-MOLES/trunk/StubB/XQuery/NDG-ObsStnStubB.xquery

    r2572 r2575  
    169169} (: End </dgStationaryPlatform>  :)   
    170170else $ObsStn/moles:dgObservationStation/moles:dgMovingPlatform ,  
    171  
    172  
    173 element ObsStationDeploymentSummary { 
     171element DeploymentSummary { 
    174172element activityList { 
    175173for $DepActRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:repositoryIdentifier) 
    176 for $DepActLocal in distinct-values(($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment)/moles:ActivityID/moles:localIdentifier) 
     174for $DepActLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:localIdentifier) 
    177175let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
    178176return $DepAct  
     
    180178element dptList { 
    181179for $DepDPTRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
    182 for $DepDPTLocal in distinct-values(($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment)/moles:DataProductionToolID/moles:localIdentifier) 
     180for $DepDPTLocal in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:localIdentifier) 
    183181let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
    184182return $DepDPT  
    185183}, 
    186184element dataEntityList { 
    187 $ObsStn/moles:dgMetadataID, 
    188185for $DE in  
    189186collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     
    191188[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
    192189and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     190order by $DE/moles:dgMetadataID 
    193191return f:return-stub-dataentity('dataentity', $DE) 
    194192} 
    195 (:  
    196 for $DERepository in distinct-values( 
    197 collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord/moles:dgDataEntity/moles:RelatedDeployment 
    198 [moles:ObservationStationID 
    199 [moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
    200 and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
    201 /moles:repositoryIdentifier) 
    202 for $DELocal in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord/moles:dgDataEntity/moles:RelatedDeployment 
    203 [moles:ObservationStationID 
    204 [moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
    205 and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
    206 /moles:localIdentifier) 
    207 let $DERecord := collection('/db/ndg_B_metadata/badc.nerc.ac.uk')/moles:dgMetadata/moles:dgMetadataRecord 
    208 [moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID 
    209 [moles:localIdentifier=$DELocal 
    210 and moles:repositoryIdentifier=$DERepository]] 
    211 return f:return-stub-dataentity('dataentity', $DERecord) 
    212 :) 
    213 } (: </ObsStationDeploymentSummary> :)  
     193} (: </DeploymentSummary> :)  
    214194} (: </dgObservationStation> :),  
    215195for $strkwrd in $ObsStn/moles:dgStructuredKeyword return $strkwrd, 
Note: See TracChangeset for help on using the changeset viewer.