From e8d703fcc1fd03919560465eb8baf017175ac0a7 Mon Sep 17 00:00:00 2001 From: eblondel Date: Mon, 3 Oct 2022 21:28:25 +0200 Subject: [PATCH] #187 SWE AbstractSWEIdentifiable --- NAMESPACE | 1 + R/SWEAbstractDataComponent.R | 27 +-------- R/SWEAbstractSWEIdentifiable.R | 56 +++++++++++++++++++ README.md | 2 +- .../coverage/geometa_coverage_inventory.csv | 2 +- .../coverage/geometa_coverage_summary.csv | 2 +- .../coverage/geometa_coverage_summary.md | 2 +- man/SWEAbstractDataComponent.Rd | 18 ------ man/SWEAbstractSWEIdentifiable.Rd | 48 ++++++++++++++++ 9 files changed, 111 insertions(+), 47 deletions(-) create mode 100644 R/SWEAbstractSWEIdentifiable.R create mode 100644 man/SWEAbstractSWEIdentifiable.Rd diff --git a/NAMESPACE b/NAMESPACE index a983fe2d..bbad3872 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -323,6 +323,7 @@ export(SWEAbstractDataComponent) export(SWEAbstractEncoding) export(SWEAbstractObject) export(SWEAbstractSWE) +export(SWEAbstractSWEIdentifiable) export(SWEAbstractSimpleComponent) export(SWECategory) export(SWECategoryRange) diff --git a/R/SWEAbstractDataComponent.R b/R/SWEAbstractDataComponent.R index 6ec9ac64..aad4de9e 100644 --- a/R/SWEAbstractDataComponent.R +++ b/R/SWEAbstractDataComponent.R @@ -15,20 +15,15 @@ #' @author Emmanuel Blondel #' SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent", - inherit = SWEAbstractObject, + inherit = SWEAbstractSWEIdentifiable, private = list( xmlElement = "AbstractDataComponent", xmlNamespacePrefix = "SWE" ), public = list( - #'@field description description - description = NULL, - #'@field label label - label = NULL, + #'@field name name name = list(), - #'@field identifier identifier - identifier = NULL, #'@description Initializes an object of class \link{SWEAbstractDataComponent} #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} @@ -44,18 +39,6 @@ SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent", if(!is.null(definition)) self$setAttr("definition", definition) }, - #'@description Set description - #'@param description description - setDescription = function(description){ - self$description <- SWEElement$create(element = "description", value = description) - }, - - #'@description Set label - #'@param label label - setLabel = function(label){ - self$label <- SWEElement$create(element = "label", value = label) - }, - #'@description Adds name #'@param name name #'@param codeSpace codespace @@ -70,12 +53,6 @@ SWEAbstractDataComponent <- R6Class("SWEAbstractDataComponent", delName = function(name, codeSpace = NULL){ name <- GMLCodeType$new(value = name, codeSpace = codeSpace) return(self$delListElement("name", name)) - }, - - #'@description Set identifier - #'@param identifier identifier - setIdentifier = function(identifier){ - self$identifier <- SWEElement$create(element = "identifier", value = identifier) } ) ) \ No newline at end of file diff --git a/R/SWEAbstractSWEIdentifiable.R b/R/SWEAbstractSWEIdentifiable.R new file mode 100644 index 00000000..8050a9b7 --- /dev/null +++ b/R/SWEAbstractSWEIdentifiable.R @@ -0,0 +1,56 @@ +#' SWEAbstractSWEIdentifiable +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords ISO SWE +#' @return Object of \code{\link{R6Class}} for modelling an SWE abstract identifiable +#' @format \code{\link{R6Class}} object. +#' +#' @references +#' SWE Common Data Model Encoding Standard. https://www.ogc.org/standards/swecommon +#' +#' @author Emmanuel Blondel +#' +SWEAbstractSWEIdentifiable <- R6Class("SWEAbstractSWEIdentifiable", + inherit = SWEAbstractSWE, + private = list( + xmlElement = "AbstractSWEIdentifiable", + xmlNamespacePrefix = "SWE" + ), + public = list( + + #'@field identifier identifier + identifier = NULL, + #'@field label label + label = NULL, + #'@field description description + description = NULL, + + #'@description Initializes a SWE Nil Values object + #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} + initialize = function(xml, element = element, attrs = list(), defaults = list(), wrap = TRUE, value_as_field = TRUE){ + if(is.null(element)) element <- private$xmlElement + super$initialize(xml, element = element, attrs = attrs, defaults = defaults, wrap = wrap, value_as_field = value_as_field) + }, + + #'@description Set identifier + #'@param identifier identifier + setIdentifier = function(identifier){ + self$identifier <- SWEElement$create(element = "identifier", value = identifier) + }, + + #'@description Set label + #'@param label label + setLabel = function(label){ + self$label <- SWEElement$create(element = "label", value = label) + }, + + #'@description Set description + #'@param description description + setDescription = function(description){ + self$description <- SWEElement$create(element = "description", value = description) + } + + ) +) \ No newline at end of file diff --git a/README.md b/README.md index de2e2112..fe2063d1 100644 --- a/README.md +++ b/README.md @@ -37,4 +37,4 @@ We thank in advance people that use ``geometa`` for citing it in their work / pu |GML 3.2.1 (ISO 19136) |Geographic Markup Language |GML |[![GML 3.2.1 (ISO 19136)](https://img.shields.io/badge/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 63| 106| |GML 3.2.1 Coverage (OGC GMLCOV) |OGC GML Coverage Implementation Schema |GMLCOV |[![GML 3.2.1 Coverage (OGC GMLCOV)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 1| 0| |GML 3.3 Referenceable Grid (OGC GML) |OGC GML Referenceable Grid |GMLRGRID |[![GML 3.3 Referenceable Grid (OGC GML)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 5| 0| -|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-60%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 18| 12| +|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-63%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 19| 11| diff --git a/inst/extdata/coverage/geometa_coverage_inventory.csv b/inst/extdata/coverage/geometa_coverage_inventory.csv index ea1ea6fb..a0b76a73 100644 --- a/inst/extdata/coverage/geometa_coverage_inventory.csv +++ b/inst/extdata/coverage/geometa_coverage_inventory.csv @@ -477,7 +477,7 @@ "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractObject","SWEAbstractObject",TRUE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSimpleComponent","SWEAbstractSimpleComponent",TRUE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWE","SWEAbstractSWE",TRUE -"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWEIdentifiable","",FALSE +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AbstractSWEIdentifiable","SWEAbstractSWEIdentifiable",TRUE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTimes","",FALSE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedTokens","",FALSE "SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE","AllowedValues","",FALSE diff --git a/inst/extdata/coverage/geometa_coverage_summary.csv b/inst/extdata/coverage/geometa_coverage_summary.csv index 4c40cd5f..a7d93df9 100644 --- a/inst/extdata/coverage/geometa_coverage_summary.csv +++ b/inst/extdata/coverage/geometa_coverage_summary.csv @@ -8,4 +8,4 @@ "GML 3.2.1 (ISO 19136)","Geographic Markup Language","GML",63,106,37.28 "GML 3.2.1 Coverage (OGC GMLCOV)","OGC GML Coverage Implementation Schema","GMLCOV",1,0,100 "GML 3.3 Referenceable Grid (OGC GML)","OGC GML Referenceable Grid","GMLRGRID",5,0,100 -"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",18,12,60 +"SWE 2.0","Sensor Web Enablement (SWE) Common Data Model","SWE",19,11,63.33 diff --git a/inst/extdata/coverage/geometa_coverage_summary.md b/inst/extdata/coverage/geometa_coverage_summary.md index 20b3d92b..e963c5b5 100644 --- a/inst/extdata/coverage/geometa_coverage_summary.md +++ b/inst/extdata/coverage/geometa_coverage_summary.md @@ -9,4 +9,4 @@ |GML 3.2.1 (ISO 19136) |Geographic Markup Language |GML |[![GML 3.2.1 (ISO 19136)](https://img.shields.io/badge/-37%25-ff0c0c.svg)](https://github.com/eblondel/geometa) | 63| 106| |GML 3.2.1 Coverage (OGC GMLCOV) |OGC GML Coverage Implementation Schema |GMLCOV |[![GML 3.2.1 Coverage (OGC GMLCOV)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 1| 0| |GML 3.3 Referenceable Grid (OGC GML) |OGC GML Referenceable Grid |GMLRGRID |[![GML 3.3 Referenceable Grid (OGC GML)](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa) | 5| 0| -|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-60%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 18| 12| +|SWE 2.0 |Sensor Web Enablement (SWE) Common Data Model |SWE |[![SWE 2.0](https://img.shields.io/badge/-63%25-f2eb24.svg)](https://github.com/eblondel/geometa) | 19| 11| diff --git a/man/SWEAbstractDataComponent.Rd b/man/SWEAbstractDataComponent.Rd index 44347f6a..bdb887f6 100644 --- a/man/SWEAbstractDataComponent.Rd +++ b/man/SWEAbstractDataComponent.Rd @@ -18,15 +18,9 @@ \item{definition}{definition} -\item{description}{description} - -\item{label}{label} - \item{name}{name} \item{codeSpace}{codespace} - -\item{identifier}{identifier} } \value{ Object of \code{\link{R6Class}} for modelling an SWE Abstract data component @@ -34,26 +28,14 @@ Object of \code{\link{R6Class}} for modelling an SWE Abstract data component \description{ Initializes an object of class \link{SWEAbstractDataComponent} -Set description - -Set label - Adds name Deletes name - -Set identifier } \section{Fields}{ \describe{ -\item{\code{description}}{description} - -\item{\code{label}}{label} - \item{\code{name}}{name} - -\item{\code{identifier}}{identifier} }} \note{ diff --git a/man/SWEAbstractSWEIdentifiable.Rd b/man/SWEAbstractSWEIdentifiable.Rd new file mode 100644 index 00000000..5c199a5e --- /dev/null +++ b/man/SWEAbstractSWEIdentifiable.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/SWEAbstractSWEIdentifiable.R +\docType{class} +\name{SWEAbstractSWEIdentifiable} +\alias{SWEAbstractSWEIdentifiable} +\title{SWEAbstractSWEIdentifiable} +\format{ +\code{\link{R6Class}} object. +} +\arguments{ +\item{xml}{object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{identifier}{identifier} + +\item{label}{label} + +\item{description}{description} +} +\value{ +Object of \code{\link{R6Class}} for modelling an SWE abstract identifiable +} +\description{ +Initializes a SWE Nil Values object + +Set identifier + +Set label + +Set description +} +\section{Fields}{ + +\describe{ +\item{\code{identifier}}{identifier} + +\item{\code{label}}{label} + +\item{\code{description}}{description} +}} + +\references{ +SWE Common Data Model Encoding Standard. https://www.ogc.org/standards/swecommon +} +\author{ +Emmanuel Blondel +} +\keyword{ISO} +\keyword{SWE}