-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#181 M5 - last batch of missing MDQ classes
- Loading branch information
Showing
24 changed files
with
1,538 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#' ISODescriptiveResult | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO data quality descriptive result | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISODescriptiveResult | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \link{https://schemas.isotc211.org/19157/-/mdq/1.2/mdq/#element_DQ_DescriptiveResult} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISODescriptiveResult <- R6Class("ISODescriptiveResult", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "DQ_DescriptiveResult", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MDQ" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field resultScope resultScope [0..1]: ISOScope | ||
resultScope = NULL, | ||
#'@field dateTime dateTime [0..1]: ISOBaseDateTime | ||
dateTime = NULL, | ||
#'@field statement statement [1]: character | ||
statement = NULL, | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Set result scope | ||
#'@param scope object of class \link{ISOScope} | ||
setResultScope = function(scope){ | ||
self$stopIfMetadataStandardIsNot("19115-3") | ||
if(!is(scope, "ISOScope")){ | ||
stop("The argument should be a 'ISOScope' object") | ||
} | ||
self$resultScope = scope | ||
}, | ||
|
||
#'@description Set date time | ||
#'@param dateTime dateTime object of class \link{ISOBaseDateTime} | ||
setDateTime = function(dateTime){ | ||
if(!is(dateTime, "ISOBaseDateTime")){ | ||
stop("The argument 'dateTime' should be an object of class 'ISOBaseDateTime'") | ||
} | ||
self$dateTime = dateTime | ||
}, | ||
|
||
#'@description Set statement | ||
#'@param statement statement | ||
#'@param locales list of localized statement. Default is \code{NULL} | ||
setStatement = function(statement, locales = NULL){ | ||
self$statement <- statement | ||
if(!is.null(locales)){ | ||
self$statement <- self$createLocalisedProperty(statement, locales) | ||
} | ||
} | ||
|
||
|
||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#' ISOMeasureReference | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO measure reference | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISO measure reference | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19157/-/mdq/1.2/mdq/#element_DQ_MeasureReference} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOMeasureReference <- R6Class("ISOMeasureReference", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "DQ_MeasureReference", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MDQ" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field measureIdentification measureIdentification [0..1]: ISOMetaIdentifier | ||
measureIdentification = NULL, | ||
#'@field nameOfMeasure nameOfMeasure [0..*]: character | ||
nameOfMeasure = list(), | ||
#'@field measureDescription measureDescription [0..1]: character | ||
measureDescription = list(), | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description set MeasureIdentification | ||
#'@param measureIdentifier object of class \link{ISOMetaIdentifier} | ||
setMeasureIdentification = function(measureIdentifier){ | ||
if(!is(measureIdentifier, "ISOMetaIdentifier")){ | ||
measureIdentifier = ISOMetaIdentifier$new(code = measureIdentifier) | ||
} | ||
self$measureIdentifier = measureIdentifier | ||
}, | ||
|
||
#'@description Adds name | ||
#'@param name name | ||
#'@param locales list of localized names. Default is \code{NULL} | ||
#'@return \code{TRUE} if added, \code{FALSE} otherwise | ||
addName = function(name, locales = NULL){ | ||
if(!is.null(locales)){ | ||
name <- self$createLocalisedProperty(name, locales) | ||
} | ||
return(self$addListElement("nameOfMeasure", name)) | ||
}, | ||
|
||
#'@description Deletes name | ||
#'@param name name | ||
#'@param locales list of localized names. Default is \code{NULL} | ||
#'@return \code{TRUE} if deleted, \code{FALSE} otherwise | ||
delName = function(name, locales = NULL){ | ||
if(!is.null(locales)){ | ||
name <- self$createLocalisedProperty(name, locales) | ||
} | ||
return(self$delListElement("nameOfMeasure", name)) | ||
}, | ||
|
||
#'@description set measure description | ||
#'@param measureDescription object of class \link{character} | ||
#'@param locales list of localized descriptions. Default is \code{NULL} | ||
setMeasureDescription = function(measureDescription){ | ||
self$measureDescription = measureDescription | ||
if(!is.null(locales)){ | ||
self$measureDescription <- self$createLocalisedProperty(measureDescription, locales) | ||
} | ||
} | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#' ISOQualityResultFile | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO quality result file | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISO quality result file | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19157/-/mdq/1.2/mdq/#element_QualityResultFile} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOQualityResultFile <- R6Class("ISOQualityResultFile", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "QualityResultFile", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MDQ" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field fileName fileName [1]: ISOFileName | ||
fileName = NULL, | ||
#'@field fileType fileType [1]: ISOMimeFileType | ||
fileType = NULL, | ||
#'@field fileDescription fileDescription [1]: character | ||
fileDescription = NULL, | ||
#'@field fileFormat fileFormat [1]: ISOFormat | ||
fileFormat = NULL, | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Set file name | ||
#'@param fileName filename object of class \link{ISOFileName} | ||
setFileName = function(fileName){ | ||
if(!is(fileName, "ISOFileName")){ | ||
stop("The argument 'fileName' should be an object of class 'ISOFileName'") | ||
} | ||
self$fileName = fileName | ||
}, | ||
|
||
#'@description Set file type | ||
#'@param fileType fileType object of class \link{ISOMimeFileType} or \link{character} | ||
setFileType = function(fileType){ | ||
if(!is(fileType, "ISOMimeFileType")){ | ||
if(is(fileType, "character")){ | ||
fileType = ISOMimeFileType$buildFrom(mimetype = fileType) | ||
}else{ | ||
stop("The argument 'fileType' should be an object of class 'ISOMimeFileType' or 'character'") | ||
} | ||
} | ||
self$fileType = fileType | ||
}, | ||
|
||
#'@description Set file description | ||
#'@param fileDescription fileDescription object of class \link{character} | ||
#'@param locales list of localized file description. Default is \code{NULL} | ||
setFileDescription = function(fileDescription, locales = NULL){ | ||
self$fileDescription <- fileDescription | ||
if(!is.null(locales)){ | ||
self$fileDescription <- self$createLocalisedProperty(fileDescription, locales) | ||
} | ||
}, | ||
|
||
#'@description Set file format | ||
#'@param fileFormat fileFormat = object of class \link{ISOFormat} or \link{character} | ||
setFileFormat = function(fileFormat){ | ||
if(!is(fileFormat, "ISOFormat")){ | ||
if(is(fileFormat, "character")){ | ||
fileFormat = ISOFormat$buildFrom(mimetype = fileFormat) | ||
}else{ | ||
stop("The argument 'fileFormat' should be an object of class 'ISOFormat' or 'character'") | ||
} | ||
} | ||
self$fileFormat = fileFormat | ||
} | ||
) | ||
) |
Oops, something went wrong.