ISOAbstractObject
ISOAbstractObject
Object of R6Class for modelling an ISO Metadata Element
R6Class object.
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)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 node
compare(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)
new(xml, element, namespace, defaults, attrs)This method is used to instantiate an ISOAbstractObject
print()Provides a custom print output (as tree) of the current class
decode(xml)Decodes a ISOMetadata* R6 object from XML representation
encode(addNS, validate, strict, inspire, inspireValidator, resetSerialID, setSerialID, encoding)Encodes a ISOMetadata* R6 object to XML representation. 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
validate(xml, strict, inspire, inspireValidator)Validates the encoded XML against ISO 19139 XML schemas. If strict is
TRUE, a error will be raised. Default is FALSE.
Setting inspire toTRUE (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
save(file, ...)Saves the current metadata object XML representation to a file. This utility
ensures proper indentation of XML file produced. Additional parameters from
$encode() method can be specified, such as inspire to check
the INSPIRE metadata validity.
getNamespaceDefinition(recursive)Gets the namespace definition of the current ISO* class. By default, only
the namespace definition of the current element is retrieved (recursive = FALSE).
getClassName(level)Gets the class name. The level of class inheritance. Default is 1L
getClass()Gets the class
wrapBaseElement(field, fieldObj)Wraps a base element type
setIsNull(isNull, reason)Sets the object as null object for the XML. In case isNull is TRUE,
a reason should be specified among values 'inapplicable', 'missing', 'template',
'unknown', 'withheld'. By default, the reason is set 'missing'.
contains(field, metadataElement)Indicates of the present class object contains an metadata element object for a particular list-based field.
addListElement(field, metadataElement)Adds a metadata element to a list-based field. Returns TRUE if the element has been added, FALSE otherwise. In case an element is already added, the element will not be added and this method will return FALSE.
delListElement(field, metadataElement)Deletes a metadata element from a list-based field. Returns TRUE if the element has been deleted, FALSE otherwise. In case an element is abstent, this method will return FALSE.
setAttr(attrKey, attrValue)Set an attribute
addFieldAttrs(field, ...)Allows to add one more xlink attributes a field (element property)
setId(id, addNS)Set an id. By default addNS is FALSE (no namespace prefix added).
setHref(href)Sets an href reference
setCodeList(codeList)Sets a codeList
setCodeListValue(codeListValue)Sets a codeList value
setCodeSpace(codeSpace)Set a codeSpace
setValue(value)Set a value
isDocument()Indicates if the object is a metadata document, typically an object of class
ISOMetadata or ISOFeatureCatalogue
isFieldInheritedFrom(field)Gives the parent from which the field is inherited, otherwise return NULL.
createLocalisedProperty(text, locales)Creates a localised property made of a default text and a list of localised texts.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
geometa::geometaLogger -> ISOAbstractObject
wrapwrap
elementelement
namespacenamespace
defaultsdefaults
attrsattributes
printAttrsattributes to print
parentAttrsparent attributes
valuevalue
value_as_fieldvalue as field?
isNullis null?
anyElementany element?
new()Initializes object
ISOAbstractObject$new(
xml = NULL,
element = NULL,
namespace = NULL,
attrs = list(),
defaults = list(),
wrap = TRUE,
value_as_field = FALSE
)xmlobject of class XMLInternalNode-class
elementelement name
namespacenamespace
attrsattrs
defaultsdefaults
wrapwrap?
value_as_fieldvalue as field?
print()Provides a custom print output (as tree) of the current class
ISOAbstractObject$print(..., depth = 1)...args
depthclass nesting depth
decode()Decodes object from XML
ISOAbstractObject$decode(xml)xmlobject 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"
)addNSadd namespace? Default is TRUE
validatevalidate XML output against schemas?
strictstrict validation? Default is FALSE.
inspireperform INSPIRE validation? Default is FALSE
inspireValidatoran object of class INSPIREMetadataValidator to perform INSPIRE metadata validation
resetSerialIDreset Serial ID? Default is TRUE
setSerialIDset serial ID? Default is TRUE
encodingencoding. Default is UTF-8
validate()Validates an XML object resulting from object encoding
ISOAbstractObject$validate(
xml = NULL,
strict = FALSE,
inspire = FALSE,
inspireValidator = NULL
)xmlobject of class XMLInternalNode-class
strictstrict validation? If TRUE, a invalid XML will return an error
inspireperform INSPIRE validation? Default is FALSE
inspireValidatoran 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, ...)filefile
...any other argument from $encode(...) method
getNamespaceDefinition()Get namespace definition
ISOAbstractObject$getNamespaceDefinition(recursive = FALSE)recursiverecursive namespace definitions? Default is FALSE
the list of XML namespace definitions
getClassName()Get class name
ISOAbstractObject$getClassName(level = 1L)levellevel 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)fieldfield name
fieldObjfield object
anobject of class R6Class
setIsNull()Set Is Null
ISOAbstractObject$setIsNull(isNull, reason = "missing")isNullobject of class logical
reasonreason why object is Null
contains()Util to know if a field contain a metadata element
ISOAbstractObject$contains(field, metadataElement)fieldfield name
metadataElementmetadata 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)fieldfield
metadataElementmetadata 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)fieldfield
metadataElementmetadata element
TRUE if deleted, FALSE otherwise
setAttr()Util to set an attribute
ISOAbstractObject$setAttr(attrKey, attrValue)attrKeyattribute key
attrValueattribute value
addFieldAttrs()Util add field attributes, over the XML field wrapping element instead of the element itself
ISOAbstractObject$addFieldAttrs(field, ...)fieldfield
...list of attributes
setId()Set id
ISOAbstractObject$setId(id, addNS = FALSE)idid
addNSadd namespace definition? Default is FALSE
setHref()Set Href attribute
ISOAbstractObject$setHref(href)hrefhref
setCodeList()Set codelist attribute
ISOAbstractObject$setCodeList(codeList)codeListcodelist
setCodeListValue()Set codelist value
ISOAbstractObject$setCodeListValue(codeListValue)codeListValuecodelist value
setCodeSpace()Set codeSpace
ISOAbstractObject$setCodeSpace(codeSpace)codeSpacecodespace
setValue()Set value
ISOAbstractObject$setValue(value)valuevalue
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)fieldfield
an object generator of class R6Class
createLocalisedProperty()Creates a localised property
ISOAbstractObject$createLocalisedProperty(text, locales)texttext
localesa list of localized names