ISOAbstractObject
ISOAbstractObject
ISOAbstractObject class
R6Class
object.
Object of R6Class
for modelling an ISO Metadata Element
Abstract ISO Metadata class used internally by geometa
getISOStandardByPrefix(prefix)
: Inherit the ISO (and/or OGC) standard reference for a given standard prefix (e.g. GMD). The object returned is a data.frame
containing the specification reference and title.getISOStandard(clazz, version)
: Inherit the ISO (and/or OGC) standard reference for a given geometa
class. The object returned is a data.frame
containing the specification reference and title.getISOClasses(extended, pretty)
: Get the list of classes supported by geometa
. By default, extended
is set to FALSE
(restrained to geometa
environment). If TRUE
, this allows to list eventual classes loaded in your global environment and that extend geometa
classes. The argument pretty
gives a the list of classes and associated ISO/OGC standard information as data.frame
.getISOClassByNode(node)
: Inherit the ISO class matching an XML document or nodecompare(metadataElement1, metadataElement2)
: Compares two metadata elements objects. Returns TRUE if they are equal, FALSE otherwise. The comparison of object is done by comparing the XML representation of the objects (since no R6 object comparison method seems to exist)Emmanuel Blondel emmanuel.blondel1@gmail.com
geometa::geometaLogger
-> ISOAbstractObject
wrap
: wrap
element
: element
namespace
: namespace
defaults
: defaults
attrs
: attributes
printAttrs
: attributes to print
parentAttrs
: parent attributes
value
: value
value_as_field
: value as field?
isNull
: is null?
anyElement
: any element?
new()
Initializes object
ISOAbstractObject$new(
xml = NULL,
element = NULL,
namespace = NULL,
attrs = list(),
defaults = list(),
wrap = TRUE,
value_as_field = FALSE
)
xml
: object of class XMLInternalNode-class
element
: element name
namespace
: namespace
attrs
: attrs
defaults
: defaults
wrap
: wrap?
value_as_field
: value as field?
checkMetadataStandardCompliance()
Check if object can be instantiated vs. the current metadata standard
ISOAbstractObject$checkMetadataStandardCompliance()
stopIfMetadataStandardIsNot()
Utility to stop in case a the current metadata standard does not match the one required for the code. This utility can be used to check applicability of a certain method, depending on on the current metadata standard.
ISOAbstractObject$stopIfMetadataStandardIsNot(version)
version
: version
print()
Provides a custom print output (as tree) of the current class
ISOAbstractObject$print(..., depth = 1, add_codelist_description = TRUE)
...
: args
depth
: class nesting depth
add_codelist_description
: Add codelist description. Default is TRUE
decode()
Decodes object from XML
ISOAbstractObject$decode(xml)
xml
: object of class XMLInternalNode-class
encode()
Encodes object as XML.
By default, namespace definition will be added to XML root (addNS = TRUE
), and validation of object will be performed (validate = TRUE
) prior to its XML encoding. The argument strict
allows to stop the encoding in case object is not valid, with a default value set to FALSE
.
The argument setSerialID
is used by geometa
to generate automatically serial IDs associated to XML elements, in particular for GML, default value is TRUE
(recommended value).
The argument resetSerialID
is used by geometa
for reseting mandatory IDs associated to XML elements, such as GML objects, default value is TRUE
(recommended value).
Setting inspire
to TRUE (default FALSE), the metadata will be checked with the INSPIRE metadata validator (online web-service provided by INSPIRE). To check metadata with the INSPIRE metadata validator, setting an INSPIRE metadata validator is now required, and should be specified with the inspireValidator
. See INSPIREMetadataValidator
for more details
ISOAbstractObject$encode(
addNS = TRUE,
validate = TRUE,
strict = FALSE,
inspire = FALSE,
inspireValidator = NULL,
resetSerialID = TRUE,
setSerialID = TRUE,
encoding = "UTF-8"
)
addNS
: add namespace? Default is TRUE
validate
: validate XML output against schemas?
strict
: strict validation? Default is FALSE
.
inspire
: perform INSPIRE validation? Default is FALSE
inspireValidator
: an object of class INSPIREMetadataValidator to perform INSPIRE metadata validation
resetSerialID
: reset Serial ID? Default is TRUE
setSerialID
: set serial ID? Default is TRUE
encoding
: encoding. Default is UTF-8
validate()
Validates an XML object resulting from object encoding
ISOAbstractObject$validate(
xml = NULL,
strict = FALSE,
inspire = FALSE,
inspireValidator = NULL
)
xml
: object of class XMLInternalNode-class
strict
: strict validation? If TRUE
, a invalid XML will return an error
inspire
: perform INSPIRE validation? Default is FALSE
inspireValidator
: an object of class INSPIREMetadataValidator to perform INSPIRE metadata validation
TRUE
if valid, FALSE
otherwise
save()
Save XML representation resulting from $encode(...)
method to a file
ISOAbstractObject$save(file, ...)
file
: file
...
: any other argument from $encode(...)
method
getNamespaceDefinition()
Get namespace definition
ISOAbstractObject$getNamespaceDefinition(recursive = FALSE)
recursive
: recursive namespace definitions? Default is FALSE
the list of XML namespace definitions
getClassName()
Get class name
ISOAbstractObject$getClassName(level = 1L)
level
: level of class
the class name
getClass()
Get class
ISOAbstractObject$getClass()
the corresponding class, as R6Class reference object generator
wrapBaseElement()
Wraps base element
ISOAbstractObject$wrapBaseElement(field, fieldObj)
field
: field name
fieldObj
: field object
an
: object of class R6Class
setIsNull()
Set Is Null
ISOAbstractObject$setIsNull(isNull, reason = "missing")
isNull
: object of class logical
reason
: reason why object is Null
contains()
Util to know if a field contain a metadata element
ISOAbstractObject$contains(field, metadataElement)
field
: field name
metadataElement
: metadata element
TRUE
if contains, FALSE
otherwise
addListElement()
Util to add an element to a list of elements for N cardinality of a target element name
ISOAbstractObject$addListElement(field, metadataElement)
field
: field
metadataElement
: metadata element
TRUE
if added, FALSE
otherwise
delListElement()
Util to deleted an element to a list of elements for N cardinality of a target element name
ISOAbstractObject$delListElement(field, metadataElement)
field
: field
metadataElement
: metadata element
TRUE
if deleted, FALSE
otherwise
setAttr()
Util to set an attribute
ISOAbstractObject$setAttr(attrKey, attrValue)
attrKey
: attribute key
attrValue
: attribute value
addFieldAttrs()
Util add field attributes, over the XML field wrapping element instead of the element itself
ISOAbstractObject$addFieldAttrs(field, ...)
field
: field
...
: list of attributes
setId()
Set id
ISOAbstractObject$setId(id, addNS = FALSE)
id
: id
addNS
: add namespace definition? Default is FALSE
setHref()
Set Href attribute
ISOAbstractObject$setHref(href)
href
: href
setCodeList()
Set codelist attribute
ISOAbstractObject$setCodeList(codeList)
codeList
: codelist
setCodeListValue()
Set codelist value
ISOAbstractObject$setCodeListValue(codeListValue)
codeListValue
: codelist value
setCodeSpace()
Set codeSpace
ISOAbstractObject$setCodeSpace(codeSpace)
codeSpace
: codespace
setValue()
Set value
ISOAbstractObject$setValue(value)
value
: value
isDocument()
Util to check where object refers to a emetadata document (eg. ISOMetadata or ISOFeatureCatalogue )
ISOAbstractObject$isDocument()
TRUE
if a document, FALSE
otherwise
isFieldInheritedFrom()
Indicates the class a field inherits from
ISOAbstractObject$isFieldInheritedFrom(field)
field
: field
an object generator of class R6Class
createLocalisedProperty()
Creates a localised property
ISOAbstractObject$createLocalisedProperty(text, locales)
text
: text
locales
: a list of localized names