source: exist/branches/proglue_production_rev4605_xquery4884/xquery/molesSummary.xq @ 4886

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/branches/proglue_production_rev4605_xquery4884/xquery/molesSummary.xq@4886
Revision 4886, 1.0 KB checked in by sdonegan, 10 years ago (diff)

Creating operational branch for ndgUtils as used on proglue

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.