aboutsummaryrefslogtreecommitdiff
path: root/workflows/pull-data/genbank/sparql-fetch-ids
diff options
context:
space:
mode:
Diffstat (limited to 'workflows/pull-data/genbank/sparql-fetch-ids')
-rwxr-xr-xworkflows/pull-data/genbank/sparql-fetch-ids4
1 files changed, 4 insertions, 0 deletions
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']