From 42642e7b13ad79bde76b6fefad825675dad9c61e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 31 Dec 2020 14:34:59 +0000 Subject: Add comment --- workflows/pull-data/genbank/sparql-fetch-ids | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workflows/pull-data/genbank/sparql-fetch-ids b/workflows/pull-data/genbank/sparql-fetch-ids index 683044c..d4743bd 100755 --- a/workflows/pull-data/genbank/sparql-fetch-ids +++ b/workflows/pull-data/genbank/sparql-fetch-ids @@ -30,6 +30,10 @@ def sparql q, transform = nil vars = data['head']['vars'] results = data['results']['bindings'] results.map { |rec| + # return results after transforming to a Hash and applying the + # optional transform lambda. Note the transform can not only + # reduce results, or create an array, but also may transform into + # an OpenStruct. res = {} vars.each { |name| res[name.to_sym] = rec[name]['value'] -- cgit v1.2.3