Class: OaiPmh::Metadata::OaiDc

Inherits:
Object
  • Object
show all
Defined in:
lib/oaipmh/metadata/oai_dc.rb

Constant Summary collapse

DEFAULTS =

Defaults

{:prefix => 'oai_dc',
 :schema => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd',
 :namespace =>  'http://www.language-archives.org/OLAC/0.2/',
 :element_ns => 'dc',
 :fields => %w(title creator subject description publisher
               contributor date type format identifier
               source language relation coverage rights)
}

Class Method Summary collapse

Class Method Details

.header(xml) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oaipmh/metadata/oai_dc.rb', line 60

def header(xml)
  xml.tag!('oai_dc:dc',
    'xmlns:oai_dc' => "http://www.openarchives.org/OAI/2.0/oai_dc/",
    'xmlns:dc' => "http://purl.org/dc/elements/1.1/",
    'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
    'xsi:schemaLocation' => 
      %{http://www.openarchives.org/OAI/2.0/oai_dc/ 
        http://www.openarchives.org/OAI/2.0/oai_dc.xsd}) do
    yield xml
  end
end

.to_sObject



72
73
74
# File 'lib/oaipmh/metadata/oai_dc.rb', line 72

def to_s
  DEFAULTS[:prefix]
end

.validate(document) ⇒ Object

Raises:

  • (RuntimeError)


76
77
78
# File 'lib/oaipmh/metadata/oai_dc.rb', line 76

def validate(document)
  raise RuntimeError, "Validation not yet implemented."
end