Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 28 additions & 50 deletions data/b3data_package/datapackage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "b3data",
"id": "https://doi.org/10.5281/zenodo.15181097",
"id": "https://doi.org/10.5281/zenodo.15181098",
"version": "0.1.0",
"resources": [
{
"name": "bird_cube_belgium_mgrs10",
Expand All @@ -11,28 +12,32 @@
"encoding": "utf-8",
"title": "Occurrence cube for birds in Belgium (MGRS 10 km)",
"description": "Occurrence cube for birds in Belgium between 2000 en 2024. The taxonomical resolution is 'species' and the temporal resolution is 'year' Spatial aggregation is done using the MGRS grid at 10 km scale. Only grid cells that fall within the 10 km MGRS reference grid for mainland Belgium (see b3data: `mgrs10_refgrid_belgium.geojson`) are included.",
"sources": {
"title": "GBIF Occurrence Download",
"path": "https://doi.org/10.15468/dl.y3wpwk"
},
"licenses": {
"name": "CC BY-NC 4.0",
"path": "https://creativecommons.org/licenses/by-nc/4.0/",
"title": "Creative Commons Attribution-NonCommercial 4.0 International"
},
"sources": [
{
"title": "GBIF Occurrence Download",
"path": "https://doi.org/10.15468/dl.y3wpwk"
}
],
"licenses": [
{
"name": "CC-BY-NC-4.0",
"path": "https://creativecommons.org/licenses/by-nc/4.0/",
"title": "Creative Commons Attribution-NonCommercial 4.0 International"
}
],
"schema": {
"fields": [
{
"name": "year",
"type": "number"
"type": "integer"
},
{
"name": "mgrscode",
"type": "string"
},
{
"name": "specieskey",
"type": "number"
"type": "integer"
},
{
"name": "species",
Expand All @@ -44,59 +49,32 @@
},
{
"name": "n",
"type": "number"
"type": "integer"
},
{
"name": "mincoordinateuncertaintyinmeters",
"type": "number"
},
{
"name": "familycount",
"type": "number"
"type": "integer"
}
]
}
},
{
"name": "mgrs10_refgrid_belgium",
"path": "mgrs10_refgrid_belgium.geojson",
"profile": "spatial-data-resource",
"format": "geojson",
"title": "MGRS 10 Km reference grid Belgium",
"description": "MGRS 10 Km reference grid for the mainland of Belgium.",
"licenses": {
"name": "CC0 1.0",
"path": "https://creativecommons.org/publicdomain/zero/1.0/",
"title": "Creative Commons Zero v1.0 Universal"
}
}
],
"title": "b3data: Data resources for the b3verse",
"description": "This data package contains data resources to be used across the b3verse (https://docs.b-cubed.eu/guides/b3verse/). This includes example datasets (occurrence cubes) as well as spatial resources like reference grids or raster data.",
"keywords": ["data cubes", "b3verse", "frictionless", "biodiversity"],
"licenses": {
"name": "CC BY-NC 4.0",
"path": "https://creativecommons.org/licenses/by-nc/4.0/",
"title": "Creative Commons Attribution-NonCommercial 4.0 International"
},
"version": "0.1.0",
"sources": {
"title": "b3data-scripts",
"path": "https://github.com/b-cubed-eu/b3data-scripts"
},
"contributors": [
{
"title": "Ward Langeraert",
"path": "https://orcid.org/0000-0002-5900-8109",
"email": "ward.langeraert@inbo.be",
"role": "author",
"organization": "Research Institute for Nature and Forest (INBO)"
},
{
"title": "Toon Van Daele",
"path": "https://orcid.org/0000-0002-1362-853X",
"role": "contributor",
"organization": "Research Institute for Nature and Forest (INBO)"
"title": "MGRS 10 km reference grid Belgium",
"description": "MGRS 10 km reference grid for the mainland of Belgium.",
"licenses": [
{
"name": "CC0-1.0",
"path": "https://creativecommons.org/publicdomain/zero/1.0/",
"title": "Creative Commons Zero v1.0 Universal"
}
]
}
]
}
14 changes: 6 additions & 8 deletions source/add_spatial_resources.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ Example:

Each dataset includes the following metadata (see: [Frictionless resource spec](https://docs.ropensci.org/frictionless/articles/data-resource.html#properties-implementation)):

- **profile**: `spatial-data-resource`
- **format**: e.g. `geojson`
- **title**: e.g. `"MGRS 10 km reference grid for Belgium"`
- **description**: concise explanation of content
- **sources**: source if applicable
- **licenses**: [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)

# Datasets
## MGRS 10 Km reference grid Belgium
## MGRS 10 km reference grid Belgium

Load the data.

Expand Down Expand Up @@ -103,15 +102,14 @@ b3data_package <- read_package(file.path(package_path, "datapackage.json"))
mgrs10_resource <- list(
name = "mgrs10_refgrid_belgium",
path = "mgrs10_refgrid_belgium.geojson",
profile = "spatial-data-resource",
format = "geojson",
title = "MGRS 10 Km reference grid Belgium",
description = "MGRS 10 Km reference grid for the mainland of Belgium.",
licenses = list(
name = "CC0 1.0",
title = "MGRS 10 km reference grid Belgium",
description = "MGRS 10 km reference grid for the mainland of Belgium.",
licenses = list(list(
name = "CC0-1.0",
path = "https://creativecommons.org/publicdomain/zero/1.0/",
title = "Creative Commons Zero v1.0 Universal"
)
))
)

b3data_package <- add_manual_resource(
Expand Down
80 changes: 13 additions & 67 deletions source/create_b3data_package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,12 @@ Each dataset includes the following metadata (see: [Frictionless resource spec](

## Package-level Metadata

Metadata for the entire data package (see: [Frictionless Data Package spec](https://specs.frictionlessdata.io/data-package/#metadata)):
Metadata for the entire data package (see: [Frictionless Data Package spec](https://specs.frictionlessdata.io/data-package/#metadata)).
This will be rather limited to avoid repetition with metadata of Zenodo deposit:

- **name**: `b3data`
- **id**: reserved Zenodo DOI
- **title**: `b3data: Data resources for the b3verse`
- **description**: overview of purpose, content, and structure of the data package
- **keywords**: e.g. `"biodiversity", "data cube", "b3verse", "GBIF", "frictionless"`
- **licenses**: [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)
- **id**: reserved Zenodo DOI (version specific)
- **version**: semantic versioning string, e.g. 0.1.0
- **sources**: GitHub repository [b3data-scripts](https://github.com/b-cubed-eu/b3data-scripts)
- **contributors**: name, ORCID, and roles

# Datasets
## Birds in Belgium (MGRS 10 km)
Expand Down Expand Up @@ -152,7 +147,9 @@ ggplot() + geom_sf(data = utm10_bel)
```{r}
# Only select grid cells from reference grid
bird_cube_belgium_mgrs10 <- bird_cube_belgium_mgrs10_full %>%
filter(substring(mgrscode, 4) %in% utm10_bel$TAG)
filter(substring(mgrscode, 4) %in% utm10_bel$TAG) %>%
# Transform columns to integers
mutate(across(c("year", "specieskey", "n", "familycount"), as.integer))
```

We create the package and add the dataset.
Expand All @@ -171,15 +168,15 @@ b3data_package <- create_package() %>%
"Only grid cells that fall within the 10 km MGRS reference grid for",
"mainland Belgium (see b3data: `mgrs10_refgrid_belgium.geojson`) are",
"included."),
sources = list(
sources = list(list(
title = "GBIF Occurrence Download",
path = "https://doi.org/10.15468/dl.y3wpwk"
),
licenses = list(
name = "CC BY-NC 4.0",
)),
licenses = list(list(
name = "CC-BY-NC-4.0",
path = "https://creativecommons.org/licenses/by-nc/4.0/",
title = "Creative Commons Attribution-NonCommercial 4.0 International"
)
))
)
```

Expand All @@ -196,62 +193,11 @@ b3data_package <- append(b3data_package,
c(name = "b3data"),
after = 0)
b3data_package <- append(b3data_package,
c(id = "https://doi.org/10.5281/zenodo.15181097"),
c(id = "https://doi.org/10.5281/zenodo.15181098"),
after = 1)
b3data_package <- append(b3data_package,
c(title = "b3data: Data resources for the b3verse"),
after = 3)
b3data_package <- append(
b3data_package,
c(description = paste(
"This data package contains data resources to be used across the b3verse",
"(https://docs.b-cubed.eu/guides/b3verse/).",
"This includes example datasets (occurrence cubes) as well as spatial",
"resources like reference grids or raster data."
)),
after = 4)
b3data_package <- append(
b3data_package,
c(keywords = list(list(
"data cubes", "b3verse", "frictionless", "biodiversity"
))),
after = 5)
b3data_package <- append(
b3data_package,
c(licenses = list(list(
name = "CC BY-NC 4.0",
path = "https://creativecommons.org/licenses/by-nc/4.0/",
title = "Creative Commons Attribution-NonCommercial 4.0 International"
))),
after = 6)
b3data_package <- append(b3data_package,
c(version = "0.1.0"),
after = 7)
b3data_package <- append(
b3data_package,
c(sources = list(list(
title = "b3data-scripts",
path = "https://github.com/b-cubed-eu/b3data-scripts"
))),
after = 8)
b3data_package <- append(
b3data_package,
c(contributors = list(list(
list(
title = "Ward Langeraert",
path = "https://orcid.org/0000-0002-5900-8109",
email = "ward.langeraert@inbo.be",
role = "author",
organization = "Research Institute for Nature and Forest (INBO)"
),
list(
title = "Toon Van Daele",
path = "https://orcid.org/0000-0002-1362-853X",
role = "contributor",
organization = "Research Institute for Nature and Forest (INBO)"
)
))),
after = 9)
after = 2)

# Warning: append() drops the custom datapackage class.
# It can be added again by running b3data_package through create_package()
Expand Down