app/views/manifestations/_show.rdf.builder in enju_biblio-0.1.0.pre38 vs app/views/manifestations/_show.rdf.builder in enju_biblio-0.1.0.pre39

- old
+ new

@@ -1,64 +1,90 @@ -xml.dcndl :BibResource do - xml.rdf :Description, 'rdf:about' => manifestation_url(manifestation) do - if manifestation.identifier_contents(:nbn).first - xml.dcterms :identifier, manifestation.identifier_contents(:nbn).first, 'rdf:datatype' => 'http://ndl.go.jp/dcndl/terms/JPNO' - - xml.rdfs :seeAlso, 'rdf:resource' => "http://id.ndl.go.jp/jpno/#{manifestation.identifier_contents(:nbn).first}" - end - manifestation.identifier_contents(:isbn).each do |i| - xml.dcterms :identifier, i, 'rdf:datatype' => 'http://ndl.go.jp/dcndl/terms/ISBN' - xml.rdfs :seeAlso, 'rdf:resource' => "http://iss.ndl.go.jp/isbn/#{i}" - end - xml.dcterms :title, manifestation.original_title - xml.dc :title do - xml.rdf :Description do - xml.rdf :value, manifestation.original_title - xml.dcndl :transcription, manifestation.title_transcription + xml.titleInfo{ + xml.title manifestation.original_title + } + xml.titleInfo('type' => 'alternative'){ + xml.title manifestation.title_alternative + } + manifestation.creators.readable_by(current_user).each do |creator| + case creator.patron_type.name + when "Person" + xml.name('type' => 'personal'){ + xml.namePart creator.full_name + xml.namePart creator.date if creator.date + xml.role do + xml.roleTerm "creator", 'type' => 'text', 'authority' => 'marcrelator' + end + } + when "CorporateBody" + xml.name('type' => 'corporate'){ + xml.namePart creator.full_name + xml.role do + xml.roleTerm "creator", 'type' => 'text', 'authority' => 'marcrelator' + end + } + when "Conference" + xml.name('type' => 'conference'){ + xml.namePart creator.full_name + xml.role do + xml.roleTerm "creator", 'type' => 'text', 'authority' => 'marcrelator' + end + } end end - if manifestation.title_alternative - xml.dcndl :alternative do - xml.rdf :Description do - xml.rdf :value, manifestation.title_alternative - end + manifestation.contributors.readable_by(current_user).each do |contributor| + case contributor.patron_type.name + when "Person" + xml.name('type' => 'personal'){ + xml.namePart contributor.full_name + xml.namePart contributor.date if contributor.date + } + when "CorporateBody" + xml.name('type' => 'corporate'){ + xml.namePart contributor.full_name + } + when "Conference" + xml.name('type' => 'conference'){ + xml.namePart contributor.full_name + } end end - if manifestation.volume_number_string? - xml.dcndl :volume do - xml.rdf :Description do - xml.rdf :value, manifestation.volume_number_string - end + xml.typeOfResource manifestation.carrier_type.mods_type + xml.originInfo{ + manifestation.publishers.readable_by(current_user).each do |patron| + xml.publisher patron.full_name end - end - if manifestation.edition_string? - xml.dcndl :edition do - xml.rdf :Description do - xml.rdf :value, manifestation.edition_string + xml.dateIssued manifestation.date_of_publication + xml.frequency manifestation.frequency.name + } + xml.language{ + xml.languageTerm manifestation.language.iso_639_2, 'authority' => 'iso639-2b', 'type' => 'code' if manifestation.language + } + xml.physicalDescription{ + xml.form manifestation.carrier_type.name, 'authority' => 'marcform' + extent = [] + extent << manifestation.number_of_pages if manifestation.number_of_pages + extent << manifestation.height if manifestation.height + xml.extent extent.join("; ") + } + if defined?(EnjuSubject) + xml.subject{ + manifestation.subjects.each do |subject| + xml.topic subject.term end + } + manifestation.subjects.collect(&:classifications).flatten.each do |classification| + xml.classification classification.category, 'authority' => classification.classification_type.name end end - manifestation.creators.each do |creator| - xml.dcterms :creator do - xml.foaf :Agent do - xml.foaf :name, creator.full_name - xml.dcndl :transcription, creator.full_name_transcription - end - end - xml.dc :creator, creator.full_name + xml.abstract manifestation.description + xml.note manifestation.note + manifestation.identifier_content(:isbn).each do |i| + xml.identifier i, :type => 'isbn' end - manifestation.publishers.each do |publisher| - xml.dcterms :publisher do - xml.foaf :Agent do - xml.foaf :name, publisher.full_name - xml.dcndl :transcription, publisher.full_name_transcription - xml.dcndl :location, publisher.address_1 - end - end - xml.dcndl :publicationPlace, publisher.country.alpha_2.downcase, 'rdf:datatype' => 'http://purl.org/dc/terms/ISO3166' + manifestation.identifier_content(:lccn).each do |l| + xml.identifier l, :type => 'lccn' end - xml.dcterms :language, manifestation.language.iso_639_2, 'rdf:datatype' => "http://purl.org/dc/terms/ISO639-2" if manifestation.language - xml.dcterms :date, manifestation.pub_date - xml.dcterms :issued, manifestation.date_of_publication.try(:year), 'rdf:datatype' => "http://purl.org/dc/terms/W3CDTF" - xml.dcndl :price, manifestation.price - end -end + xml.recordInfo{ + xml.recordCreationDate manifestation.created_at + xml.recordChangeDate manifestation.updated_at + xml.recordIdentifier manifestation_url(manifestation) + }