Ignore:
Timestamp:
11/06/07 13:41:42 (12 years ago)
Author:
ko23
Message:
 
File:
1 edited

Legend:

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

    r2553 r2572  
    3030($SRAct/moles:name), 
    3131($SRAct/moles:abbreviation), 
    32 ($SRAct/moles:logos), 
    33 element dgActivity { 
    34 if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCollection)) then  
    35 ($SRAct/*/moles:dgActivityDataCollection) 
    36 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataProject)) then  
    37 ($SRAct/*/moles:dgActivityDataProject) 
    38 else if (exists($SRAct/moles:dgActivity/moles:dgActivityDataCampaign)) then 
    39 ($SRAct/moles:dgActivity/moles:dgActivityDataCampaign) 
    40 else  
    41 ($SRAct/moles:dgActivity/moles:dgActivityDataInvestigation),  
    42 ($SRAct/moles:dgActivity/moles:dgActivityCoverage), 
    43 ($SRAct/moles:dgActivity/moles:dgActivityDuration) 
    44 } (: </dgActivity> :)  
     32($SRAct/moles:logos) 
    4533} (: </activity> :)  
    4634} ; 
     
    5644($SRDE/moles:dgMetadataDescription), 
    5745($SRDE/moles:name), 
    58 ($SRDE/moles:abbreviation), 
    59 element dgDataEntity { 
    60 ($SRDE/moles:dgDataEntity/moles:dgDataSetType), 
    61 ($SRDE/moles:dgDataEntity/moles:dgDataGranule), 
    62 ($SRDE/moles:dgDataEntity/moles:dgDataSummary) 
     46($SRDE/moles:abbreviation) 
    6347} (: </dgDataEntity> :)         
    64 } 
    6548} ; 
    6649 
     
    8063$SRDPT/moles:name, 
    8164$SRDPT/moles:abbreviation, 
    82 $SRDPT/moles:logos, 
    83 element dgDataProductionTool { 
    84 $SRDPT/moles:dgDataProductionTool/moles:contactDetails, 
    85 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgModel)) then 
    86 $SRDPT/moles:dgDataProductionTool/moles:dgModel 
    87 else (), 
    88 if (exists($SRDPT/moles:dgDataProductionTool/moles:dgInstrument)) then 
    89 $SRDPT/moles:dgDataProductionTool/moles:dgInstrument 
    90 else () 
    91 } (: </dgDataProductionTool> :) 
     65$SRDPT/moles:logos 
    9266} (: </dataproductiontool> :) 
    9367} ; 
     
    10882($SRObsStn/moles:name), 
    10983($SRObsStn/moles:abbreviation), 
    110 ($SRObsStn/moles:logos), 
    111 element dgObservationStation { 
    112 ($SRObsStn/moles:dgObservationStation/moles:contactDetails), 
    113 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform)) then 
    114 element dgStationaryPlatform { 
    115 $SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:position, 
    116 if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgLandStation)) then element dgLandStation {''} 
    117 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgMooring)) then element dgMooring {''} 
    118 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgStationaryPlatform/moles:dgStationGroup)) then element dgStationGroup {''} 
    119 else () 
    120 } 
    121 else if (exists($SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform)) then  
    122 $SRObsStn/moles:dgObservationStation/moles:dgMovingPlatform 
    123 else () 
    124 } (: </dgObservationStation> :) 
     84($SRObsStn/moles:logos) 
    12585} 
    12686} ; 
     
    209169} (: End </dgStationaryPlatform>  :)   
    210170else $ObsStn/moles:dgObservationStation/moles:dgMovingPlatform ,  
    211 for $RelDep in $ObsStn/moles:dgObservationStation/moles:ObsStationDeployment  
    212 return  
    213 element ObsStationDeployment { 
    214 $RelDep/moles:DateStart, 
    215 $RelDep/moles:DateEnd, 
    216 $RelDep/moles:dgMetadataID, 
    217 f:return-stub-activity('activity', data($RelDep/moles:ActivityID/moles:repositoryIdentifier), data($RelDep/moles:ActivityID/moles:localIdentifier)), 
    218 f:return-stub-dpt('dataproductiontool', data($RelDep/moles:DataProductionToolID/moles:repositoryIdentifier), data($RelDep/moles:DataProductionToolID/moles:localIdentifier)),  
    219 for $DE in collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[ 
    220 moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:localIdentifier=$RelDep/moles:dgMetadataID/moles:localIdentifier 
    221 and 
    222 moles:dgDataEntity/moles:RelatedDeployment/moles:dgMetadataID/moles:repositoryIdentifier=$RelDep/moles:dgMetadataID/moles:repositoryIdentifier] 
    223 return 
    224 f:return-stub-dataentity('dataentity', $DE), 
    225 $RelDep/moles:Coverage 
    226 } (: </RelatedDeployment> :)  
     171 
     172 
     173element ObsStationDeploymentSummary { 
     174element activityList { 
     175for $DepActRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:ActivityID/moles:repositoryIdentifier) 
     176for $DepActLocal in distinct-values(($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment)/moles:ActivityID/moles:localIdentifier) 
     177let $DepAct :=  f:return-stub-activity('activity', data($DepActRepository), data($DepActLocal)) 
     178return $DepAct  
     179}, 
     180element dptList { 
     181for $DepDPTRepository in distinct-values($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment/moles:DataProductionToolID/moles:repositoryIdentifier) 
     182for $DepDPTLocal in distinct-values(($ObsStn/moles:dgObservationStation/moles:ObsStationDeployment)/moles:DataProductionToolID/moles:localIdentifier) 
     183let $DepDPT :=  f:return-stub-dpt('dataproductiontool', data($DepDPTRepository), data($DepDPTLocal)) 
     184return $DepDPT  
     185}, 
     186element dataEntityList { 
     187$ObsStn/moles:dgMetadataID, 
     188for $DE in  
     189collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord[moles:dgDataEntity/moles:RelatedDeployment 
     190/moles:ObservationStationID 
     191[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
     192and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     193return f:return-stub-dataentity('dataentity', $DE) 
     194} 
     195(:  
     196for $DERepository in distinct-values( 
     197collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord/moles:dgDataEntity/moles:RelatedDeployment 
     198[moles:ObservationStationID 
     199[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
     200and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     201/moles:repositoryIdentifier) 
     202for $DELocal in (collection($targetCollection)/moles:dgMetadata/moles:dgMetadataRecord/moles:dgDataEntity/moles:RelatedDeployment 
     203[moles:ObservationStationID 
     204[moles:localIdentifier=$ObsStn/moles:dgMetadataID/moles:localIdentifier 
     205and moles:repositoryIdentifier=$ObsStn/moles:dgMetadataID/moles:repositoryIdentifier]] 
     206/moles:localIdentifier) 
     207let $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 
     210and moles:repositoryIdentifier=$DERepository]] 
     211return f:return-stub-dataentity('dataentity', $DERecord) 
     212:) 
     213} (: </ObsStationDeploymentSummary> :)  
    227214} (: </dgObservationStation> :),  
    228215for $strkwrd in $ObsStn/moles:dgStructuredKeyword return $strkwrd, 
Note: See TracChangeset for help on using the changeset viewer.