-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an own command for metadata listing #12
Comments
There would the possibility to make an rirods S3 class and to extend the generic |
this was observed and noted during trirods dec 2022 as well. a custom/extended |
I think a good option or inspiration source is tidyverse nested tibbles. This can already be implemented by using library(rirods)
library(tibble)
create_irods("http://localhost/irods-rest/0.9.3", "/tempZone/home", overwrite = TRUE)
iauth('rods', 'rods')
files <- ils(metadata = TRUE)
files
#> logical_path metadata type
#> 1 /tempZone/home/rods/collection attr1, attr2, val1, val2, unit1, collection
#> 2 /tempZone/home/rods/foo.rds foo, bar, baz data_object
files$metadata
#> [[1]]
#> attribute value units
#> 1 attr1 val1 unit1
#> 2 attr2 val2
#>
#> [[2]]
#> attribute value units
#> 1 foo bar baz
files$metadata <- Map(as_tibble, files$metadata)
as_tibble(files)
#> # A tibble: 2 × 3
#> logical_path metadata type
#> <chr> <list> <chr>
#> 1 /tempZone/home/rods/collection <tibble [2 × 3]> collection
#> 2 /tempZone/home/rods/foo.rds <tibble [1 × 3]> data_object
files$metadata
#> [[1]]
#> # A tibble: 2 × 3
#> attribute value units
#> <chr> <chr> <chr>
#> 1 attr1 val1 "unit1"
#> 2 attr2 val2 ""
#>
#> [[2]]
#> # A tibble: 1 × 3
#> attribute value units
#> <chr> <chr> <chr>
#> 1 foo bar baz
files[1, 'metadata']
#> [[1]]
#> # A tibble: 2 × 3
#> attribute value units
#> <chr> <chr> <chr>
#> 1 attr1 val1 "unit1"
#> 2 attr2 val2 "" Created on 2023-03-17 with reprex v2.0.2 One weird thing is how the character values are printed when one of the values in the column is empty (e.g. "units" in this example). The It might be worth looking into how tibble renders this printing (at least the summary of the nested dataframe/tibble) and imitate it, if using |
If a data object or collection carries some more metadata items, the
ils
command output becomes a bit too cluttered.The text was updated successfully, but these errors were encountered: