Last active
August 25, 2017 16:49
-
-
Save mmerce/34ca211afcf05d183c5b2a94bb01b6bc to your computer and use it in GitHub Desktop.
Unite datasets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Unite datasets", | |
"description": "Creating a dataset that contains the data in several datasets tagged with an identifier.", | |
"inputs": [ | |
{ | |
"name": "tag", | |
"type": "string", | |
"description": "tag identifier" | |
} | |
], | |
"outputs": [ | |
{ | |
"name": "union-dataset", | |
"type": "dataset-id", | |
"description": "Dataset containing the union of instances in all the datasets that share a tag." | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (unite-datasets tag) | |
(let (datasets (map (lambda (d) (d "resource")) (list-datasets {"tags__in" tag "reverse" true}))) | |
(update-and-wait (create-and-wait-dataset {"origin_datasets" datasets}) {"tags" []}))) | |
(define union-dataset (unite-datasets tag)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment