Commit 19cb5f5d authored by Matija Obreza's avatar Matija Obreza
Browse files

Descriptor list import updated

- Associate descriptor#publisher with descriptorList#publisher
- Instructions for parsing data from Excel
parent dd17a4a4
......@@ -17,14 +17,14 @@ Install csvkit.
# ~/Library/Python/2.7/bin/in2csv "sources/crop_descriptors.csv" | ~/Library/Python/2.7/bin/csvcut -n
## Convert selected columns to JSON
~/Library/Python/2.7/bin/in2csv "sources/crop_descriptors.csv" \
~/Library/Python/2.7/bin/in2csv --sheet 'crop_descriptors' 'sources/Genesys - crop descriptors.xlsx' \
| ~/Library/Python/2.7/bin/csvcut \
-c 'category,crop,versionTag,title,dataType,keyDescriptor,description,integerOnly,minValue,maxValue,vocabularyId,code,code_title,code_description,published,columnName,uom,headingNumber' \
| PYTHONIOENCODING=utf8 ~/Library/Python/2.7/bin/csvjson -i 2 \
> cropdescriptors.json
## Descriptor lists
~/Library/Python/2.7/bin/in2csv "sources/descriptor_lists.csv" \
~/Library/Python/2.7/bin/in2csv --sheet 'descriptor_lists' 'sources/Genesys - crop descriptors.xlsx' \
| ~/Library/Python/2.7/bin/csvcut \
-c 'title,url,description,crop,versionTag,publisher,bibliographicCitation' \
| PYTHONIOENCODING=utf8 ~/Library/Python/2.7/bin/csvjson -i 2 \
......
......@@ -322,11 +322,16 @@ async function importDescriptors() {
o.integerOnly = o.integerOnly && o.integerOnly === 'TRUE'
? true
: false;
o.keyDescriptor = o.keyDescriptor && o.keyDescriptor === 'TRUE'
? true
: false;
const descriptorList = AVAILABLE_DESCRIPTORLISTS.get(`${o.crop}${o.versionTag}`);
// process.exit(-1);
if (descriptorList !== undefined && descriptorList.uuid) {
o.publisher = descriptorList.publisher;
}
return o;
}).filter((d) => isDescriptorComplete(d));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment