Skip to content

Commit

Permalink
#181 M5 - last batch of missing MDQ classes
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 13, 2024
1 parent 8645c10 commit 0f4ac3e
Show file tree
Hide file tree
Showing 24 changed files with 1,538 additions and 21 deletions.
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export(ISODataFile)
export(ISODataIdentification)
export(ISODataIdentification19115_3)
export(ISODataIdentification19139)
export(ISODataInspection)
export(ISODataQuality)
export(ISODataQualityAbstractElement)
export(ISODataQualityScope)
Expand All @@ -196,6 +197,7 @@ export(ISODate)
export(ISODateType)
export(ISODefinitionReference)
export(ISODefinitionSource)
export(ISODescriptiveResult)
export(ISODigitalTransferOptions)
export(ISODimension)
export(ISODimensionNameType)
Expand Down Expand Up @@ -304,6 +306,7 @@ export(ISOMLCodeListDictionary)
export(ISOMaintenanceFrequency)
export(ISOMaintenanceInformation)
export(ISOMeasure)
export(ISOMeasureReference)
export(ISOMedium)
export(ISOMediumFormat)
export(ISOMediumName)
Expand All @@ -317,6 +320,7 @@ export(ISOMimeFileType)
export(ISOMultiplicity)
export(ISOMultiplicityRange)
export(ISONonQuantitativeAttributeAccuracy)
export(ISONonQuantitativeAttributeCorrectness)
export(ISOObligation)
export(ISOOnLineFunction)
export(ISOOnlineResource)
Expand All @@ -335,6 +339,7 @@ export(ISOProcessStep)
export(ISOProductionSeries)
export(ISOProgress)
export(ISOPropertyType)
export(ISOQualityResultFile)
export(ISOQuantitativeAttributeAccuracy)
export(ISOQuantitativeResult)
export(ISORangeDimension)
Expand Down Expand Up @@ -371,6 +376,7 @@ export(ISOSource)
export(ISOSpatialRepresentation)
export(ISOSpatialRepresentationType)
export(ISOSpatialTemporalExtent)
export(ISOStandaloneQualityReportInformation)
export(ISOStandardOrderProcess)
export(ISOStatus)
export(ISOStereoMate)
Expand All @@ -388,6 +394,7 @@ export(ISOURI)
export(ISOURL)
export(ISOUnlimitedInteger)
export(ISOUomIdentifier)
export(ISOUsabilityElement)
export(ISOUsage)
export(ISOVectorSpatialRepresentation)
export(ISOVerticalExtent)
Expand Down
25 changes: 25 additions & 0 deletions R/ISODataQualityThematicAccuracy.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,29 @@ ISOThematicClassificationCorrectness <- R6Class("ISOThematicClassificationCorrec
)
),
public = list()
)

#' ISONonQuantitativeAttributeCorrectness
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO data quality non-quantitative attribute correctness
#' @return Object of \code{\link{R6Class}} for modelling an ISONonQuantitativeAttributeCorrectness
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \link{https://schemas.isotc211.org/19157/-/mdq/1.2/mdq/#element_DQ_NonQuantitativeAttributeCorrectness}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISONonQuantitativeAttributeCorrectness <- R6Class("ISONonQuantitativeAttributeCorrectness",
inherit = ISOAbstractTemporalAccuracy,
private = list(
xmlElement = "DQ_NonQuantitativeAttributeCorrectness",
xmlNamespacePrefix = list(
"19115-3" = "MDQ"
)
),
public = list()
)
69 changes: 69 additions & 0 deletions R/ISODescriptiveResult.R
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)
}
}


)
)
32 changes: 32 additions & 0 deletions R/ISOEvaluationMethod.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,35 @@ ISOSampleBasedInspection <- R6Class("ISOSampleBasedInspection",
}
)
)

#' ISODataInspection
#'
#' @docType class
#' @importFrom R6 R6Class
#' @export
#' @keywords ISO data inspection
#' @return Object of \code{\link{R6Class}} for modelling an ISO data inspection
#' @format \code{\link{R6Class}} object.
#'
#' @references
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19157/-/mdq/1.2/mdq/#element_DQ_DataInspection}
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
ISODataInspection <- R6Class("ISODataInspection",
inherit = ISOEvaluationMethod,
private = list(
xmlElement = "DQ_DataInspection",
xmlNamespacePrefix = list(
"19115-3" = "MDQ"
)
),
public = list(

#'@description Initializes object
#'@param xml object of class \link{XMLInternalNode-class}
initialize = function(xml = NULL){
super$initialize(xml = xml)
}
)
)
79 changes: 79 additions & 0 deletions R/ISOMeasureReference.R
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)
}
}
)
)
85 changes: 85 additions & 0 deletions R/ISOQualityResultFile.R
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
}
)
)
Loading

0 comments on commit 0f4ac3e

Please sign in to comment.