I'm relatively new to OpenRefine, and I have been attempting to parse the information "Vernacular name" in these type of files, which are repeated multiple times:
{"apiVersion":"0.1","lastUpdatedDate":"2017-03-07","results":[{"searchedTerm":"Acer negundo","numMatches":1,"matches":[{"taxonID":9206,"scientificName":"Acer negundo Linnaeus","scientificNameAuthorship":"Linnaeus","canonicalName":"Acer negundo","taxonRank":"species","taxonomicAssertions":[{"acceptedNameUsage":"Acer negundo Linnaeus","acceptedNameUsageID":9206,"nameAccordingTo":"FNA Editorial Committee. in prep. Flora of North America north of Mexico. Volume 13. Magnoliophyta: Geraniaceae to Apiaceae. Oxford University Press, New York.","nameAccordingToID":"","taxonomicStatus":"accepted","parentNameUsageID":769,"higherClassification":"Equisetopsida;Magnoliidae;Rosanae;Sapindales;Sapindaceae;Hippocastanoideae;Acereae;Acer"}],"vernacularNames":[{"vernacularName":"érable à Giguère","language":"fr","source":"Darbyshire S.J., M. Favreau & M. Murray (revu et augmenté par). 2000. Noms populaires et scientifiques des plantes nuisibles du Canada. Agriculture et Agroalimentaire Canada. Publication 1397. 132 pp.","preferredName":true},{"vernacularName":"Manitoba maple","language":"en","source":"Farrar, J.L. 1996. Les Arbres du Canada. Fides et Service canadien des forêts. 502 pp.","preferredName":true},{"vernacularName":"ash-leaved maple","language":"en","source":"Farrar, J.L. 1996. Les Arbres du Canada. Fides et Service canadien des forêts. 502 pp.","preferredName":false},{"vernacularName":"aulne-buis","language":"fr","source":"Louis-Marie, P. 1953. Flore-Manuel de la province de Québec. 2ième éd. Institut agricole d'Oka. 323 pp.","preferredName":false},{"vernacularName":"box-elder","language":"en","source":"Farrar, J.L. 1996. Les Arbres du Canada. Fides et Service canadien des forêts. 502 pp.","preferredName":false},{"vernacularName":"box-elder maple","language":"en","source":"ITIS. 2010. Integrated Taxonomic Information System (ITIS). http://www.itis.gov (consulted 2010)","preferredName":false},{"vernacularName":"California box-elder","language":"en","source":"ITIS. 2010. Integrated Taxonomic Information System (ITIS). http://www.itis.gov (consulted 2010)","preferredName":false},{"vernacularName":"érable à feuilles composées","language":"fr","source":"Farrar, J.L. 1996. Les Arbres du Canada. Fides et Service canadien des forêts. 502 pp.","preferredName":false},{"vernacularName":"érable à feuilles de Frêne","language":"fr","source":"Louis-Marie, P. 1953. Flore-Manuel de la province de Québec. 2ième éd. Institut agricole d'Oka. 323 pp.","preferredName":false},{"vernacularName":"érable argilière","language":"fr","source":"Marie-Victorin, Fr. 1995. Flore laurentienne. 3e éd. Mise à jour et annotée par L. Brouillet, S.G. Hay, I. Goulet, M. Blondeau, J. Cayouette et J. Labrecque. Gaétan Morin éditeur. 1093 pp.","preferredName":false},{"vernacularName":"érable négondo","language":"fr","source":"Marie-Victorin, Fr. 1995. Flore laurentienne. 3e éd. Mise à jour et annotée par L. Brouillet, S.G. Hay, I. Goulet, M. Blondeau, J. Cayouette et J. Labrecque. Gaétan Morin éditeur. 1093 pp.","preferredName":false},{"vernacularName":"érable négundo","language":"fr","source":"Grandtner, M.M. 2005. Elsevier's Dictionnary of Trees. Volume 1. North America. Elsevier, Amsterdam. 1493 pp.","preferredName":false},{"vernacularName":"plaine à Giguère","language":"fr","source":"Louis-Marie, P. 1953. Flore-Manuel de la province de Québec. 2ième éd. Institut agricole d'Oka. 323 pp.","preferredName":false},{"vernacularName":"three-leaved maple","language":"en","source":"ITIS. 2010. Integrated Taxonomic Information System (ITIS). http://www.itis.gov (consulted 2010)","preferredName":false},{"vernacularName":"western box-elder","language":"en","source":"ITIS. 2010. Integrated Taxonomic Information System (ITIS). http://www.itis.gov (consulted 2010)","preferredName":false}],"distribution":[{"locationID":"ISO 3166-2:CA-AB","locality":"AB","establishmentMeans":"native","occurrenceStatus":"native"},{"locationID":"ISO 3166-2:CA-MB","locality":"MB","establishmentMeans":"native","occurrenceStatus":"native"},{"locationID":"ISO 3166-2:CA-NT","locality":"NT","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-NS","locality":"NS","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-YT","locality":"YT","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-QC","locality":"QC","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-ON","locality":"ON","establishmentMeans":"native","occurrenceStatus":"native"},{"locationID":"ISO 3166-2:CA-BC","locality":"BC","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-SK","locality":"SK","establishmentMeans":"native","occurrenceStatus":"native"},{"locationID":"ISO 3166-2:CA-PE","locality":"PE","establishmentMeans":"introduced","occurrenceStatus":"introduced"},{"locationID":"ISO 3166-2:CA-NB","locality":"NB","establishmentMeans":"introduced","occurrenceStatus":"introduced"}]}]}]}
I can retrieve all the vernacular names with the following expression: forEach(value.parseJson().results[0].matchs[0].vernacularNames,v,v.vernacularName).join(", ")
However, would it be possible to retrieve only the vernacularName who have the key "preferredName":true? Would it also be able to retrieve only the english(en) names with preferredNames=true, or only the french (fr) names?
I think it's with an IF expression or somesort of filter, but I'm not sure how it should be speficied with this JSON structured file.