Skip to content

Commit

Permalink
reformat the headers
Browse files Browse the repository at this point in the history
  • Loading branch information
laijasmine committed Sep 7, 2021
1 parent 3f30b0d commit 971da05
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion training/02_creating_a_data_package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ If you are curious how everything magically works, here is a handy diagram:
```{r, child = '../workflows/edit_data_packages/01_datapack_background.Rmd'}
```

### Exercise 2a {.exercise}
## Exercise 2a {.exercise}

Select a dataset from the catalog on arcticdata.io and checkout the number of files and provenance relationships in the dataset.

Expand Down
25 changes: 16 additions & 9 deletions workflows/edit_data_packages/01_datapack_background.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ library(datapack)
library(uuid)
```

### Data packages
**Data packages**

Data packages are a class that has slots for `relations` (provenance), `objects`(the metadata and data file(s)) and `systemMetadata`.

### Navigating data packages

#### Nodes
**Nodes**

Using this example on arcticdata.io
```{r, eval = F}
d1c_test <- dataone::D1Client("STAGING", "urn:node:mnTestARCTIC")
Expand All @@ -35,8 +36,7 @@ Get an existing package from the Arctic Data Center
dp <- dataone::getDataPackage(d1c, "resource_map_urn:uuid:1f9eee7e-2d03-43c4-ad7f-f300e013ab28")
```


#### Data
### Data Objects
Check out the `objects` slot
```{r, eval=F}
dp@objects
Expand All @@ -47,21 +47,28 @@ Get the number for data and metadata files associated with this data package:
getSize(dp@objects)
```

#### Provenance
View the provenance as a dataTable. We will get into detail in the Building provenance chapter.
Get the file names and corresponding pids
```{r, eval=F}
dp@relations$relations
getValue(dp, name="sysmeta@fileName")
```

##### Get identifiers
**Get identifiers**

You can search by any of the `sysmeta` slots such as `fileName` and `formatId` and get the corresponding identifier(s):
```{r, eval = F}
metadataId <- selectMember(dp, name="sysmeta@ADD THE NAME OF THE SLOT", value="PATTERN TO SEARCH BY")
```

For example:
**Example:**
```{r, eval = F}
selectMember(dp, name="sysmeta@formatId", value="image/tiff")
selectMember(dp, name="sysmeta@fileName", value="filename.csv")
```


### Provenance

View the provenance as a dataTable. We will get into detail in the Building provenance chapter.
```{r, eval=F}
dp@relations$relations
```

0 comments on commit 971da05

Please sign in to comment.