open-contracting / oc4idskit

A suite of command-line tools for working with OC4IDS data
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

convert-from-ocds: project sector mapping loses OCDS for PPPs planning.project.sector classification information #7

Open pindec opened 3 years ago

pindec commented 3 years ago

Running convert-to-oc4ids on the sample OCDS for PPPs flagged an issue with the automatic mapping from OCDS planning.project.sector (a Classification object) to OC4IDS project.sector (an array of strings).

The code currently concatenates scheme and id:

sector_name = sector_scheme + "-" + sector_id

So transforming OCDS for PPPs data:

"sector": 
{
   "scheme": "COFOG",
   "description": "Communication (CS)",
  "id": "04.6.0",
   "uri": "https://unstats.un.org/unsd/cr/registry/regcs.asp?Cl=4&Lg=1&Co=04.6.0"
}

Generates:

"sector": ["COFOG-04.6.0"]

Although the projectSector codelist is open, the above concatenation of scheme and id loses information because planning.project.sector is a Classification block (although oc4ids /definitions/Classification/properties is currently missing uri).

Where an OCDS project.sector classification object exists, it would be better to map to project.additionalClassifications (as well as anything in planning.project.additionalClassifications), and update documentation to instruct users to additionally manually map to the projectSector codelist and/or link to mapping documentation as updated in OC4IDS standard issue #210.