Skip to content

Commit db21dc5

Browse files
committed
fix #423
1 parent ad0975c commit db21dc5

5 files changed

Lines changed: 53 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: geoflow
2-
Version: 1.0.0.9002
3-
Date: 2025-10-28
2+
Version: 1.0.0.9003
3+
Date: 2025-10-31
44
Title: Orchestrate Geospatial (Meta)Data Management Workflows and Manage FAIR Services
55
Description: An engine to facilitate the orchestration and execution of metadata-driven data management workflows, in compliance with 'FAIR'
66
(Findable, Accessible, Interoperable and Reusable) data management principles. By means of a pivot metadata model, relying on the 'DublinCore' standard (<https://dublincore.org/>),

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
**Enhancements**
1212

13+
* [#423](https://github.com/r-geoflow/geoflow/issues/423) Capacity to update relations auto-set by geoflow with `enrichWithRelations`
14+
1315
_nothing yet_
1416

1517
**New features**

R/geoflow_entity.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,11 @@ geoflow_entity <- R6Class("geoflow_entity",
16371637
#'@param config geoflow config object
16381638
enrichWithRelations = function(config){
16391639

1640+
#check for geoflow auto-set relations, if any we remove them to avoid duplicating auto-set relations
1641+
if(any(sapply(self$relations, function(x){x$prov == "geoflow"}))){
1642+
self$relations = self$relations[sapply(self$relations, function(x){x$prov != "geoflow"})]
1643+
}
1644+
16401645
geosapi_action <- NULL
16411646
actions <- list()
16421647
if(length(config$actions)>0) actions <- config$actions[sapply(config$actions, function(x){regexpr("geosapi",x$id)>0})]
@@ -1667,6 +1672,7 @@ geoflow_entity <- R6Class("geoflow_entity",
16671672
if(geosapi_action$getOption("enrich_with_relation_wms_thumbnail")){
16681673
config$logger$INFO("Enrich entity with OGC WMS thumbnail for layer = '%s'", layername)
16691674
new_thumbnail <- geoflow_relation$new()
1675+
new_thumbnail$setProv("geoflow")
16701676
new_thumbnail$setKey("thumbnail")
16711677
new_thumbnail$setName(layername)
16721678
map_overview = set_i18n(term_key = "graphic_overview", expr = "{{layername}} - {{term}}", layername = layername)
@@ -1693,6 +1699,7 @@ geoflow_entity <- R6Class("geoflow_entity",
16931699
if(geosapi_action$getOption("enrich_with_relation_wms")){
16941700
config$logger$INFO("Enrich entity with OGC WMS base URL for layer = '%s'", layername)
16951701
new_wms <- geoflow_relation$new()
1702+
new_wms$setProv("geoflow")
16961703
new_wms$setKey("wms")
16971704
new_wms$setName(layername)
16981705
new_wms$setDescription(
@@ -1717,6 +1724,7 @@ geoflow_entity <- R6Class("geoflow_entity",
17171724
if(geosapi_action$getOption("enrich_with_relation_wfs")){
17181725
config$logger$INFO("Enrich entity with OGC WFS base URL for layer = '%s'", layername)
17191726
new_wfs <- geoflow_relation$new()
1727+
new_wfs$setProv("geoflow")
17201728
new_wfs$setKey("wfs")
17211729
new_wfs$setName(layername)
17221730
new_wfs$setDescription(
@@ -1739,6 +1747,7 @@ geoflow_entity <- R6Class("geoflow_entity",
17391747
config$logger$INFO("Enrich entity with OGC WFS download links for layer = '%s'", layername)
17401748
#wfs (GML)
17411749
new_wfs_gml <- geoflow_relation$new()
1750+
new_wfs_gml$setProv("geoflow")
17421751
new_wfs_gml$setKey("download")
17431752
new_wfs_gml$setName(layername)
17441753
new_wfs_gml$setDescription(
@@ -1757,6 +1766,7 @@ geoflow_entity <- R6Class("geoflow_entity",
17571766
self$addRelation(new_wfs_gml)
17581767
#wfs (GeoJSON)
17591768
new_wfs_geojson <- geoflow_relation$new()
1769+
new_wfs_geojson$setProv("geoflow")
17601770
new_wfs_geojson$setKey("download")
17611771
new_wfs_geojson$setName(layername)
17621772
new_wfs_geojson$setDescription(
@@ -1775,6 +1785,7 @@ geoflow_entity <- R6Class("geoflow_entity",
17751785
self$addRelation(new_wfs_geojson)
17761786
#wfs (ESRI Shapefile)
17771787
new_wfs_shp <- geoflow_relation$new()
1788+
new_wfs_shp$setProv("geoflow")
17781789
new_wfs_shp$setKey("download")
17791790
new_wfs_shp$setName(layername)
17801791
new_wfs_shp$setDescription(
@@ -1793,6 +1804,7 @@ geoflow_entity <- R6Class("geoflow_entity",
17931804
self$addRelation(new_wfs_shp)
17941805
#CSV
17951806
new_wfs_csv <- geoflow_relation$new()
1807+
new_wfs_csv$setProv("geoflow")
17961808
new_wfs_csv$setKey("download")
17971809
new_wfs_csv$setName(layername)
17981810
new_wfs_csv$setDescription(
@@ -1819,6 +1831,7 @@ geoflow_entity <- R6Class("geoflow_entity",
18191831
if(geosapi_action$getOption("enrich_with_relation_wcs")){
18201832
config$logger$INFO("Enrich entity with OGC WCS base URL for layer = '%s'", layername)
18211833
new_wcs <- geoflow_relation$new()
1834+
new_wcs$setProv("geoflow")
18221835
new_wcs$setKey("wcs")
18231836
new_wcs$setName(layername)
18241837
new_wcs$setDescription(
@@ -1842,6 +1855,7 @@ geoflow_entity <- R6Class("geoflow_entity",
18421855
config$logger$INFO("Enrich entity with OGC WCS download links for layer = '%s'", layername)
18431856
#wcs (image/geotiff)
18441857
new_wcs_geotiff <- geoflow_relation$new()
1858+
new_wcs_geotiff$setProv("geoflow")
18451859
new_wcs_geotiff$setKey("download")
18461860
new_wcs_geotiff$setName(layername)
18471861
new_wcs_geotiff$setDescription(
@@ -1883,6 +1897,7 @@ geoflow_entity <- R6Class("geoflow_entity",
18831897
geonetwork_base_url = config$software$output$geonetwork_config$parameters$url
18841898
#xml metadata url
18851899
metadata_url <- geoflow_relation$new()
1900+
metadata_url$setProv("geoflow")
18861901
metadata_url$setKey("http")
18871902
metadata_url$setName("ISO 19115 metadata (CSW GetRecordById)")
18881903
csw_record_url = paste0(
@@ -1896,6 +1911,7 @@ geoflow_entity <- R6Class("geoflow_entity",
18961911

18971912
#html metadata url
18981913
metadata_url_2 = geoflow_relation$new()
1914+
metadata_url_2$setProv("geoflow")
18991915
metadata_url_2$setKey("http")
19001916
metadata_url_2$setName("ISO 19115 metadata (HTML)")
19011917
html_record_url = paste0(geonetwork_base_url, "/srv/api/records/", mdId)
@@ -1911,6 +1927,7 @@ geoflow_entity <- R6Class("geoflow_entity",
19111927
csw_base_url = config$software$output$csw_config$parameters$url
19121928
#xml metadata url
19131929
metadata_url <- geoflow_relation$new()
1930+
metadata_url$setProv("geoflow")
19141931
metadata_url$setKey("http")
19151932
metadata_url$setName("ISO 19115 metadata (CSW GetRecordById)")
19161933
csw_record_url = paste0(
@@ -1927,6 +1944,7 @@ geoflow_entity <- R6Class("geoflow_entity",
19271944
if(regexpr("geonetwork", csw_base_url)>0){
19281945
geonetwork_base_url = unlist(strsplit(csw_base_url, "/srv"))[1]
19291946
metadata_url_2 = geoflow_relation$new()
1947+
metadata_url_2$setProv("geoflow")
19301948
metadata_url_2$setKey("http")
19311949
metadata_url_2$setName("ISO 19115 metadata (HTML)")
19321950
html_record_url = paste0(geonetwork_base_url, "/srv/api/records/", mdId)

R/geoflow_relation.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#' @examples
1515
#' \dontrun{
1616
#' relation <- geoflow_relation$new()
17+
#' relation$setProv("user")
1718
#' relation$setKey("wms")
1819
#' relation$setLink("http://somelink/wms")
1920
#' relation$setMimeType("application/xml")
@@ -35,6 +36,8 @@ geoflow_relation <- R6Class("geoflow_relation",
3536
name = NULL,
3637
#'@field description relation name
3738
description = NULL,
39+
#'@field prov provenance,
40+
prov = "user",
3841

3942
#'@description Initializes an object of class \link{geoflow_relation}
4043
#'@param str character string to initialize from using key-based syntax
@@ -90,6 +93,13 @@ geoflow_relation <- R6Class("geoflow_relation",
9093
#'@param description description
9194
setDescription = function(description){
9295
self$description <- description
96+
},
97+
98+
#'@description Set provenance
99+
#'@param prov provenance
100+
setProv = function(prov = c("user","geoflow")){
101+
prov = match.arg(prov)
102+
self$prov = prov
93103
}
94104
)
95105
)

man/geoflow_relation.Rd

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)