.. _metadata_xml_search_retrieve: Search and Retrieve Metadata services ===================================== .. index:: xml.search Search metadata (xml.search) ---------------------------- The **xml.search** service can be used to retrieve metadata records from GeoNetwork. Requires authentication: Optional Request ``````` Search configuration parameters (all values are optional) - **remote**: Search in local catalog or in a remote catalog. Values: off (default), on - **extended**: Values: on, off (default) - **timeout**: Timeout for request in seconds (default: 20) - **hitsPerPage**: Results per page (default: 10) - **similarity**: Lucene accuracy for searches (default 0.8) - **sortBy**: Sorting criteria. Values: relevance (default), rating, popularity, changeDate, title Search parameters (all values are optional): - **eastBL, southBL, northBL, westBL**: Bounding box to restrict the search - **relation**: Bounding box criteria. Values: equal, overlaps (default), encloses, fullyOutsideOf, intersection, crosses, touches, within - **any**: Text to search in a free text search - **title**: Metadata title - **abstract**: Metadata abstract - **themeKey**: Metadata keywords. To search for several use a value like "Global" or "watersheds" - **template**: Indicates if search for templates or not. Values: n (default), y - **dynamic**: Map type. Values: off (default), on - **download**: Map type. Values: off (default), on - **digital**: Map type. Values: off (default), on - **paper**: Map type. Values: off (default), on - **group**: Filter metadata by group, if missing search in all groups - **attrset**: - **dateFrom**: Filter metadata created after specified date - **dateTo**: Filter metadata created before specified date - **category**: Metadata category. If not specified, search all categories Request to search for all metadata example:: Url: http://localhost:8080/geonetwork/srv/eng/xml.search Mime-type: application/xml Post request: Request with free text search example:: Url: http://localhost:8080/geonetwork/srv/eng/xml.search Mime-type: application/xml Post request:s africa Request with a geographic search example:: Url: http://localhost:8080/geonetwork/srv/eng/xml.search Mime-type: application/xml Post request: africa 74.91574 29.40611 38.47198 60.50417 overlaps relevance geo Request to search using dates and keywords example:: Url: http://localhost:8080/geonetwork/srv/eng/xml.search Mime-type: application/xml Post request: africa "Global" or "World" 2000-02-03T12:47:00 2010-02-03T12:49:00 Response ```````` The response is the metadata record with additional **geonet:info** section. The main fields are: - **response**: Response container. - **summary**: Attribute **count** indicates the number of metadata records retrieved - **keywords**: List of keywords that are part of the metadata resultset. Each keyword contains the value and the number of occurences in the retrieved metadata records. - **metadata**: Container for each metadata record found. Each container has a **geonet:info** element with the following information: - **id**: Metadata internal identifier - **uuid** : Metadata Universally Unique Identifier (UUID) - **schema**: Metadata schema - **createDate**: Metadata creation date - **changeDate**: Metadata last modification date - **source**: Source catalogue the metadata - **category**: Metadata category (Can be multiple elements) - **score**: Value indicating the accuracy of search Metadata search response example:: 12 bc179f91-11c1-4878-b9b4-2270abde98eb iso19139 2007-07-25T12:05:45 2007-11-06T12:10:47 881a1630-d4e7-4c9c-aa01-7a9bbbbc47b2 maps interactiveResources 1.0 11 5df54bf0-3a7d-44bf-9abf-84d772da8df1 iso19139 2007-07-19T14:45:07 2007-11-06T12:13:00 881a1630-d4e7-4c9c-aa01-7a9bbbbc47b2 maps datasets interactiveResources 0.9178859 .. index:: xml.metadata.get Get metadata (xml.metadata.get) ------------------------------- The **xml.metadata.get** service can be used to retrieve a metadata record stored in GeoNetwork. Requires authentication: Optional Request ``````` *One* of the following parameters: - **uuid** : Metadata Universal Unique Identifier (UUID) - **id**: Metadata internal identifier Get metadata request example:: Url: http://localhost:8080/geonetwork/srv/en/xml.metadata.get Mime-type: application/xml Post request: aa9bc613-8eef-4859-a9eb-4df35d8b21e4 Response ```````` Successful response (HTTP status code 200) is the XML metadata record with additional **geonet:info** section. The principal fields for **geonet:info** are: - **schema**: Metadata schema - **createDate**: Metadata creation date - **changeDate**: Metadata last modification date - **isTemplate**: Indicates if the metadata returned is a template - **title**: Metadata title - **source**: Source catalogue the metadata - **uuid** : Metadata Universally Unique Identifier (UUID) - **isHarvested**: Indicates if the metadata is harvested - **popularity**: Indicates how often the record is retrieved - **rating**: Average rating provided by users - State of operation on metadata for the user: view, notify, download, dynamic, featured, edit - **owner**: Indicates if the user that executed the service is the owner of metadata - **ownername**: Metadata owner name Get metadata response example:: aa9bc613-8eef-4859-a9eb-4df35d8b21e4 ... 10 iso19115 2005-08-23T17:58:18 2007-03-12T17:49:50 n <source>881a1630-d4e7-4c9c-aa01-7a9bbbbc47b2</source> <uuid>aa9bc613-8eef-4859-a9eb-4df35d8b21e4</uuid> <isHarvested>n</isHarvested> <popularity>0</popularity> <rating>0</rating> <view>true</view> <notify>true</notify> <download>true</download> <dynamic>true</dynamic> <featured>true</featured> <edit>true</edit> <owner>true</owner> <ownername>admin</ownername> <subtemplates /> </geonet:info> </Metadata> Error response (HTTP 500 status code) is an XML document with the details of what went wrong. An example of such a response is as follows:: <error id="operation-not-allowed"> <message>Operation not allowed</message> <class>OperationNotAllowedEx</class> ..... </error> See :ref:`exception_handling` for more details. Errors `````` - **Request must contain a UUID or an ID**, if a uuid or id parameter was not provided. Returns 500 HTTP code - **Operation not allowed (error id: operation-not-allowed)**, when the user is not allowed to view the metadata record. Returns 500 HTTP code .. index:: xml.user.metadata Get user metadata (xml.user.metadata) ------------------------------------- The **xml.user.metadata** service can be used to retrieve a metadata records according to the user profile of the authenticated user running the service: - *Administrator* profile: return all metadata records - *Reviewer* or *User Administrator* profile: return all metadata records with groupOwner in the set of groups the user belongs to - *Editor* profile: return all metadata records owned by the user Requires authentication: Yes Request ``````` - **sortBySelect** : (optional) parameter specifying sort order of metadata records returned. Get metadata request example:: Url: http://localhost:8080/geonetwork/srv/eng/xml.user.metadata Mime-type: application/xml Post request: <?xml version="1.0" encoding="UTF-8"?> <request/> Response ```````` Successful response is an XML document with a response container and the user metadata records as children of that container. Each child has a **geonet:info** element which gives GeoNetwork specific metadata about the metadata record. An example response (with some content removed for brevity) is as follows:: <response> <!-- metadata record 1 --> <gmd:MD_Metadata ....> </gmd:MD_Metadata> <!-- metadata record 2 --> <gmd:MD_Metadata ....> </gmd:MD_Metadata> </response> Error response is an XML document with error container and the details of the error. Example:: <error id="service-not-allowed"> <message>Service not allowed</message> .... <object>xml.user.metadata</object> <request> <language>eng</language> <service>xml.user.metadata</service> </request> </error> See :ref:`exception_handling` for more details. Errors `````` - **Service not allowed (error id: service-not-allowed)**, user isn't allowed to run this service. Returned 500 HTTP code. - **Unauthorized user attempted to list editable metadata (error id: operation-not-allowed)**, when the user is not allowed to list metadata records. Returned 500 HTTP code .. index:: rss.search RSS Search: Search metadata and retrieve in RSS format (rss.search) ------------------------------------------------------------------- The **rss.search** service can be used to retrieve metadata records in RSS format, using regular search parameters. This service can be configured in **WEB-INF/config.xml** with the following parameters: - **maxSummaryKeys**: Maximum number of RSS records to retrieve (default = 10) Requires authentication: Optional. If not provided only public metadata records are retrieved Request ``````` Parameters: - **georss**: valid values are simple, simplepoint and default. See also http://georss.org - **simple**: Bounding box in georss simple format - **simplepoint**: Bounding box in georss simplepoint format - **default**: Bounding box in georss GML format - **eastBL, southBL, northBL, westBL**: Bounding box to restrict the search**** - **relation**: Bounding box criteria. Values: equal, overlaps (default), encloses, fullyOutsideOf, intersection, crosses, touches, within - **any**: Text to search in a free text search - **title**: Metadata title - **abstract**: Metadata abstract - themeKey: Metadata keywords. To search for several use a value like "Global" or "watersheds" - **dynamic**: Map type. Values: off (default), on - **download**: Map type. Values: off (default), on - **digital**: Map type. Values: off (default), on - **paper**: Map type. Values: off (default), on - **group**: Filter metadata by group, if missing search in all groups - **attrset**: - **dateFrom**: Filter metadata created after specified date - **dateTo**: Filter metadata created before specified date - **category**: Metadata category. If not specified, search all categories RSS search request example:: Url: http://localhost:8080/geonetwork/srv/en/rss.search Mime-type: application/xml Post request: <?xml version="1.0" encoding="UTF-8"?> <request> <georss>simplepoint</georss> <any>africa</any> <eastBL>74.91574</eastBL> <southBL>29.40611</southBL> <northBL>38.47198</northBL> <westBL>60.50417</westBL> <relation>overlaps</relation> <sortBy>relevance</sortBy> <attrset>geo</attrset> </request> Response ```````` The principal fields of the response are: - **channel**: This is the container for the RSS response - **title**: RSS channel title - **description**: RSS channel description - **item**: Metadata RSS item (one item for each metadata retrieved) - **title**: Metadata title - **link**: Link to show metadata page. Additional link elements (with rel="alternate") to OGC WXS services, shapefile/images files, Google KML, etc. can be returned depending on metadata - **description**: Metadata description - **pubDate**: Metadata publication date - **media**: Metadata thumbnails - **georss:point**: Bounding box in georss simplepoint format RSS search response example:: Mimetype: application/rss+xml Response: <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" version="2.0"> <channel> <title>GeoNetwork opensource portal to spatial data and information http://localhost:8080/geonetwork GeoNetwork opensource provides Internet access to interactive maps, satellite imagery and related spatial databases ... en All rights reserved. Your generic copyright statement Geographic metadata catalog GeoNetwork opensource 30 Hydrological Basins in Africa (Sample record, please remove!) http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1 Geographic metadata catalog 06 Nov 2007 12:13:00 EST http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1 Major hydrological basins and their sub-basins ... 16.9 1.8 .. index:: rss.latest RSS latest: Get latest updated metadata (rss.latest) ---------------------------------------------------- The **rss.latest** service can be used to retrieve the most recently modified metadata records in RSS format. This service can be configured in **WEB-INF/config.xml** file with the following parameters: - **maxItems**: Maximum number of RSS records to retrieve (default = 20) - **timeBetweenUpdates**: Minimum time (in seconds) between queries for latest updated metadata. If a request is received less than timeBetweenUpdates seconds after the last request, it will receive the same response. Requires authentication: Optional. If not provided only public metadata records are retrieved Request ``````` Parameters: - **georss**: valid values are simple, simplepoint and default. See also http://georss.org - **simple**: Bounding box in georss simple format - **simplepoint**: Bounding box in georss simplepoint format - **default**: Bounding box in georss GML format RSS latest request example:: Url: http://localhost:8080/geonetwork/srv/en/rss.latest Mime-type: application/xml Post request: default 1 Response ```````` The following are the principal fields of the response: - **channel**: This is the container for the RSS response - **title**: RSS channel title - **description**: RSS channel description - **item**: Metadata RSS item (one item for each metadata retrieved) - **title**: Metadata title - **link**: Link to show metadata page. Additional link elements (with rel="alternate") to OGC WXS services, shapefile/images files, Google KML, etc. can be returned depending on metadata - **description**: Metadata description - **pubDate**: Metadata publication date - **media**: Metadata thumbnails - **georss:where**: Bounding box with the metadata extent RSS latest response example:: Mimetype: application/rss+xml Response: GeoNetwork opensource portal to spatial data and information http://localhost:8080/geonetwork GeoNetwork opensource provides Internet access to interactive maps, satellite imagery and related spatial databases ... en All rights reserved. Your generic copyright statement Geographic metadata catalog GeoNetwork opensource 30 Hydrological Basins in Africa (Sample record, please remove!) http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1 Geographic metadata catalog 06 Nov 2007 12:13:00 EST http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1 Major hydrological basins and their sub-basins ... -34.6 -17.3 38.2 51.1