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

XQuery betas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.