Class: DiscoveryIndexer::InputXml::PurlxmlParserStrict
- Inherits:
-
Object
- Object
- DiscoveryIndexer::InputXml::PurlxmlParserStrict
- Includes:
- Logging
- Defined in:
- lib/discovery-indexer/reader/purlxml_parser_strict.rb
Constant Summary collapse
- RDF_NAMESPACE =
'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
- OAI_DC_NAMESPACE =
'http://www.openarchives.org/OAI/2.0/oai_dc/'
- MODS_NAMESPACE =
'http://www.loc.gov/mods/v3'
- FEDORA_NAMESPACE =
'info:fedora/fedora-system:def/relations-external#'
Instance Method Summary collapse
-
#initialize(druid, purlxml_ng_doc) ⇒ PurlxmlParserStrict
constructor
A new instance of PurlxmlParserStrict.
-
#parse ⇒ PurlxmlModel
it parses the purlxml into a purlxml model.
Constructor Details
#initialize(druid, purlxml_ng_doc) ⇒ PurlxmlParserStrict
Returns a new instance of PurlxmlParserStrict.
11 12 13 14 |
# File 'lib/discovery-indexer/reader/purlxml_parser_strict.rb', line 11 def initialize(druid, purlxml_ng_doc) @purlxml_ng_doc = purlxml_ng_doc @druid = druid end |
Instance Method Details
#parse ⇒ PurlxmlModel
it parses the purlxml into a purlxml model
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/discovery-indexer/reader/purlxml_parser_strict.rb', line 18 def parse purlxml_model = PurlxmlModel.new purlxml_model.druid = @druid purlxml_model.public_xml = @purlxml_ng_doc purlxml_model. = purlxml_model. = purlxml_model. = purlxml_model.dc = parse_dc # why do we care? purlxml_model.rdf = parse_rdf purlxml_model.is_collection = parse_is_collection purlxml_model.collection_druids = parse_predicate_druids('isMemberOfCollection', FEDORA_NAMESPACE) purlxml_model.constituent_druids = parse_predicate_druids('isConstituentOf', FEDORA_NAMESPACE) purlxml_model.dor_content_type = parse_dor_content_type purlxml_model. = purlxml_model.file_ids = parse_file_ids purlxml_model.thumb = parse_thumb purlxml_model.encoded_thumb = parse_encoded_thumb purlxml_model.image_ids = parse_image_ids purlxml_model.sw_image_ids = parse_sw_image_ids purlxml_model.catkey = parse_catkey purlxml_model.previous_catkeys = parse_previous_catkeys purlxml_model. = purlxml_model.label = parse_label purlxml_model.copyright = parse_copyright purlxml_model.use_and_reproduction = parse_use_and_reproduction purlxml_model.source_id = parse_sourceid purlxml_model end |