Changeset 4938 for ndgCommon/trunk/ndg


Ignore:
Timestamp:
10/02/09 17:42:27 (11 years ago)
Author:
cbyrom
Message:

Update xqueries:

  • make more precise to improve search performance
  • add in full paths to libs to ease use in eXist
  • create new xquery for searching for DIF docs
Location:
ndgCommon/trunk/ndg/common/xmldb/xquery
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/xmldb/xquery/atom.xq

    r4793 r4938  
    33declare variable $targetCollection as xs:string := 'TargetCollection'; 
    44declare variable $localIdentifier as xs:string := 'LocalID'; 
    5 for $DE in collection($targetCollection)/entry[matches(id, concat('__ATOM__',$localIdentifier,'$'))] return $DE 
     5declare variable $repositoryIdentifier as xs:string := 'RepositoryID'; 
     6for $DE in collection($targetCollection)/entry[matches(id, concat($repositoryIdentifier,'__ATOM__',$localIdentifier,'$'))] return $DE 
  • ndgCommon/trunk/ndg/common/xmldb/xquery/atomFullPath.xq

    r4793 r4938  
    44declare variable $targetCollection as xs:string := 'TargetCollection'; 
    55declare variable $localIdentifier as xs:string := 'LocalID'; 
    6 for $DE in collection($targetCollection)/entry[matches(id, concat('__ATOM__',$localIdentifier,'$'))]  
     6declare variable $repositoryIdentifier as xs:string := 'RepositoryID'; 
     7for $DE in collection($targetCollection)/entry[matches(id, concat($repositoryIdentifier,'__ATOM__',$localIdentifier,'$'))]  
    78return  
    89<collectionPath>{util:collection-name($DE)}</collectionPath> 
  • ndgCommon/trunk/ndg/common/xmldb/xquery/dif2moles.xq

    r4793 r4938  
    1 (: This query produces one MOLES data entity plus one organisation entry for a given DIF instance 
     1(: This query produces one MOLES data entity plus one organisation entry for a given DIF instance 
    22   Input is TargetCollection (where the DIF exists), RepositoryID, where the existing DIF lies, and 
    33   expected to be the output RepositoryID (fix it in the output xml if it's wrong), and Input_EntryID 
     
    88(: dgPersons are not created as one can't tell automatically which are people and which are orgs, and orgs are simpler :)   
    99 
    10 (: 
    1110import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
    1211import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'xmldb:exist:///db/xqueryLib/Utilities/inputParse_xquery_lib.xquery'; 
    13 :) 
    14 import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'vocab_xquery_lib.xquery'; 
    15 import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'inputParse_xquery_lib.xquery'; 
    16  
    1712 
    1813declare default element namespace 'http://ndg.nerc.ac.uk/moles'; 
  • ndgCommon/trunk/ndg/common/xmldb/xquery/mdip2moles.xq

    r4793 r4938  
    44(: Not producing valid MOLES as still got to work out parameter vocabulary namespaces in the subject field :)   
    55 
    6 import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'vocab_xquery_lib.xquery'; 
    7 import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'inputParse_xquery_lib.xquery'; 
     6import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     7import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'xmldb:exist:///db/xqueryLib/Utilities/inputParse_xquery_lib.xquery'; 
    88 
    99declare default element namespace 'http://ndg.nerc.ac.uk/moles'; 
  • ndgCommon/trunk/ndg/common/xmldb/xquery/moles2dif.xq

    r4793 r4938  
    1 declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
     1declare default element namespace 'http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/'; 
    22declare namespace xsi='http://www.w3.org/2001/XMLSchema-instance'; 
    33declare namespace moles='http://ndg.nerc.ac.uk/moles'; 
    44declare namespace f='http://ndg.nerc.ac.uk/moles/localfunctions'; 
    55 
    6  
    7 import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'vocab_xquery_lib.xquery'; 
    8 import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'inputParse_xquery_lib.xquery'; 
     6import module namespace voclib='http://ndg.nerc.ac.uk/xquery/lib/vocab' at 'xmldb:exist:///db/xqueryLib/Vocabs/vocab_xquery_lib.xquery'; 
     7import module namespace inputParse='http://ndg.nerc.ac.uk/xquery/lib/inputParse' at 'xmldb:exist:///db/xqueryLib/Utilities/inputParse_xquery_lib.xquery'; 
    98 
    109 
Note: See TracChangeset for help on using the changeset viewer.