Class: DwCR::Metaschema::Archive
- Inherits:
-
Sequel::Model
- Object
- Sequel::Model
- DwCR::Metaschema::Archive
- Includes:
- XMLParsable
- Defined in:
- lib/dwcr/metaschema/archive.rb
Overview
This class represents the DarwinCoreArchive’s meta.xml file
-
name
: the name for the DarwinCoreArchive the default is the directory name given in the path -
path
: the full path of the directory of the DarwinCoreArchives -
xmlns
: the XML Namespace default: ‘rs.tdwg.org/dwc/text/’ -
xmlns__xs
: the schema namespace prefix (xmlns:xs), default: ‘www.w3.org/2001/XMLSchema’ -
xmln__xsi
: schema instance namespace prefix (xmln:xsi), default: ‘www.w3.org/2001/XMLSchema-instance’ -
xsi__schema_location
(xsi:schemaLocation) default: ‘rs.tdwg.org/dwc/text/http://rs.tdwg.org/dwc/text/tdwg_dwc_text.xsd'
-
#entities: the associated Entity objects
-
#core: the associated Entity object that is the core node in the DwCA
Instance Method Summary collapse
-
#load_nodes_from(xml) ⇒ Object
Gets core and extension nodes from the xml calls #add_entity_from(xml) to create Entity instances to the Archive for every node adds the foreign key field (coreid) to any extension.
Methods included from XMLParsable
#default_from, #files_from, #index_from, #is_core_from, #key_column_from, load_meta, #method, #term_from, #update_from, validate_meta, #values_from
Instance Method Details
#load_nodes_from(xml) ⇒ Object
Gets core and extension nodes from the xml calls #add_entity_from(xml) to create Entity instances to the Archive for every node adds the foreign key field (coreid) to any extension
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/dwcr/metaschema/archive.rb', line 55 def load_nodes_from(xml) self.core = add_entity_from xml.css('core').first core.save xml.css('extension').each do |node| extn = add_entity_from node extn.add_attribute(name: 'coreid', index: index_from(node)) add_extension(extn) end save end |