| ISOAbstractObject {geometa} | R Documentation |
ISOAbstractObject
Description
ISOAbstractObject
ISOAbstractObject
Format
R6Class object.
Value
Object of R6Class for modelling an ISO Metadata Element
Static Methods
getISOStandardByPrefix(prefix)-
Inherit the ISO (and/or OGC) standard reference for a given standard prefix (e.g. GMD). The object returned is a
data.framecontaining 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.framecontaining the specification reference and title. getISOClasses(extended, pretty)-
Get the list of classes supported by geometa. By default,
extendedis set toFALSE(restrained to geometa environment). IfTRUE, this allows to list eventual classes loaded in your global environment and that extend geometa classes. The argumentprettygives a the list of classes and associated ISO/OGC standard information asdata.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)
Super class
geometa::geometaLogger -> ISOAbstractObject
Public fields
wrapwrap
elementelement
namespacenamespace
defaultsdefaults
attrsattributes
printAttrsattributes to print
parentAttrsparent attributes
valuevalue
value_as_fieldvalue as field?
isNullis null?
anyElementany element?
Methods
Public methods
Inherited methods
Method new()
Initializes object
Usage
ISOAbstractObject$new( xml = NULL, element = NULL, namespace = NULL, attrs = list(), defaults = list(), wrap = TRUE, value_as_field = FALSE )
Arguments
xmlobject of class XMLInternalNode-class
elementelement name
namespacenamespace
attrsattrs
defaultsdefaults
wrapwrap?
value_as_fieldvalue as field?
Method print()
Provides a custom print output (as tree) of the current class
Usage
ISOAbstractObject$print(..., depth = 1, add_codelist_description = TRUE)
Arguments
...args
depthclass nesting depth
add_codelist_descriptionAdd codelist description. Default is
TRUE
Method decode()
Decodes object from XML
Usage
ISOAbstractObject$decode(xml)
Arguments
xmlobject of class XMLInternalNode-class
Method 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
Usage
ISOAbstractObject$encode( addNS = TRUE, validate = TRUE, strict = FALSE, inspire = FALSE, inspireValidator = NULL, resetSerialID = TRUE, setSerialID = TRUE, encoding = "UTF-8" )
Arguments
addNSadd namespace? Default is
TRUEvalidatevalidate XML output against schemas?
strictstrict validation? Default is
FALSE.inspireperform INSPIRE validation? Default is
FALSEinspireValidatoran object of class INSPIREMetadataValidator to perform INSPIRE metadata validation
resetSerialIDreset Serial ID? Default is
TRUEsetSerialIDset serial ID? Default is
TRUEencodingencoding. Default is
UTF-8
Method validate()
Validates an XML object resulting from object encoding
Usage
ISOAbstractObject$validate( xml = NULL, strict = FALSE, inspire = FALSE, inspireValidator = NULL )
Arguments
xmlobject of class XMLInternalNode-class
strictstrict validation? If
TRUE, a invalid XML will return an errorinspireperform INSPIRE validation? Default is
FALSEinspireValidatoran object of class INSPIREMetadataValidator to perform INSPIRE metadata validation
Returns
TRUE if valid, FALSE otherwise
Method save()
Save XML representation resulting from $encode(...) method to a file
Usage
ISOAbstractObject$save(file, ...)
Arguments
filefile
...any other argument from
$encode(...)method
Method getNamespaceDefinition()
Get namespace definition
Usage
ISOAbstractObject$getNamespaceDefinition(recursive = FALSE)
Arguments
recursiverecursive namespace definitions? Default is
FALSE
Returns
the list of XML namespace definitions
Method getClassName()
Get class name
Usage
ISOAbstractObject$getClassName(level = 1L)
Arguments
levellevel of class
Returns
the class name
Method getClass()
Get class
Usage
ISOAbstractObject$getClass()
Returns
the corresponding class, as R6Class reference object generator
Method wrapBaseElement()
Wraps base element
Usage
ISOAbstractObject$wrapBaseElement(field, fieldObj)
Arguments
fieldfield name
fieldObjfield object
anobject of class R6Class
Method setIsNull()
Set Is Null
Usage
ISOAbstractObject$setIsNull(isNull, reason = "missing")
Arguments
isNullobject of class logical
reasonreason why object is Null
Method contains()
Util to know if a field contain a metadata element
Usage
ISOAbstractObject$contains(field, metadataElement)
Arguments
fieldfield name
metadataElementmetadata element
Returns
TRUE if contains, FALSE otherwise
Method addListElement()
Util to add an element to a list of elements for N cardinality of a target element name
Usage
ISOAbstractObject$addListElement(field, metadataElement)
Arguments
fieldfield
metadataElementmetadata element
Returns
TRUE if added, FALSE otherwise
Method delListElement()
Util to deleted an element to a list of elements for N cardinality of a target element name
Usage
ISOAbstractObject$delListElement(field, metadataElement)
Arguments
fieldfield
metadataElementmetadata element
Returns
TRUE if deleted, FALSE otherwise
Method setAttr()
Util to set an attribute
Usage
ISOAbstractObject$setAttr(attrKey, attrValue)
Arguments
attrKeyattribute key
attrValueattribute value
Method addFieldAttrs()
Util add field attributes, over the XML field wrapping element instead of the element itself
Usage
ISOAbstractObject$addFieldAttrs(field, ...)
Arguments
fieldfield
...list of attributes
Method setId()
Set id
Usage
ISOAbstractObject$setId(id, addNS = FALSE)
Arguments
idid
addNSadd namespace definition? Default is
FALSE
Method setHref()
Set Href attribute
Usage
ISOAbstractObject$setHref(href)
Arguments
hrefhref
Method setCodeList()
Set codelist attribute
Usage
ISOAbstractObject$setCodeList(codeList)
Arguments
codeListcodelist
Method setCodeListValue()
Set codelist value
Usage
ISOAbstractObject$setCodeListValue(codeListValue)
Arguments
codeListValuecodelist value
Method setCodeSpace()
Set codeSpace
Usage
ISOAbstractObject$setCodeSpace(codeSpace)
Arguments
codeSpacecodespace
Method setValue()
Set value
Usage
ISOAbstractObject$setValue(value)
Arguments
valuevalue
Method isDocument()
Util to check where object refers to a emetadata document (eg. ISOMetadata or ISOFeatureCatalogue)
Usage
ISOAbstractObject$isDocument()
Returns
TRUE if a document, FALSE otherwise
Method isFieldInheritedFrom()
Indicates the class a field inherits from
Usage
ISOAbstractObject$isFieldInheritedFrom(field)
Arguments
fieldfield
Returns
an object generator of class R6Class
Method createLocalisedProperty()
Creates a localised property
Usage
ISOAbstractObject$createLocalisedProperty(text, locales)
Arguments
texttext
localesa list of localized names
Note
Abstract ISO Metadata class used internally by geometa
Author(s)
Emmanuel Blondel <emmanuel.blondel1@gmail.com>