A cli for validating metadata, packaging ROCrates, and interacting with the FAIRSCAPE API
Project description
fairscape-cli
Data Validation and Packaging utility for sending evidence graphs to FAIRSCAPE
Functional Description
The fairscape-cli tool is used for client side remote teams to validate and assemble metadata. This tool is a command line interface for use in a command prompt or bash scripts. It will be used to construct RO crates with full providence preserved in the EVI ontology, and then transfer them into the fairscape ecosystem. This requires reserving identifiers, and authenticating against fairscape.
All installation requires is python 3 and using pip to install. An additional dependancy is sqlite as the tool will maintain a local cached record of all metadata records and RO crates assembled.
User interface
Validation
# take any class or list of objects
# and validate against pydantic
fairscape validate json ./path_to_json.json
Validating Individual Classes
fairscape validate dataset ./tests/data/dataset.json
fairscape validate software ./tests/data/software.json
fairscape validate computation ./tests/data/computation.json
ROCrate
# create a new ROcrate
fairscape rocrate create \
--id "ark:5982/UVA/b2ai/examplecrate" \
--name "b2ai example rocrate" \
--organization "ark:5982/UVA" \
--project "ark:5982/UVA/b2ai" \
--path "./tests/example_rocrate"
Adding Contents
fairscape rocrate add dataset \
--crateid "ark:5982/UVA/b2ai/examplecrate" \
--id "ark:5982/UVA/b2ai/examplecrate/test-dataset" \
--name "MuSIC software" \
--source <PATH>
fairscape rocrate add software \
--crateid "ark:5982/UVA/b2ai/examplecrate" \
--id "ark:5982/UVA/b2ai/examplecrate/MuSIC" \
--name "MuSIC software" \
--source "https://github.com/idekerlab/MuSIC"
fairscape rocrate add computation \
--crateid "ark:5982/UVA/b2ai/examplecrate" \
--id "ark:5982/UVA/b2ai/examplecrate/test-computation" \
--name "b2ai computation" \
--usedSoftware "ark:5982/UVA/b2ai/examplecrate/MuSIC" \
--usedDataset "ark:5982/UVA/b2ai/examplecrate/test-dataset" \
--generated "ark:5982/UVA/b2ai/examplecrate/test-results"
fairscape rocrate dumpmetadata
fairscape rocrate hash --id <CRATEID>
# creating gzipped output of full ROcrate with metadata
fairscape rocrate package --output-path ./
# list ROcrates
fairscape list ROcrate
fairscape describe ROcrate --id --name
# describe identifier metadata
fairscape describe --id "ark:5982/UVA/b2ai"
fairscape describe --name "b2ai computation"
Improving UX by removing arguments from previous commands
fairscape rocrate create ... --path ./myrocrate
cd myrocrate
# there is a hidden file created
# ./myrocrate/.metadata.sqlite
# it could be on another path
# has metadata on the following
# - organization
# - project
# - author
fairscape add dataset ... --path /mnt/results/mytestfile.csv
# fairscape has every parameter required to auto generate identifiers
# ark:5982/<ORGANIZATION>/<PROJECT>/<ROCRATE>/postfix
fairscape setcontext crateid --id <CRATEID>
fairscape rocrate add compution/dataset/software/etc...
Design Considerations
Dealing with Remote Content
remote paths examples
- github domain
- S3
- s3://example-bucket/path/to/object
http(s)://<bucket>.s3.amazonaws.com/<object>
- http(s)://s3.amazonaws.com//
-
Local File URI
-
identifier
- Zenodo DOI
- external filesystems
- RIVANNA project storage smb://qumulo.rc.virginia.edu/
## Milestones - 02-23 - [ ] validate json command - [ ] pypi package for classes based on linkml description - 02-25 - [ ] validate software - [ ] validate dataset - [ ] validate computation - 02-27 - [ ] ROcrate create - [ ] ROcrate add software - [ ] ROcrate add dataset - [ ] ROcrate add computation - 02-28 - [ ] ROcrate hash - [ ] list ROcrate - [ ] describe ROcrate
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fairscape_cli-0.1.5a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f65b7ec13d7972e95a3bd2f9678804b3f439c79ed1782aa904d9dfe5f9e7663 |
|
MD5 | 19a9b762cf94549035e402e90a16f580 |
|
BLAKE2b-256 | 95b6e84b3a2d60f412f60652e424b895c779969e2768cf4a1cdc959491f1ded8 |