2 Mapping trade data
In this section, we show how the mapping process is performed under the data built by the user. Commodity codes are reported as HS codes (Harmonized Commodity Description and Coding System) or CN codes for European countries, which are mapped into ISSCFC (FAO Commodity List) codes. This step is performed using some auxiliar tables stored in the SWS.
2.1 Definitions
Mappings to be improved: Data from UNSD data source are often reported at the Tariff Line level, that is, the commodities are country-specific, and hence we have precise information about the description of those commodities. Nevertheless, the link between these codes and ISSCFC codes may be built using only the six first digits of the Tariff Line code, that is, we loss information, so that we may improve these mappings.
Unmapped: Commodity code without any correspondent ISSCFC code in the Trade Map Table, and also in the master files: HS Master file for non-European countries and EUCN Master file for European countries.
Scheda code: Internal identifier in Commodit Software (old system). Given the combination of a Country | Trade Flow | Fao Group | Tariff line it is generated a sequential code. This code format is the combination between the sequential code and the FAO Group resulting in F.SSSS, where F is the FAO Group and SSSS is the sequential code.
2.2 Mapping Module
In Figure 2.1, we show the mapping module workflow. As all modules are connected , the user will be able to run the Mapping Module only for those countries-year that the data was built. Therefore, the main input data is the data table fishtrade_data_built
, and hence the user must query this table by selecting the year and country through the Fisheries Trade Tool.
- Inputs:
- Parameters: year, reporter
Figure 2.1: Mapping Module workflow
The Trade Map Table stores the mapping between Tariff Line and ISSCFC code, which are the mappings developed by the FIAS team. Therefore, we should try to map all data stored in the datatable fishtrade_data_built
using this data table. Otherwise, if some commodities code could not be mapped, then we have to use the Master files mappings, which depends on whether the country is European or not.
Figure 2.1 shows the back-end of the Mapping Module, while Figure 2.2 shows the front-end. In the left side, we show the buttons which allows us to choose which country and year we wish to run the mapping module. While in the right side, we show the mapping tool with option to add, improve, and complete the mappings. The buttons “Save” and “Update” in the right side are the same that we show in Figure 2.1.
Figure 2.2: Mapping Module: fron-end
2.3 Functions
run_mapping_module
: It is the main function for the Mapping Module.get_cn_masterfile
: It gets the CN masterfile to map European countries.get_hs_masterfile
: It gets the HS masterfile to map non-European countries.