source: exist/trunk/xquery/molesSummary.xq @ 3118

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/trunk/xquery/molesSummary.xq@3997
Revision 3118, 1.0 KB checked in by lawrence, 12 years ago (diff)

Splitting out the (authoratative?) python xqueries into named
files within the new egg for exist (and other ndg utilities)

Line 
1(: This query provides a summary line for a free text search into the moles for use in
2    browse. SEARCHSTRING should be overwritten with target query :)
3declare namespace m='http://ndg.nerc.ac.uk/moles';
4for $dd in collection('/db/ndg_B_metadata')//root()[. &= 'SEARCHSTRING']
5return <summary>
6<id>{$dd/m:dgMetadata/m:dgMetadataRecord/m:dgMetadataID/m:repositoryIdentifier/text()}__{$dd/m:dgMetadata/m:dgMetadataRecord/m:dgMetadataID/m:schemeIdentifier/text()}__{$dd/m:dgMetadata/m:dgMetadataRecord/m:dgMetadataID/m:localIdentifier/text()}</id>
7<name>{$dd/m:dgMetadata/m:dgMetadataRecord/m:name/text()}</name>
8<type>{if (exists($dd/m:dgMetadata/m:dgMetadataRecord/m:dgDataEntity)) then 'DataEntity' else (if (exists($dd/m:dgMetadata/m:dgMetadataRecord/m:dgObservationStation)) then 'ObservationStation' else (if (exists($dd/m:dgMetadata/m:dgMetadataRecord/m:dgDataProductionTool)) then 'DataProductionTool' else (if (exists($dd/m:dgMetadata/m:dgMetadataRecord/m:dgActivity)) then 'Activity' else ('unknown'))))}</type>
9</summary>
Note: See TracBrowser for help on using the repository browser.