From 43d80e05210776ef193241ae20535c21c519ab98 Mon Sep 17 00:00:00 2001 From: eblondel Date: Mon, 13 Jan 2025 10:55:31 +0100 Subject: [PATCH] support #404 --- inst/actions/geometa_create_iso_19115.R | 8 ++++++++ inst/actions/geometa_create_iso_19115.yml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/inst/actions/geometa_create_iso_19115.R b/inst/actions/geometa_create_iso_19115.R index d39207d5..32a77b53 100644 --- a/inst/actions/geometa_create_iso_19115.R +++ b/inst/actions/geometa_create_iso_19115.R @@ -22,6 +22,7 @@ function(action, entity, config){ include_service_identification <- action$getOption("include_service_identification") include_coverage_data_dimension_values <- action$getOption("include_coverage_data_dimension_values") include_coverage_service_dimension_values <- action$getOption("include_coverage_service_dimension_values") + include_online_resource_ids = action$getOption("include_online_resource_ids") #check inspire metadata validator configuration INSPIRE_VALIDATOR <- NULL @@ -778,6 +779,7 @@ function(action, entity, config){ doi_or$setName("DOI") doi_or$setDescription("Digital Object Identifier") doi_or$setProtocol("WWW:LINK-1.0-http--link") + if(include_online_resource_ids) doi_or$setAttr("id", the_doi) dto$addOnlineResource(doi_or) } @@ -840,6 +842,12 @@ function(action, entity, config){ "WWW:LINK-1.0-http--link" ) or$setProtocol(protocol) + + if(include_online_resource_ids) if(any(sapply(c("wms", "wfs", "wcs","download"), function(x){startsWith(http_relation$key, x)}))) { + resource_id = paste(tolower(entity$identifiers[["id"]]), http_relation$key, tolower(http_relation$name),sep="_") + or$setAttr("id", resource_id) + } + dto$onLine = c(dto$onLine,or) } } diff --git a/inst/actions/geometa_create_iso_19115.yml b/inst/actions/geometa_create_iso_19115.yml index 195002d4..d008215c 100644 --- a/inst/actions/geometa_create_iso_19115.yml +++ b/inst/actions/geometa_create_iso_19115.yml @@ -70,3 +70,7 @@ available_options: def: Include ogc dimensions's range values to coverage description class: logical default: false + include_online_resource_ids: + def: Include online resource IDs (Applies only to DOIs, OGC services and download resources) + class: logical + default: false