Changeset 2698


Ignore:
Timestamp:
04/07/07 10:33:42 (12 years ago)
Author:
ko23
Message:

Fix for #799

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/models/ndg_xqueries.py

    r2672 r2698  
    33# Update DIF/DC queries  
    44 
    5 numsimQuery=''' declare default element namespace 'http://ndg.nerc.ac.uk/NumSim';  
    6 for $DE in collection('TargetCollection')/NS_Simulated[*/dgMetadataID/schemeIdentifier='NumSim' and */dgMetadataID/repositoryIdentifier='RepositoryID' and */dgMetadataID/localIdentifier='LocalID'] return $DE 
     5numsimQuery='''  
     6declare default element namespace 'http://ndg.nerc.ac.uk/NumSim';  
     7for $DE in  
     8collection('TargetCollection')/NS_Simulated[*/dgMetadataID/schemeIdentifier='NumSim'  
     9and */dgMetadataID/repositoryIdentifier='RepositoryID' and  
     10*/dgMetadataID/localIdentifier='LocalID']  
     11return $DE 
    712''' 
    813 
     
    3439declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
    3540declare variable $localIdentifier as xs:string {'LocalID'}; 
    36 (: replacable parameters 
    37 declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
    38 declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
    39 declare variable $localIdentifier as xs:string {'dataent_chablis'}; 
    40 :) 
    4141 
    4242declare function f:return-stub-activity($out-element-name as xs:string, $repid as xs:string, $locid as xs:string) as element()  
     
    247247element obsStnList { 
    248248for $DepObsStnRepository in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
    249 for $DepObsStnLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     249for $DepObsStnLocal in distinct-values($DE/moles:dgDataEntity/moles:RelatedDeployment/moles:ObservationStationID/moles:localIdentifier) 
    250250let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
    251251return $DepObsStn  
    252252} 
     253, element rawDeployments {for $rawDeployments in $DE/moles:dgDataEntity/moles:RelatedDeployment return $rawDeployments} 
    253254} (: </DeploymentSummary> :) , 
    254         for $RelatedDataEntity in $DE/moles:dgDataEntity/moles:dgRelatedDataEntity 
     255        for $RelatedDataEntity in $DE/moles:dgActivity/moles:dgRelatedDataEntity 
    255256            return 
    256257                element relateddataentity { 
     
    282283Will return when scope problem sussed... ;( 
    283284import module namespace stubblib='http://ndg.nerc.ac.uk/xquery/lib/stubb' at 'xmldb:exist:///db/xqueryLib/StubB/stubb_xquery_lib.xquery'; 
    284 :) 
    285 (: replacable parameters 
    286 declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
    287 declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
    288 declare variable $localIdentifier as xs:string {'activity_11680365144712080'}; 
    289285:) 
    290286declare variable $targetCollection as xs:string {'TargetCollection'}; 
     
    539535element obsStnList { 
    540536for $DepObsStnRepository in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
    541 for $DepObsStnLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     537for $DepObsStnLocal in distinct-values($Act/moles:dgActivity/moles:ActivityDeployment/moles:ObservationStationID/moles:localIdentifier) 
    542538let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
    543539return $DepObsStn  
     
    552548return f:return-stub-dataentity('dataentity', $DE) 
    553549} 
     550, element rawDeployments {for $rawDeployments in $Act/moles:dgActivity/moles:ActivityDeployment return $rawDeployments} 
    554551}, (: </DeploymentSummary> :) 
    555552        if (exists($Act/dgActivityCoverage)) then 
     
    578575declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    579576 
    580 (: replacable parameters 
    581 declare variable $targetCollection as xs:string {'/db/ndg_B_metadata'}; 
    582 declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
    583 declare variable $localIdentifier as xs:string {'dpt_116291244849226'}; 
    584 :) 
    585577declare variable $targetCollection as xs:string {'TargetCollection'}; 
    586578declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    727719element obsStnList { 
    728720for $DepObsStnRepository in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ObservationStationID/moles:repositoryIdentifier) 
    729 for $DepObsStnLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:DataProductionToolID/moles:localIdentifier) 
     721for $DepObsStnLocal in distinct-values($DPT/moles:dgDataProductionTool/moles:DPTDeployment/moles:ObservationStationID/moles:localIdentifier) 
    730722let $DepObsStn :=  f:return-stub-obsstn('observationstation', data($DepObsStnRepository), data($DepObsStnLocal)) 
    731723return $DepObsStn  
     
    740732return f:return-stub-dataentity('dataentity', $DE) 
    741733} 
     734, element rawDeployments {for $rawDeployments in $DPT/moles:dgDataProductionTool/moles:DPTDeployment return $rawDeployments} 
    742735} (: </DeploymentSummary> :) 
    743736} (: </dgDataProductionTool> :),  
     
    760753declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    761754 
    762 (: replacable parameters 
    763 declare variable $targetCollection as xs:string {'/db/ndg_B_metadata_4'}; 
    764 declare variable $repositoryIdentifier as xs:string {'badc.nerc.ac.uk'}; 
    765 declare variable $localIdentifier as xs:string {'obs_1162914661529326'}; 
    766 :) 
    767755declare variable $targetCollection as xs:string {'TargetCollection'}; 
    768756declare variable $repositoryIdentifier as xs:string {'RepositoryID'}; 
     
    942930return f:return-stub-dataentity('dataentity', $DE) 
    943931} 
     932, element rawDeployments {for $rawDeployments in $ObsStn/moles:dgObservationStation/moles:ObsStationDeployment return $rawDeployments} 
    944933} (: </DeploymentSummary> :)  
    945934} (: </dgObservationStation> :),  
     
    948937if (exists($ObsStn/moles:dgMetadataSecurity)) then $ObsStn/moles:dgMetadataSecurity else () 
    949938} (: End </dgMetadataRecord> :) 
    950 ) (: End namespace strip :) 
    951 ''' 
     939) (: End namespace strip :)''' 
    952940 
    953941ISO19139Query = ''' 
Note: See TracChangeset for help on using the changeset viewer.