Search and Retrieve Metadata services

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:
<?xml version="1.0" encoding="UTF-8"?>
<request>
  <uuid>aa9bc613-8eef-4859-a9eb-4df35d8b21e4</uuid>
</request>

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:

<?xml version="1.0" encoding="UTF-8"?>
<Metadata xmlns:geonet="http://www.fao.org/geonetwork"
  xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
  <mdFileID>aa9bc613-8eef-4859-a9eb-4df35d8b21e4</mdFileID>
  ...
  <geonet:info>
    <id>10</id>
    <schema>iso19115</schema>
    <createDate>2005-08-23T17:58:18</createDate>
    <changeDate>2007-03-12T17:49:50</changeDate>
    <isTemplate>n</isTemplate>
    <title />
    <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 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

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 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

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:
<?xml version="1.0" encoding="UTF-8"?>
<request>
  <georss>default</georss>
  <maxItems>1</maxItems>
</request>

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:
<?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</title>
  <link>http://localhost:8080/geonetwork</link>
  <description>GeoNetwork opensource provides Internet access to interactive maps,
  satellite imagery and related spatial databases ... </description>
  <language>en</language>
  <copyright>All rights reserved. Your generic copyright statement </copyright>
  <category>Geographic metadata catalog</category>
  <generator>GeoNetwork opensource</generator>
  <ttl>30</ttl>
  <item>
    <title>Hydrological Basins in Africa (Sample record, please remove!)</title>
    <link>http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1</link>
    <link href="http://geonetwork3.fao.org/ows/296?SERVICE=wms$amp;VERSION=1.1.1&REQUEST=GetMap
      &BBOX=-17.3,-34.6,51.1,38.2&LAYERS=hydrological_basins&SRS=EPSG:4326&WIDTH=200
      &HEIGHT=213&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=default" type="image/png"
      rel="alternate" title="Hydrological basins in Africa"/>
    <link href="http://localhost:8080/geonetwork/srv/en/google.kml?
      uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1&layers=hydrological_basins"
      type="application/vnd.google-earth.kml+xml"
      rel="alternate" title="Hydrological basins in Africa"/>
    <category>Geographic metadata catalog</category>
    <description><![CDATA[ ... ]]></description>
    <pubDate>06 Nov 2007 12:13:00 EST</pubDate>
    <guid>http://localhost:8080/geonetwork?uuid=5df54bf0-3a7d-44bf-9abf-84d772da8df1</guid>
    <media:content url="/geonetwork/srv/en/resources.get?id=11&fname=thumbnail_s.gif
      &access=public" type="image/gif" width="100"/>
      <media:text>Major hydrological basins and their sub-basins ...</media:text>
   <!--Bounding box in georss GML format (http://georss.org)-->
   <georss:where>
     <gml:Envelope>
       <gml:lowerCorner>-34.6 -17.3</gml:lowerCorner>
       <gml:upperCorner>38.2 51.1</gml:upperCorner>
     </gml:Envelope>
   </georss:where>
  </item>
</channel>
</rss>