FcigDM_ANFC - AtlasOfLivingAustralia/ala-datamob Wiki

Australian National Fish Collection: primary collection management system darwincore export

Introduction

This is an implementation of a darwincore export, for one of the FCIG-OZCAM participants.

Artefacts and synopsis

Data availability:

<a href='Hidden comment:

'>

Behaviour

There are three parts to the mapping:

This document doesn't cover (refer to the data manager):

anfc_dwc.run.pl

The first export component is a perl script, anfc_dwc.run.pl, which is the entry point for mapping a previously generated report to the simple-dwc format – this script takes instruction through the command line for various input/output options:

usage: anfc_dwc.run.pl <IN> <OUT> <ERROR> <LOG>
 - all 4 arguments:  input file (or 'STDIN'), output file (or 'STDOUT'), error file, log file
 - 3 arguments:      input file, output file, error file (run log to stdout)
 - 2 arguments:      input file, output file (errors stderr, run log to stdout)
 - 1 argument:       input file (output stdout, errors stderr, no run log)
 - no arguments:     (input stdin, output stdout, errors stderr, no run log)

After establishing a valid environment it reads from the input stream and expects to find a header row followed by data rows. The field delimiter is defined in the script variable $reDelim (currently the sequence +| "plus pipe") and is used by the perl split() function to separate rows into fields for processing in the mapping scripts.

Each row is mapped individually, as it is encountered in the source file, via the map_record() function defined in anfc_dwc.map.pl. Mapping results - stored in a temporary variable @arr_output - are printed to the output stream (if possible) and any warnings or errors encountered during the mapping are stored in the %hErrors buffer. Under successful conditions the script also prints periodically to the log stream, with any error rows being specifically marked as well. At the end of input processing, the contents of the error buffer are flushed to the error stream in a structured format.

Activity diagram for https://github.com/AtlasOfLivingAustralia/ala-datamob/tree/master/biodomains/fcig-ozcam/anfc/anfc_dwc.run.pl

Details on the steps in the previous diagram correspond with activity in anfc_dwc.map.pl:

Activity diagram for https://github.com/AtlasOfLivingAustralia/ala-datamob/tree/master/biodomains/fcig-ozcam/anfc/anfc_dwc.map.pl map_coords() function