Datasets
Use dataset
command to perform various dataset management operations.
USAGE:
metalo dataset command [command options] [arguments...]
COMMANDS:
upload upload dataset into MetaLocker
bulk-upload upload all datasets in the given folder into MetaLocker
supported-data-types list supported data types
share share data set
get get data set from MetaLocker
revoke revoke data set's lease
help, h Shows a list of commands or help for one command
Upload Dataset
Use the upload
command to upload a dataset into MetaLocker.
Options
--vault value Vault Name (default: local) (default: "local")
--locker value Locker ID. If not specified, the default one will be used
--prov value Provenance definition (JSON). If not specified, it will be auto-generated
--prov-mapping value Entity mapping for provenance template. Optional. Format: ent->value;ent-->value;...
--parent value Parent ledger record ID
--type value Defines semantic type of the provided data
--expiration value Lease duration (i.e. 10y, 1y6m, 12d, 1h30min, 30s, never) (default: "1y")
--wait If specified, wait until the data is published on the ledger (default: false)
Examples
# upload a dataset
METAPASS=<password> metalo --user <email> dataset upload --locker <locker-id> <path-to-folder-or-file>
# upload a dataset and wait until the lease record is available on the ledger
METAPASS=<password> metalo --user <email> dataset upload --locker <locker-id> --wait <path-to-folder-or-file>
Output
If successful, upload
command returns a comma-separated string in the format:
<record-id>:<impression-id>
Example:
G5CQxtYvr7rtRSzCtfyyLJVjBTvQubzJDRs1mrHTXyBt,8kmMBSTffnuJTkPatWo1SQGv6gCkw5qiBEUv2HNCWLa2
Bulk Upload Dataset
Use the bulk-upload
command to upload all datasets in the given folder into MetaLocker.
Options
--vault value Vault Name (default: local) (default: "local")
--locker value Locker ID. If not specified, the default one will be used
--prov value Provenance definition (JSON). If not specified, it will be auto-generated
--type value Defines semantic type of the provided data
--expiration value Lease duration (i.e. 10y, 1y6m, 12d, 1h30min, 30s, never) (default: "1y")
--wait If specified, wait until the data is published on the ledger (default: false)
Examples
# upload datasets
METAPASS=<password> metalo --user <email> dataset bulk-upload --locker <locker-id> <path-to-folder>
# upload datasets and wait until lease records are available on the ledger
METAPASS=<password> metalo --user <email> dataset bulk-upload --locker <locker-id> --wait <path-to-folder>
Output
If successful, bulk-upload
command returns a comma-separated list in the format:
<record-id>:<impression-id>
...
Example:
4YEumUQKs4PDCU7hwtqTVgsGfPCFmsAQcJhw1b3BvNYX,8JPVjGreRAGX52X9Hg1QEtoCZKrEpvccFkQ14bd6PdEN
E433GTGPHAr2cAKt8BZvZvRo3sJP6pofnmSZiLAPRGi4,AJiuPbUMMC9UctvmA9uD95TwCTbZqPNeLc4PWkKjWoJA
WXwuTjmdsqCCX4Rqy9NUfGrJQZpudA57AZgtH9k8ori,PdnBwUKNmFiBWvDesD1jiknmBK4C4DSuUnZd7CGbvcg
Get Dataset
Use the get
command to explore or download a dataset from MetaLocker.
Options
--dest value path to destination folder/file. Not required for graph data sets (will be printed out on the console)
--metadata save metadata artifacts into the folder (default: false)
--sync sync data wallet before reading the data set (default: false)
Examples
# print the dataset's meta resource
METAPASS=<password> metalo --user <email> dataset get <record-id>
# print the dataset's lease
METAPASS=<password> metalo --user <email> dataset get --metadata <record-id>
# save the dataset, including its lease, to a folder
METAPASS=<password> metalo --user <email> dataset get --metadata --dest <path-to-folder> <record-id>
Share Dataset
Use the share
command to share a dataset with another participant of one of your lockers.
Format
metalo dataset share [options] <record-id>
Options
--vault value Vault Name (default: local) (default: "local")
--locker value Locker ID. If not specified, the default one will be used
--expiration value Lease duration (i.e. 10y, 1y6m, 12d, 1h30min, 30s, never) (default: "1y")
--wait If specified, wait until the data is published on the ledger (default: false)
Examples
# share a dataset
METAPASS=<password> metalo --user <email> dataset share --locker <locker-id> <record-id>
# share a dataset and wait until the lease record is available on the ledger
METAPASS=<password> metalo --user <email> dataset share --locker <locker-id> --wait <record-id>
Output
If successful, share
command returns the share record’s ID:
Revoke Dataset’s Lease
Use the revoke
command to revoke dataset’s lease.
Options
--wait If specified, wait until the data is published on the ledger (default: false)
Examples
# print the dataset's meta resource
METAPASS=<password> metalo --user <email> dataset revoke <record-id>
# print the dataset's lease
METAPASS=<password> metalo --user <email> dataset revoke --wait <record-id>
List Supported Data Types
Use the supported-data-types
command to get a list of data types supported by the upload
command.
Example
metalo dataset supported-data-types
Sample Output
Directory
File
Graph