geoflow_entity: Geoflow entity class

geoflow_entityR Documentation

Geoflow entity class

Description

This class models a entity object

Format

R6Class object.

Details

geoflow_entity

Value

Object of R6Class for modelling a entity object

Public fields

identifiers

entity identifiers

dates

entity dates

language

entity language

types

entity types

titles

entity titles

descriptions

entity descriptions

subjects

entity subjects

formats

entity formats

contacts

entity contacts

relations

entity relations

rights

entity rights

spatial_extent

spatial extent

spatial_bbox

spatial bounding box

geo_bbox

geographic bounding box (in EPSG:4326 / WGS 84)

srid

entity srid

temporal_extent

entity temporal extent

provenance

entity provenance

data

entity data

status

entity status

resources

entity resources

locales

entity locales

Methods

Public methods


Method new()

Initializes an object of class geoflow_entity

Usage
geoflow_entity$new()

Method setShinyEditorMode()

Set mode for geoflow-shiny

Usage
geoflow_entity$setShinyEditorMode(mode = c("creation", "edition"))
Arguments
mode

mode


Method getShinyEditorMode()

Get mode for geoflow-shiny

Usage
geoflow_entity$getShinyEditorMode()
Returns

the shiny editor mode


Method getAllowedKeyValuesFor()

Retrieves keys allowed for a given tabular field name. eg. "Identifier"

Usage
geoflow_entity$getAllowedKeyValuesFor(field)
Arguments
field

field name

Returns

the list of valid keys for the field considered


Method addLocalesFromValues()

Adds locales to entity from kvp values

Usage
geoflow_entity$addLocalesFromValues(values)
Arguments
values

values


Method setIdentifier()

Set an identifier given a key. Default key is "id", but others can be specified, eg "doi".

Usage
geoflow_entity$setIdentifier(key = "id", id)
Arguments
key

identifier key. Default is "id"

id

identifier value


Method addDate()

Adds a date

Usage
geoflow_entity$addDate(dateType, date)
Arguments
dateType

date type, object of class character

date

date, object of class Date or POSIXt


Method setLanguage()

Set the language used for the entity description (metadata). Default is "eng".

Usage
geoflow_entity$setLanguage(language)
Arguments
language

language


Method writeDataResource()

writes a data resource. Deprecrated Note: TODO to review in line with 'writeWorkflowJobDataResource

Usage
geoflow_entity$writeDataResource(obj = NULL, resourcename, type = "shp")
Arguments
obj

object

resourcename

resource name

type

type of resosurce


Method setType()

Set the type of description. By default a generic type (key = "generic") is defined to "dataset", and will be used as default type for actions that perform metadata production / publication.

Usage
geoflow_entity$setType(key = "generic", type)
Arguments
key

type key. Default is "generic"

type

type value


Method setTitle()

Sets title

Usage
geoflow_entity$setTitle(key = "title", title)
Arguments
key

title key. Default is "title"

title

title value


Method setDescription()

Sets description

Usage
geoflow_entity$setDescription(key, description)
Arguments
key

description key. Default is "abstract"

description

description value


Method addSubject()

Adds a subject

Usage
geoflow_entity$addSubject(subject)
Arguments
subject

object of class geoflow_subject


Method addFormat()

Adds a format

Usage
geoflow_entity$addFormat(format)
Arguments
format

object of class geoflow_format


Method addContact()

Adds a contact

Usage
geoflow_entity$addContact(contact)
Arguments
contact

object of class geoflow_contact


Method addRelation()

Adds a relation

Usage
geoflow_entity$addRelation(relation)
Arguments
relation

object of class geoflow_relation


Method addRight()

Adds a right

Usage
geoflow_entity$addRight(right)
Arguments
right

object of class geoflow_right


Method setSpatialExtent()

Set spatial extent. Various ways can be used to set the spatial extent 1) with a WKT string, 2) with a bbox, object of class matrix, or 3) specifying a data object (from sf). The crs (coordinate reference system) should be specified with the crs SRID (number). The spatial extent is not necessarily a bounding box but can be one or more geometries.

Usage
geoflow_entity$setSpatialExtent(wkt = NULL, bbox = NULL, data = NULL, crs = NA)
Arguments
wkt

a WKT string

bbox

a bbox

data

an object of class sf

crs

crs


Method setSpatialBbox()

Set spatial bbox. Various ways can be used to set the spatial extent 1) with a WKT string, 2) with a bbox, object of class matrix, or 3) specifying a data object (from sf). The crs (coordinate reference system) should be specified with the crs SRID (number).

Usage
geoflow_entity$setSpatialBbox(wkt = NULL, bbox = NULL, data = NULL, crs = NA)
Arguments
wkt

a WKT string

bbox

a bbox

data

an object of class sf

crs

crs


Method setGeographicBbox()

Set geographic bbox (in EPGS:4326 / WGS 84), by converting (if needed) the spatial bbox

Usage
geoflow_entity$setGeographicBbox()

Method setSrid()

Sets entity SRID

Usage
geoflow_entity$setSrid(srid)
Arguments
srid

srid


Method setTemporalExtent()

Sets temporal extent. The temporal extent can be a year, date instant or interval

Usage
geoflow_entity$setTemporalExtent(str)
Arguments
str

object of class numeric (case of year) or character


Method setProvenance()

Sets entity provenance

Usage
geoflow_entity$setProvenance(provenance)
Arguments
provenance

object of class geoflow_provenance


Method setData()

Sets entity data object

Usage
geoflow_entity$setData(data)
Arguments
data

object of class geoflow_data


Method addData()

Adds entity data object

Usage
geoflow_entity$addData(data)
Arguments
data

object of class geoflow_data


Method getEntityJobDirname()

Gets entity job directory name. In case entity is identified with a DOI, the '/' (slash) will be replaced by '_' (underscore) to make sure directory is created.

Usage
geoflow_entity$getEntityJobDirname()
Returns

get the name of entity job directory that will be created for the entity


Method getEntityJobDirPath()

Gets entity job directory path. In the job directory, all entities subdirs will be created within a 'entities' directory.

Usage
geoflow_entity$getEntityJobDirPath(config, jobdir = NULL)
Arguments
config

geoflow configuration object

jobdir

relative path of the job directory

Returns

the entity job directory path


Method prepareEntityJobDir()

Function called internally by geoflow that creates the entity directory and relevant sub-directories. The default sub-directories will include 'data' and 'metadata'. Other sub-directories may be created depnding on the actions enabled in the workflow (and if their target directory is different from 'data'/'metadata').

Usage
geoflow_entity$prepareEntityJobDir(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method copyDataToJobDir()

This function will look at data object(s) associated to the entity (previously set with setData or added with addData), and will try to (download)/copy the data source to the geoflow job directory.

Usage
geoflow_entity$copyDataToJobDir(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method copyStylesToJobDir()

This function checks for the availability of layer styles (set as entity resource) that would have been added with DBI handlers from a special DB 'layer_styles' table

Usage
geoflow_entity$copyStylesToJobDir(config)
Arguments
config

geoflow config object


Method enrichWithDatatypes()

Function that will scan zip data files and resolve data objects sourceType and uploadType

Usage
geoflow_entity$enrichWithDatatypes(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method enrichWithData()

This function will enrich the entity data objects with data features (vector data) or coverages (grid data). This method will overwrite spatial metadata such as the bounding box (unless global option skipDynamicBbox is enabled). Note that the user spatial extent is not overwriten since it may contain finer geometries than a bounding box.

Usage
geoflow_entity$enrichWithData(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method enrichSpatialCoverageFromDB()

This function computes spatial coverage from DB (table, view or query) without having to deal with a full data download. It is triggered when the global option skipDataDownload is enabled.

Usage
geoflow_entity$enrichSpatialCoverageFromDB(config)
Arguments
config

geoflow config object


Method enrichWithFeatures()

This function will enrich the entity data objects with data features (vector data). This method will overwrite spatial metadata such as the bounding box (unless global option skipDynamicBbox is enabled). Note that the user spatial extent is not overwriten since it may contain finer geometries than a bounding box.

Usage
geoflow_entity$enrichWithFeatures(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method enrichWithCoverages()

This function will enrich the entity data objects with data coverages (grid data). This method will overwrite spatial metadata such as the bounding box (unless global option skipDynamicBbox is enabled). Note that the user spatial extent is not overwriten since it may contain finer geometries than a bounding box.

Usage
geoflow_entity$enrichWithCoverages(config, jobdir = NULL)
Arguments
config

geoflow config object

jobdir

relative path of the job directory


Method prepareFeaturesToUpload()

This function will 1) check (in case of upload is requested) if the type of source and upload are both different on files formats(eg. csv,shp,gpkg) and 2) process automatically to conversion from source to upload type.

Usage
geoflow_entity$prepareFeaturesToUpload(config)
Arguments
config

geoflow config object


Method enrichWithIdentifiers()

Function that will enrich entity with identifiers needed across multiple actions

Usage
geoflow_entity$enrichWithIdentifiers(config)
Arguments
config

geoflow config object


Method enrichWithRelations()

This function that will enrich the entity with relations. At now this is essentially related to adding relations if a Geoserver (geosapi) publishing action is enabled. Relations added will depend on the enrich_with_relation_* options set in a) the geosapi action, ie. 1) add WMS auto-generated thumbnail (if option enrich_with_relation_wms_thumbnail is TRUE) 2) add WMS base URL relation (if option enrich_with_relation_wms is TRUE) 3) for vector spatial representation type: - add WFS base URL relation (if option enrich_with_relation_wfs is TRUE) - add WFS auto-generated links as convenience for data download links (if option enrich_with_relation_wfs_download_links is TRUE) 4) for grid spatial representation type: - add WCS base URL relation (if option enrich_with_relation_wcs is TRUE) b) in the geonapi action (for adding a CSW metadata URL) b) in the ows4R action (for adding a CSW metadata URL)

Usage
geoflow_entity$enrichWithRelations(config)
Arguments
config

geoflow config object


Method enrichWithSubjects()

Enrichs the entity with subjects. If no subject specify in Subjects, automatically add keyword from dictionary to 'theme' category

Usage
geoflow_entity$enrichWithSubjects(config, exclusions = c())
Arguments
config

geoflow config object

exclusions

exclusions


Method enrichWithVocabularies()

Enrichs the entity with vocabularies

Usage
geoflow_entity$enrichWithVocabularies(config)
Arguments
config

geoflow config object


Method enrichWithFormats()

Enrichs the entity with formats

Usage
geoflow_entity$enrichWithFormats(config)
Arguments
config

geoflow config object


Method enrichWithMetadata()

Enrichs the entity properties with entity metadata from other properties.

Usage
geoflow_entity$enrichWithMetadata(config)
Arguments
config

geoflow config object


Method getContacts()

Get the entity contacts

Usage
geoflow_entity$getContacts(pretty = FALSE)
Arguments
pretty

to prettify the output as data.frame

Returns

a list of geoflow_contact or a data.frame


Method getSubjects()

Get the entity subjects

Usage
geoflow_entity$getSubjects(pretty = FALSE, keywords = FALSE)
Arguments
pretty

to prettify the output as data.frame

keywords

to add keywords to the output or not. Default is FALSE

Returns

a list of geoflow_subject or a data.frame


Method getRelations()

Get the entity relations

Usage
geoflow_entity$getRelations(pretty = FALSE)
Arguments
pretty

to prettify the output as data.frame

Returns

a list of geoflow_relation or a data.frame


Method setStatus()

Set a simple status either "draft" or "published". This method is required to deal with systems that manage DOIs, such as Zenodo (with zen4R) or Dataverse (with atom4R) publishing actions (Used internally by geoflow).

Usage
geoflow_entity$setStatus(system, status)
Arguments
system

a system name eg. "zenodo", "dataverse"

status

a status for entity resource "draft" or "published"


Method getJobResource()

Get an entity job resource path

Usage
geoflow_entity$getJobResource(config, resourceType, filename)
Arguments
config

a geoflow config object

resourceType

type of resource, matching a sub-directory within the entity job directory

filename

filename

Returns

the file path of the job resource


Method getJobDataResource()

Get an entity job data resource path

Usage
geoflow_entity$getJobDataResource(config, filename)
Arguments
config

a geoflow config object

filename

filename

Returns

the file path of the job data resource


Method getJobMetadataResource()

Get an entity job metadata resource path

Usage
geoflow_entity$getJobMetadataResource(config, filename)
Arguments
config

a geoflow config object

filename

filename

Returns

the file path of the job metadata resource


Method addResource()

Adds a resource to the entity

Usage
geoflow_entity$addResource(id, resource)
Arguments
id

id of the resource

resource

resource


Method asDataFrame()

Methods to export the geoflow_entity as data.frame using key-based syntax.

Usage
geoflow_entity$asDataFrame(line_separator = NULL)
Arguments
line_separator

a line separator. By default, the default line separator will be used.

Returns

an object of class data.frame giving the entities using key-based syntax


Method clone()

The objects of this class are cloneable with this method.

Usage
geoflow_entity$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>


geoflow documentation built on Dec. 12, 2025, 5:08 p.m.