-
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.
- Loading branch information
Showing
9 changed files
with
527 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#' ISOAssociatedResource | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO associated resource | ||
#' @return Object of \code{\link{R6Class}} for modelling an ISO associated resource | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mri/1.0/mri/#element_MD_AssociatedResource} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOAssociatedResource <- R6Class("ISOAssociatedResource", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "MD_AssociatedResource", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MRI" | ||
) | ||
), | ||
public = list( | ||
|
||
#'@field name name [0..1]: ISOAbstractCitation | ||
name = NULL, | ||
#'@field associationType associationType [1..1]: ISOAssociationType | ||
associationType = NULL, | ||
#'@field initiativeType initiativeType [0..1]: ISOInitiativeType | ||
initiativeType = NULL, | ||
#'@field metadataReference metadataReference [0..1]: ISOAbstractCitation | ||
metadataReference = NULL, | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Set name | ||
#'@param name name object of class \link{ISOAbstractCitation} | ||
setName = function(name){ | ||
if(!is(name, "ISOAbstractCitation")){ | ||
stop("The argument should be an object of class 'ISOAbstractCitation'") | ||
} | ||
self$name = name | ||
}, | ||
|
||
#'@description Set association type | ||
#'@param associationType associationType object of class \link{ISOAssociationType} or | ||
#'any value among values listed by \code{ISOAssociationType$values()} | ||
setAssociationType = function(associationType){ | ||
if(!is(associationType, "ISOAssociationType")){ | ||
if(is(associationType, "character")){ | ||
associationType = ISOAssociationType$new(value = associationType) | ||
}else{ | ||
stop("The argument should be an object of class 'ISOAssociationType' or 'character'") | ||
} | ||
} | ||
self$associationType = associationType | ||
}, | ||
|
||
#'@description Set initiative type | ||
#'@param initiativeType initiativeType object of class \link{ISOInitiativeType} or | ||
#'any value among values listed by \code{ISOInitiativeType$values()} | ||
setInitiativeType = function(initiativeType){ | ||
if(!is(initiativeType, "ISOInitiativeType")){ | ||
if(is(initiativeType, "character")){ | ||
initiativeType = ISOInitiativeType$new(value = initiativeType) | ||
}else{ | ||
stop("The argument should be an object of class 'ISOInitiativeType' or 'character'") | ||
} | ||
} | ||
self$initiativeType = initiativeType | ||
}, | ||
|
||
#'@description Set metadata reference | ||
#'@param metadataReference metadataReference object of class \link{ISOAbstractCitation} | ||
setMetadatReference = function(metadataReference){ | ||
if(!is(metadataReference, "ISOAbstractCitation")){ | ||
stop("The argument should be an object of class 'ISOAbstractCitation") | ||
} | ||
self$metadataReference = metadataReference | ||
} | ||
) | ||
) |
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,65 @@ | ||
#' ISOKeywordClass | ||
#' | ||
#' @docType class | ||
#' @importFrom R6 R6Class | ||
#' @export | ||
#' @keywords ISO keywordclass | ||
#' @return Object of \code{\link{R6Class}} for modelling a ISO keyword class | ||
#' @format \code{\link{R6Class}} object. | ||
#' | ||
#' @references | ||
#' - ISO 19115-3 \url{https://schemas.isotc211.org/19115/-3/mri/1.0/mri/#element_MD_KeywordClass} | ||
#' | ||
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com> | ||
#' | ||
ISOKeywordClass <- R6Class("ISOKeywordClass", | ||
inherit = ISOAbstractObject, | ||
private = list( | ||
xmlElement = "MD_KeywordClass", | ||
xmlNamespacePrefix = list( | ||
"19115-3" = "MRI" | ||
) | ||
), | ||
public = list( | ||
#'@field className className | ||
className = NULL, | ||
#'@field conceptIdentifier conceptIdentifier | ||
conceptIdentifier = NULL, | ||
#'@field ontology ontology | ||
ontology = NULL, | ||
|
||
#'@description Initializes object | ||
#'@param xml object of class \link{XMLInternalNode-class} | ||
initialize = function(xml = NULL){ | ||
super$initialize(xml = xml) | ||
}, | ||
|
||
#'@description Set class name | ||
#'@param className className | ||
#'@param locales list of localized texts. Default is \code{NULL} | ||
setClassName = function(className, locales = NULL){ | ||
if(!is.null(locales)){ | ||
className <- self$createLocalisedProperty(className, locales) | ||
} | ||
self$className = className | ||
}, | ||
|
||
#'@description Set concept identifier | ||
#'@param conceptIdentifier conceptIdentifier, object of class \link{ISOURI} | ||
setConceptIdentifier = function(conceptIdentifier){ | ||
if(!is(conceptIdentifier, "ISOURI")){ | ||
stop("The argument should be an object of class 'ISOURI'") | ||
} | ||
self$conceptIdentifier = conceptIdentifier | ||
}, | ||
|
||
#'@description Set ontology | ||
#'@param ontology ontology, object inheriting class \link{ISOAbstractParty} | ||
setOntology = function(ontology){ | ||
if(!is(ontology, "ISOAbstractParty")){ | ||
stop("The argument should be an object of class 'ISOAbstractParty'") | ||
} | ||
self$ontology = ontology | ||
} | ||
) | ||
) |
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
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
Oops, something went wrong.