Skip to content

Commit

Permalink
#181 support M5 - new MRI classes
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Oct 4, 2024
1 parent 0fb1354 commit aa4dffe
Show file tree
Hide file tree
Showing 9 changed files with 527 additions and 9 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export(ISOAggregateInformation)
export(ISOAnchor)
export(ISOAngle)
export(ISOApplicationSchemaInformation)
export(ISOAssociatedResource)
export(ISOAssociation)
export(ISOAssociationRole)
export(ISOAssociationType)
Expand Down Expand Up @@ -265,6 +266,7 @@ export(ISOIndividual)
export(ISOInheritanceRelation)
export(ISOInitiative)
export(ISOInitiativeType)
export(ISOKeywordClass)
export(ISOKeywordType)
export(ISOKeywords)
export(ISOLanguage)
Expand Down
86 changes: 86 additions & 0 deletions R/ISOAssociatedResource.R
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
}
)
)
65 changes: 65 additions & 0 deletions R/ISOKeywordClass.R
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
}
)
)
4 changes: 2 additions & 2 deletions inst/extdata/coverage/geometa_coverage_inventory.csv
Original file line number Diff line number Diff line change
Expand Up @@ -659,9 +659,9 @@
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","AbstractMD_Identification","ISOIdentification",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","DS_AssociationTypeCode","ISOAssociationType",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","DS_InitiativeTypeCode","ISOInitiativeType",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_AssociatedResource","<missing>",FALSE,FALSE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_AssociatedResource","ISOAssociatedResource",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_DataIdentification","ISODataIdentification",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_KeywordClass","<missing>",FALSE,FALSE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_KeywordClass","ISOKeywordClass",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_Keywords","ISOKeywords",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_KeywordTypeCode","ISOKeywordType",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI","MD_RepresentativeFraction","ISORepresentativeFraction",TRUE,TRUE,"ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI"
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Portrayal Catalogues (MPC) Version: 1.0","MPC",1,0,1,0,100
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Content (MRC) Version: 1.0","MRC",16,3,16,3,84.21
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Distribution (MRD) Version: 1.0","MRD",7,0,7,0,100
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI",10,2,10,2,83.33
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Identification (MRI) Version: 1.0","MRI",12,0,12,0,100
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Resource Lineage (MRL) Version: 2.0","MRL",0,11,0,11,0
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Reference Systems (MRS) Version: 1.0","MRS",2,0,2,0,100
"ISO/TS 19115-3:2023","ISO 19115-1:2014","Metadata for Spatial Representation (MSR) Version: 2.0","MSR",0,17,0,17,0
Expand Down
10 changes: 5 additions & 5 deletions inst/extdata/coverage/geometa_coverage_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,11 @@
<td align="left">Metadata for Resource Identification (MRI) Version:
1.0</td>
<td align="left">MRI</td>
<td align="left"><a href="https://github.com/eblondel/geometa"><img src="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMzUiIGhlaWdodD0iMjAiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0iODMlIj48dGl0bGU+ODMlPC90aXRsZT48bGluZWFyR3JhZGllbnQgaWQ9InMiIHgyPSIwIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjYmJiIiBzdG9wLW9wYWNpdHk9Ii4xIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9Ii4xIi8+PC9saW5lYXJHcmFkaWVudD48Y2xpcFBhdGggaWQ9InIiPjxyZWN0IHdpZHRoPSIzNSIgaGVpZ2h0PSIyMCIgcng9IjMiIGZpbGw9IiNmZmYiLz48L2NsaXBQYXRoPjxnIGNsaXAtcGF0aD0idXJsKCNyKSI+PHJlY3Qgd2lkdGg9IjAiIGhlaWdodD0iMjAiIGZpbGw9IiMzM2NjN2EiLz48cmVjdCB4PSIwIiB3aWR0aD0iMzUiIGhlaWdodD0iMjAiIGZpbGw9IiMzM2NjN2EiLz48cmVjdCB3aWR0aD0iMzUiIGhlaWdodD0iMjAiIGZpbGw9InVybCgjcykiLz48L2c+PGcgZmlsbD0iI2ZmZiIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9IlZlcmRhbmEsR2VuZXZhLERlamFWdSBTYW5zLHNhbnMtc2VyaWYiIHRleHQtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIGZvbnQtc2l6ZT0iMTEwIj48dGV4dCBhcmlhLWhpZGRlbj0idHJ1ZSIgeD0iMTc1IiB5PSIxNTAiIGZpbGw9IiMwMTAxMDEiIGZpbGwtb3BhY2l0eT0iLjMiIHRyYW5zZm9ybT0ic2NhbGUoLjEpIiB0ZXh0TGVuZ3RoPSIyNTAiPjgzJTwvdGV4dD48dGV4dCB4PSIxNzUiIHk9IjE0MCIgdHJhbnNmb3JtPSJzY2FsZSguMSkiIGZpbGw9IiNmZmYiIHRleHRMZW5ndGg9IjI1MCI+ODMlPC90ZXh0PjwvZz48L3N2Zz4=" alt="ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI" /></a></td>
<td align="right">10</td>
<td align="right">2</td>
<td align="right">10</td>
<td align="right">2</td>
<td align="left"><a href="https://github.com/eblondel/geometa"><img src="data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iN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HRMZW5ndGg9IjMzMCI+MTAwJTwvdGV4dD48L2c+PC9zdmc+" alt="ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI" /></a></td>
<td align="right">12</td>
<td align="right">0</td>
<td align="right">12</td>
<td align="right">0</td>
</tr>
<tr class="even">
<td align="left">ISO/TS 19115-3:2023</td>
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/coverage/geometa_coverage_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Portrayal Catalogues (MPC) Version: 1.0 |MPC |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MPC](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa)| 1| 0| 1| 0|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Resource Content (MRC) Version: 1.0 |MRC |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRC](https://img.shields.io/badge/-84%25-33cc7a.svg)](https://github.com/eblondel/geometa)| 16| 3| 16| 3|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Resource Distribution (MRD) Version: 1.0 |MRD |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRD](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa)| 7| 0| 7| 0|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Resource Identification (MRI) Version: 1.0 |MRI |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI](https://img.shields.io/badge/-83%25-33cc7a.svg)](https://github.com/eblondel/geometa)| 10| 2| 10| 2|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Resource Identification (MRI) Version: 1.0 |MRI |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRI](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa)| 12| 0| 12| 0|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Resource Lineage (MRL) Version: 2.0 |MRL |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRL](https://img.shields.io/badge/-0%25-ad0f0f.svg)](https://github.com/eblondel/geometa)| 0| 11| 0| 11|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Reference Systems (MRS) Version: 1.0 |MRS |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MRS](https://img.shields.io/badge/-100%25-4a4ea8.svg)](https://github.com/eblondel/geometa)| 2| 0| 2| 0|
|ISO/TS 19115-3:2023 |ISO 19115-1:2014 |Metadata for Spatial Representation (MSR) Version: 2.0 |MSR |[![ISO/TS 19115-3:2023 - ISO 19115-1:2014 - MSR](https://img.shields.io/badge/-0%25-ad0f0f.svg)](https://github.com/eblondel/geometa)| 0| 17| 0| 17|
Expand Down
Loading

0 comments on commit aa4dffe

Please sign in to comment.