GeoNetwork has three different export options to export metadata. They operate on selected sets of metadata from the search results. As such they are accessible from the “actions on selection” menu as shown in the following example:
Export as a ZIP archive¶
When a selected set of metadata records is exported as a ZIP archive, each metadata record is inserted in the ZIP archive as a directory containing the metadata, any data uploaded with the metadata record and the thumbnails. This type of ZIP archive is the MEF (Metadata Exchange Format) Version 2.0. You can find more details of MEF V2 in the GeoNetwork Developers Manual.
Export as a CSV file¶
When a selected set of metadata records is exported as a CSV/TXT file, the following process takes place for each metadata record:
a brief summary of some of the elements from each selected metadata record is generated by applying the brief template from the metadata schema. The main folder of the different available schema is
GEONETWORK_DATA_DIR/config/schema_plugins/. In particular, for an iso19115-3.2018 it is located here:
the elements common to the brief summary elements for all metadata records are extracted (as they may differ according to the metadata schema)
a title record with comma separated element names is created
the content of each element is laid out in comma separated form. Where there is more than one child element in the brief element (eg. for geoBox), the content from each child element is separated using ‘###’.
An example of an ISO metadata record in CSV format is shown as follows:
It is possible to override the brief summary of metadata elements by creating a special template in the presentation XSLT of the metadata schema. As an example of how to do this, we will override the brief summary for the iso19115-3.2018 schema and replace it with other possible useful information.
In the case of iso19115-3.2018 there are the two files to be modified:
For example, to export the following elements:
in the first file, it is necessary to proceed as in the follwoing:
to comment the elements
id, title, abstractexcept
<uuid> <xsl:value-of select="gn:info/uuid"/> </uuid>
to add a similar line in between the abstract and category elements:
<title> <xsl:copy-of select="mdb:identificationInfo/*/mri:citation/*/cit:title"/> </title> <cloud_coverage_percentage> <xsl:copy-of select="mdb:contentInfo/mrc:MD_ImageDescription/mrc:cloudCoverPercentage/gco:Real"/> </cloud_coverage_percentage> <category> <xsl:value-of select="mdb:metadataScope/*/mdb:resourceScope/*/@codeListValue"/> </category>
About cloud coverage percentage, in particular, please remember to add the namespace if missing:
If not interested in other information, please comment all other lines except:
because it is used to sort results by schema.
About the second file, csv-search.xsl, to avoid printing automatically the 3 columns:
you have to comment the following lines:
<xsl:text>"schema"</xsl:text> <xsl:value-of select="$sep"/> <xsl:text>"uuid"</xsl:text> <xsl:value-of select="$sep"/> <xsl:text>"id"</xsl:text> <xsl:value-of select="$sep"/>
<xsl:value-of select="concat('"', $metadata/geonet:info/schema, '"', $sep, '"', $metadata/geonet:info/uuid, '"', $sep, '"', $metadata/geonet:info/id, '"', $sep)"/>
These changes will create the desired output: