Skip to content

Processing Instructions

Pascal Dihé edited this page May 24, 2016 · 3 revisions

Processing Instructions allow the SIP Backend to perform certain tasks when meta-data is uploaded to SIP Meta-Data Repository. Processing Instructions are provided as part of the meta-data (property uploadmessage of the repesentation entity) submitted via the SIP REST API to SIP Meta-Data Repository, e.g. by clients like the SIP HTML Open Data Registration Tool. For more information on the structure of meta-data entities refer to the specification SWITCH-ON's Standard Information Model for Meta-Data.

The the SIP Backend supports currently Processing Instructions for the following tasks:

Update Spatial Index

The spatial index (table geom_search) of the Meta-Data Repository that enables geographic searches for resources can both be populated by

  • a) the actual spatial coverage of the resource provided as part of the property spatialcoverage (table geom) of the resource meta-data (commonly a bounding box)
  • b) geometries (points, multipoints, polygons or multipolygons) available in a representation (the actual data) of a resource (commonly an ESRI Shapefile).

a) is the default behaviour, if no dedicated processing instruction is provided. Thus, to instruct the SIP Backend to update the spatial index with the contents of a spatial data file (e.g. ESRI Shapefile), the property uploadmessage of the actual representation entity (the representation of the actual spatial data file) has to be provided according to the following specification.

The Spatial Index of the Meta-Data Repository can currently automatically be updated with the contents of ESRI Shape File archives. That is a ZIP file that has to contain the .SHP file along with the required .SHX, .DBF, etc. files. This leads to the following requirements regarding the properties of the representation entity holding the Processing Instruction:

  • name: name of the ZIP file (mandatory)
  • description: description of the ZIP file content (optional)
  • contentlocation: http(s) or ftp:// direct download URL (mandatory)
  • contenttype: application/zip (mandatory, fixed)
  • type: original data (mandatory, fixed)
  • function: download (mandatory, fixed)
  • protocol: WWW:DOWNLOAD-1.0-ftp--download or WWW:DOWNLOAD-1.0-http--download (mandatory, fixed)
  • uploadmessage: deriveSpatialIndex:shp

Example for Open Data Registration Tool JSON API:

    [{
        "name": "lceu_cha00_90.zip",
        "description": "Corine land cover changes (CLC2000 - CLC2006). Shape file (polygon features)",
        "contentlocation": "http://ftp.eea.europa.eu/www/eea-data/lceu_cha00_90.zip",
        "contenttype": "application/zip",
        "type": "original data",
        "function": "download",
        "protocol": "WWW:DOWNLOAD-1.0-ftp--download",
        "uploadmessage": "deriveSpatialIndex:shp"
    }]

When SIP Backend retrieves such a JSON file, the Processing Instruction 'deriveSpatialIndex:shp' tells the Backend to download the the ZIP File from the contentlocation and to import the geometries from the contained Shape File into Spatial Index of the Meta-Data Repository. Furthermore, in case of an successful or unsuccessful import the uploadmessage property of the representation will be replaced by a (error) message generated by the curl, unzip, ogr2ogr and psql processes invoked by the Backend.

####Example

Open Data Registration Tool URL with representations query parameter:

http://switchon.cismet.de/open-data-registration-snapshot/index.html

Clone this wiki locally