I am learning a lot from Owen Stephens' example here:
But my data is a bit different. I have a chunk of JSON and within it is a single array consisting of multiple objects:
[
{"label":"Title","value":"Caarte Van West Indien, Soo Vaste landen als Eylanden, Nieuwelyckx Met Veele Perfexien Gecorigeert Ende Verbeetert, ende alle Clippen, Droochteen, Ree:en, Haavens, Rivieren, steeden, en Bergen et. daar in genoteert soo die ghelege zyn"},
{"label":"Title","value":"Heroes hodierni arconautæ in occidio of hedendaagscher helden-tocht met oorlogs vloten en heirlegers over zee getrocken. Virg: erunt etiam altea bella oceam finem juxta solemqsz cadentem tot Amsterdam, By Gerard Valck en Petrus Schenk"},
{"label":"Author/creator","value":"Vingboons, Johannes (1616/17-1670)"},
{"label":"Subject (topical)","value":"Unspecified"},
{"label":"Country","value":{"@value":"Netherlands","@language":"eng"}},
{"label":"Date issued","value":"2016 "},
{"label":"Publication date","value":"2016 "},
{"label":"Language","value":{"@value":"Dutch","@language":"eng"}},
{"label":"Language","value":{"@value":"Latin","@language":"eng"}},
{"label":"Extent","value":"1 digital resource"},
{"label":"Note","value":["On the bottom: ‘Joan Vinc : Boons fecit. Et exud.’","3 scale sticks."]},
{"label":"Subject (topical)","value":"74.26 geography of Central and South America"},
{"label":"Subject (geographic)","value":"Florida"},
{"label":"Subject (geographic)","value":"Caribbean region"},
{"label":"Subject (geographic)","value":"Gulf of Mexico"},
{"label":"Subject (geographic)","value":"Mexico"},
{"label":"Subject (geographic)","value":"Central America"},
{"label":"Published","value":"Amsterdam: Gerard Valck en Petrus Schenk, [circa 1700]"},
{"label":"Form","value":"copper engraving, in outline colour ; 51,1 x 71 cm"},
{"label":"Shelfmark","value":"COLLBN Port 189 N 1"},
]
So "label" "value" in each object.
I cannot guarantee the order of these objects.
I must loop over them and test each to see what it is. So, I will run one loop testing for Title and create a new OpenRefine column based on that. Another testing for Subjects, and so on.
Not sure how to do this.
More, this is an issue:
{"label":"Language","value":{"@value":"Latin","@language":"eng"}},
I need to get at the value "Latin" in this object, which appears to be an object within an object.
Anyway, I am searching for recipes in this regard.
I'm starting with Owen Stephens' example:
filter(forEach(value.parseJson()["categories"],v,v.toLowercase()),w,w=="chinese").uniques().join("")
So something like?
filter(forEach(value.parseJson()[NumberOfObjectsHere],v,v.toLowercase()),w,w=="If Label Equals 'Title'").uniques().join("")
How's that for pseudo-code! Advice appreciated.
OpenRefine Newby,
Mark