Sinar / ocds-scripts

Scripts to convert Malaysian contract data/info into OCDS standard release and records
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

Incomplete award data in OCDS-CIDB data #1

Open kmubiin opened 7 years ago

kmubiin commented 7 years ago

As the conversion script was written in hurry, I didn't bother to check the data consistency between CIDB data and OCDS-CIDB data until now. So self-reporting this as the first issue.

The "projects" list from CIDB data is being parsed into "award" field, which will hold the value of list. Note that the "projects" list may have:

  1. No project (empty list)
  2. One project (list of one object)
  3. Multiple projects (list of multiple objects)

Item 1 was resolved by considering if the list was empty, set awards_data to "None". Item 2 is resolved by parsing as it is to the function ocds_awards() and pointing to the first object in the list by index [0].

However, item 3 was overlooked and is not considered at the moment.

kmubiin commented 7 years ago

I have locally resolved item 3, but no commits yet. I will push the changes as several commits (instead of single commit) so that the changes can be observed in stages and ease of review.

kmubiin commented 7 years ago

This commit a24bc29 has simplified the code. Both item 2 and item 3 (one project and multiple projects) are now handled by same case of if-statement.

At this point, the only award data that is not converted to OCDS-CIDB data is the "location" field and its value. There are two ways to handle this leftout information:

  1. Put the value to "description" under "award" field. This will pass in the validation result.

  2. Simply add "location" and its value to JSON. This however, will cause this added field to appear under "Additional Fields (fields in data not in schema)" in the validation result.

If the "location" information is not needed, then this issue can be closed.