Skip to content
Emanuele Tajariol edited this page Mar 14, 2016 · 9 revisions

The ckanext-geonetwork extension builds on the ckanext-spatial extension, and inherits all of its functionalities.

Features

Some extra functionalities are added: such as:

  • add the dataset extras key gn_localized_url containing the base URL for accessing GeoNetwork services (e.g. http://yourdomainname/geonetwork/srv/it/);
  • add the dataset extras key gn_view_metadata_url containing the full URL for visualising the full original metadata inside GeoNetwork (e.g. http://yourdomainname/geonetwork/srv/it/metadata.show?uuid=arw_3km_High_cloud_cover_HCY_XYZ);
  • fix the resource format if the onlineresource protocol contains OGC:WMS;
  • Parse elements associated to the old GML URI http://www.opengis.net/gml beside the currently used http://www.opengis.net/gml/3.2;
  • parse and import into extras fields some other ISO elements, such as temporal extents expressed as TimeInstant;
  • allow replaceable tokens inside extras;
  • associate CKAN groups to the resource according to the categories in GeoNetwork. This is done using GeoNetwork service, since CSW does not privide this info.

Installation

Before installing the ckanext-geonetwork extension, you need to install:

Once done that, you can install the ckanext-geonetwork extension going through the usual steps:

  1. Activate your CKAN virtual environment, for example:

     $ . /usr/lib/ckan/default/bin/activate
    
  2. Install the ckanext-geonetwork Python package into your virtual environment:

     (pyenv) $ cd default/src
     (pyenv) $ git clone https://github.com/geosolutions-it/ckanext-geonetwork.git
    
  3. Install the python modules required by the extension:

     (pyenv) $ cd ckanext-geonetwork
     (pyenv) $ python setup.py develop
    
  4. Make sure the CKAN configuration ini file contains the geonetwork-harvester plugin:

     ckan.plugins = [...] geonetwork_harvester
    

Configuration

You will have to provide to the harvester the harvesting URL, which will be the same as the CSW endpoint: e.g.:

    http://yourdomainname/geonetwork/srv/it/csw

The configuration string accepts all the configuration the spatial harvester has, such as

  • default_extras: a dict containing extras key/value that will be stored along with every dataset harvested from this source; extras values may contains tokens in the form of {token}, which will be replaced during the harvesting stage; allowed tokens are:
    • harvest_source_id
    • harvest_source_url
    • harvest_source_title
    • harvest_job_id
    • harvest_object_id
    • guid
  • default_tags: a list containing tags that will be stored along with every dataset harvested from this source;
  • cql: a CQL filter for harvesting only a subset of the source catalog's records;
  • private_datasets: If True sets as private the dataset. A dataset can be private if belongs to an organization Furthermore these other parameters will be read:
  • version: geonetwork version. Currently only 2.6, and 2.10 are accepted. This is needed to find out which services are available on the GeoNetowrk instance. For instance, in order to extract the categories associated to a metadata in version 2.6, the only way to find it is to get a MEF of the metadata and to parse the info.xml file packed into it.
  • group_mapping: it's a dict that associates category names to group names. If this parameter is defined, GN will be queried about the categories of the metadata, a matching group for each category will be searched in the provided mapping and will then be associated to the metadata if one or more are found
  • harvest_iso_categories: requires 'group_mapping' defined. If True allow to harvest metadata using ISO categories instead GeoNetwork internal categories.

Sample configuration:

{"default_tags": ["TestTag"], 
"default_extras": {"sample_extra": "test extra value"}, 
"cql": "title LIKE '%ARW%'",
"private_datasets": "False",
"version": "2.6", 
"group_mapping": {"e12": "arw12", "e3": "arw3"}
}

Using the cql filter strategy for the harvest procedure there are the possibility to use all the standards filter type allowed in CSW, below an additional example with 'keyword':

"cql": "keyword LIKE '%istruzione%'"

Clone this wiki locally