Changeset 3128 for exist/trunk/xquery


Ignore:
Timestamp:
07/12/07 14:09:53 (12 years ago)
Author:
lawrence
Message:

The dif2moles round tripping is in place (but the comparison doesn't
work and needs analysis).

Location:
exist/trunk/xquery
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/xquery/dif2moles.xq

    r3100 r3128  
    1 (: Version for one DIF per dgMetadata instance :) 
     1(: This query produces one MOLES data entity plus one organisation entry for a given DIF instance 
     2   Input is TargetCollection (where the DIF exists), RepositoryID, where the existing DIF lies, and 
     3   expected to be the output RepositoryID (fix it in the output xml if it's wrong), and Input_EntryID 
     4   which is the DIF entryID, and LocalID which is the output localID for the data entity. We also 
     5   need the localID for the organisation entity, which appears as repository_localid 
     6   :) 
    27(: Note algoritm for creating non-pre-existing organisations :) 
    38(: dgPersons are not created as one can't tell automatically which are people and which are orgs, and orgs are simpler :)   
     
    813declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance';  
    914 
     15(: Keep as an example, but note the entryID in the dif is an 
     16   NDG format ID, so the example isn't as obvious .... 
     17declare variable $targetCollection as xs:string {'/db/discovery/original/ndg.noc.soton.ac.uk'}; 
     18declare variable $input_repository as xs:string {'ndg.noc.soton.ac.uk'}; 
     19declare variable $input_repository_local as xs:string {'nocs'}; 
     20declare variable $input_entry_id as xs:string {'ndg.noc.soton.ac.uk__DIF__NOCSDAT110'}; 
     21declare variable $output_local_id as xs:string {'NOCS_DAT110'}; 
     22:) 
    1023(: Replacable parameters :) 
    11 declare variable $targetCollection as xs:string {'/db/discovery'}; 
    12 declare variable $input_repository as xs:string {'Input_Repository_Code'}; 
    13 declare variable $input_repository_local as xs:string {'Input_Repository_LocalID'}; 
    14 declare variable $input_entry_id as xs:string {'ndg.noc.soton.ac.uk__DIF__NOCSDAT110'}; 
    15 declare variable $localIdentifier as xs:string {'ndg.noc.soton.ac.uk__DIF__NOCSDAT110'}; 
     24declare variable $targetCollection as xs:string {'TargetCollection'}; 
     25declare variable $input_repository as xs:string {'RepositoryID'}; 
     26declare variable $input_repository_local as xs:string {'repository_localid'}; 
     27declare variable $input_entry_id as xs:string {'Input_Entry_ID'}; 
     28declare variable $output_local_id as xs:string {'LocalID'}; 
    1629 
    17 declare variable $output_local_id as xs:string {'Output_LocalID'}; 
    18 (: Keep 
    19 declare variable $targetCollection as xs:string {'TargetCollection'}; 
    20 declare variable $input_repository as xs:string {'Input_Repository_Code'}; 
    21 declare variable $input_repository_local as xs:string {'Input_Repository_LocalID'}; 
    22 declare variable $input_entry_id as xs:string {'Input_Entry_ID'}; 
    23 declare variable $output_local_id as xs:string {'Output_LocalID'}; 
    24 :) 
    2530for $DIF in collection($targetCollection)/dif:DIF[dif:Entry_ID=$input_entry_id] 
    2631return 
Note: See TracChangeset for help on using the changeset viewer.