Skip to content

Commit

Permalink
Re-organize ucla-metadata.rb and check data against doc (#851)
Browse files Browse the repository at this point in the history
Changes to be committed:
modified:   app/models/ucla_metadata.rb
modified:   spec/system/import_and_show_work_spec.rb
  • Loading branch information
jendiamond authored Sep 22, 2020
1 parent 4cda04e commit 11077f7
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 112 deletions.
232 changes: 122 additions & 110 deletions app/models/ucla_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,272 +3,284 @@ module UclaMetadata
extend ActiveSupport::Concern

included do
property :access_copy, predicate: ::RDF::URI.intern('http://www.europeana.eu/schemas/edm/object'), multiple: false do |index|
property :ark, predicate: ::RDF::Vocab::DC11.identifier, multiple: false do |index|
index.as :stored_sortable
end

# Item Overview
property :alternative_title, predicate: ::RDF::Vocab::DC.alternative, multiple: true do |index|
index.as :stored_searchable
end

property :ark, predicate: ::RDF::Vocab::DC11.identifier, multiple: false do |index|
index.as :stored_sortable
property :uniform_title, predicate: ::RDF::URI.intern('http://purl.org/dc/elements/1.1/title') do |index|
index.as :stored_searchable, :facetable
end

property :architect, predicate: ::RDF::Vocab::MARCRelators.arc do |index|
property :creator, predicate: ::RDF::URI.intern('http://purl.org/dc/elements/1.1/creator') do |index|
index.as :stored_searchable, :facetable
end

property :author, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/aut') do |index|
index.as :stored_searchable, :facetable
end

property :binding_note, predicate: ::RDF::URI.intern('http://marc21rdf.info/elements/5XX/M563__a'), multiple: false do |index|
index.as :stored_sortable
property :editor, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/edt') do |index|
index.as :stored_searchable, :facetable
end

property :caption, predicate: ::RDF::Vocab::SCHEMA.caption do |index|
index.as :stored_searchable
property :photographer, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/pht.html') do |index|
index.as :stored_searchable, :facetable
end

property :calligrapher, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cll') do |index|
property :architect, predicate: ::RDF::Vocab::MARCRelators.arc do |index|
index.as :stored_searchable, :facetable
end

property :collation, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3077'), multiple: false do |index|
index.as :stored_sortable
property :illuminator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/ilu') do |index|
index.as :stored_searchable, :facetable
end

property :condition_note, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3035'), multiple: false do |index|
index.as :stored_sortable
property :illustrator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/ill.html') do |index|
index.as :stored_searchable, :facetable
end

property :contents_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/contentsNote') do |index|
index.as :stored_searchable
property :engraver, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/egr') do |index|
index.as :stored_searchable, :facetable
end

property :colophon, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/Production') do |index|
index.as :stored_searchable
property :printmaker, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/prm') do |index|
index.as :stored_searchable, :facetable
end

property :commentator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cmm') do |index|
property :scribe, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/scr') do |index|
index.as :stored_searchable, :facetable
end

property :composer, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cmp') do |index|
property :translator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/trl') do |index|
index.as :stored_searchable, :facetable
end

property :dimensions, predicate: ::RDF::Vocab::MODS.physicalExtent do |index|
property :rubricator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/rbr') do |index|
index.as :stored_searchable, :facetable
end

property :dlcs_collection_name, predicate: ::RDF::URI.intern('https://bib.schema.org/Collection') do |index|
index.as :displayable, :facetable
property :calligrapher, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cll') do |index|
index.as :stored_searchable, :facetable
end

property :editor, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/edt') do |index|
property :commentator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cmm') do |index|
index.as :stored_searchable, :facetable
end

property :engraver, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/egr') do |index|
property :lyricist, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/lyr') do |index|
index.as :stored_searchable, :facetable
end

property :extent, predicate: ::RDF::Vocab::DC11.format do |index|
property :composer, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/cmp') do |index|
index.as :stored_searchable, :facetable
end

property :featured_image, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3080'), multiple: false do |index|
index.as :stored_sortable
property :normalized_date, predicate: ::RDF::Vocab::DC11.date do |index|
index.as :stored_searchable, :facetable
end

property :finding_aid_url, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/findingAid') do |index|
index.as :displayable
property :place_of_origin, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/prp.html') do |index|
index.as :stored_searchable, :facetable
end

property :foliation, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3076'), multiple: false do |index|
index.as :stored_sortable
property :publisher, predicate: ::RDF::URI.intern('http://purl.org/dc/elements/1.1/publisher') do |index|
index.as :stored_searchable
end

property :funding_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/fundingInformation') do |index|
# Notes
property :summary, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/Summary') do |index|
index.as :stored_searchable
end

property :genre, predicate: ::RDF::Vocab::EDM.hasType do |index|
index.as :stored_searchable, :facetable
property :caption, predicate: ::RDF::Vocab::SCHEMA.caption do |index|
index.as :stored_searchable
end

property :iiif_manifest_url, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#Manifest'), multiple: false do |index|
index.as :stored_sortable
property :provenance, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/provenance') do |index|
index.as :stored_searchable
end

property :iiif_range, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#Range'), multiple: false do |index|
index.as :stored_sortable
property :contents_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/contentsNote') do |index|
index.as :stored_searchable
end

property :iiif_text_direction, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#viewingDirection'), multiple: false do |index|
index.as :stored_sortable
property :colophon, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/Production') do |index|
index.as :stored_searchable
end

property :iiif_viewing_hint, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#ViewingHint'), multiple: false do |index|
index.as :stored_sortable
property :note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/lite/note') do |index|
index.as :stored_searchable
end

property :illuminator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/ilu') do |index|
property :toc, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/tableOfContents') do |index|
index.as :stored_searchable
end

# Physical Description
property :extent, predicate: ::RDF::Vocab::DC11.format do |index|
index.as :stored_searchable, :facetable
end

property :illustrations_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/illustrations') do |index|
index.as :stored_searchable
property :dimensions, predicate: ::RDF::Vocab::MODS.physicalExtent do |index|
index.as :stored_searchable, :facetable
end

property :illustrator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/ill.html') do |index|
property :support, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/BaseMaterial') do |index|
index.as :stored_searchable, :facetable
end

property :latitude, predicate: ::RDF::Vocab::EXIF.gpsLatitude do |index|
index.as :stored_searchable
property :medium, predicate: ::RDF::Vocab::DC.medium do |index|
index.as :stored_searchable, :facetable
end

property :latitude, predicate: ::RDF::Vocab::EXIF.gpsLatitude do |index|
index.as :stored_searchable
property :page_layout, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe.html#p_layout') do |index|
index.as :symbol
end

property :local_identifier, predicate: ::RDF::Vocab::Identifiers.local do |index|
index.as :displayable, :facetable
property :binding_note, predicate: ::RDF::URI.intern('http://marc21rdf.info/elements/5XX/M563__a'), multiple: false do |index|
index.as :stored_sortable
end

# property :local_rights_statement, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/rights') do |index|
# index.as :symbol
# end # This invokes License renderer from hyrax gem
property :condition_note, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3035'), multiple: false do |index|
index.as :stored_sortable
end

property :location, predicate: ::RDF::Vocab::DC.coverage do |index|
index.as :stored_searchable, :facetable
property :collation, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3077'), multiple: false do |index|
index.as :stored_sortable
end

property :longitude, predicate: ::RDF::Vocab::EXIF.gpsLongitude do |index|
index.as :stored_searchable
property :foliation, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3076'), multiple: false do |index|
index.as :stored_sortable
end

property :lyricist, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/lyr') do |index|
index.as :stored_searchable, :facetable
property :illustrations_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/illustrations') do |index|
index.as :stored_searchable
end

property :masthead_parameters, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3078'), multiple: false do |index|
index.as :stored_sortable
# Keywords
property :genre, predicate: ::RDF::Vocab::EDM.hasType do |index|
index.as :stored_searchable, :facetable
end

property :medium, predicate: ::RDF::Vocab::DC.medium do |index|
property :subject_topic, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectTopic') do |index|
index.as :stored_searchable, :facetable
end

property :named_subject, predicate: ::RDF::Vocab::MODS.subjectName do |index|
index.as :stored_searchable, :facetable
end

property :normalized_date, predicate: ::RDF::Vocab::DC11.date do |index|
property :subject_geographic, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectGeographic') do |index|
index.as :stored_searchable, :facetable
end

property :note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/lite/note') do |index|
index.as :stored_searchable
property :subject_temporal, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectTemporal') do |index|
index.as :stored_searchable, :facetable
end

property :opac_url, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/unimarc/terms/ter%23e'), multiple: false do |index|
index.as :stored_sortable
property :location, predicate: ::RDF::Vocab::DC.coverage do |index|
index.as :stored_searchable, :facetable
end

property :page_layout, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe.html#p_layout') do |index|
index.as :symbol
property :latitude, predicate: ::RDF::Vocab::EXIF.gpsLatitude do |index|
index.as :stored_searchable
end

property :photographer, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/pht.html') do |index|
index.as :stored_searchable, :facetable
property :longitude, predicate: ::RDF::Vocab::EXIF.gpsLongitude do |index|
index.as :stored_searchable
end

property :place_of_origin, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/prp.html') do |index|
index.as :stored_searchable, :facetable
# Find This Item
property :repository, predicate: ::RDF::Vocab::MODS.locationCopySublocation do |index|
index.as :stored_searchable
end

property :preservation_copy, predicate: ::RDF::URI.intern('https://pcdm.org/models#hasFile'), multiple: false do |index|
index.as :stored_sortable
property :local_identifier, predicate: ::RDF::Vocab::Identifiers.local do |index|
index.as :displayable, :facetable
end

property :printmaker, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/prm') do |index|
index.as :stored_searchable, :facetable
property :finding_aid_url, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/findingAid') do |index|
index.as :displayable
end

property :provenance, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/provenance') do |index|
index.as :stored_searchable
property :opac_url, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/unimarc/terms/ter%23e'), multiple: false do |index|
index.as :stored_sortable
end

property :repository, predicate: ::RDF::Vocab::MODS.locationCopySublocation do |index|
index.as :stored_searchable
# Access Condition
property :services_contact, predicate: ::RDF::Vocab::EBUCore.hasRightsContact do |index|
index.as :displayable
end

property :representative_image, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3079'), multiple: false do |index|
index.as :stored_sortable
property :rights_holder, predicate: ::RDF::Vocab::EBUCore.hasRightsHolder do |index|
index.as :stored_searchable
end

property :rights_country, predicate: ::RDF::Vocab::EBUCore.rightsType do |index|
index.as :stored_searchable
end

property :rights_holder, predicate: ::RDF::Vocab::EBUCore.hasRightsHolder do |index|
property :funding_note, predicate: ::RDF::URI.intern('http://bibfra.me/vocab/marc/fundingInformation') do |index|
index.as :stored_searchable
end

property :rubricator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/rbr') do |index|
index.as :stored_searchable, :facetable
property :access_copy, predicate: ::RDF::URI.intern('http://www.europeana.eu/schemas/edm/object'), multiple: false do |index|
index.as :stored_sortable
end

property :scribe, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/scr') do |index|
index.as :stored_searchable, :facetable
end
# ---------------

property :services_contact, predicate: ::RDF::Vocab::EBUCore.hasRightsContact do |index|
index.as :displayable
property :dlcs_collection_name, predicate: ::RDF::URI.intern('https://bib.schema.org/Collection') do |index|
index.as :displayable, :facetable
end

property :subject_topic, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectTopic') do |index|
index.as :stored_searchable
property :featured_image, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3080'), multiple: false do |index|
index.as :stored_sortable
end

property :subject_geographic, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectGeographic') do |index|
index.as :stored_searchable
property :iiif_manifest_url, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#Manifest'), multiple: false do |index|
index.as :stored_sortable
end

property :subject_temporal, predicate: ::RDF::URI.intern('http://www.loc.gov/mods/rdf/v1#subjectTemporal') do |index|
index.as :stored_searchable
property :iiif_range, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#Range'), multiple: false do |index|
index.as :stored_sortable
end

property :summary, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/Summary') do |index|
index.as :stored_searchable
property :iiif_text_direction, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#viewingDirection'), multiple: false do |index|
index.as :stored_sortable
end

property :support, predicate: ::RDF::URI.intern('http://id.loc.gov/ontologies/bibframe/BaseMaterial') do |index|
index.as :stored_searchable, :facetable
property :iiif_viewing_hint, predicate: ::RDF::URI.intern('http://iiif.io/api/presentation/2#ViewingHint'), multiple: false do |index|
index.as :stored_sortable
end

property :tagline, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3081'), multiple: false do |index|
property :masthead_parameters, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3078'), multiple: false do |index|
index.as :stored_sortable
end

property :toc, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/tableOfContents') do |index|
index.as :stored_searchable
property :preservation_copy, predicate: ::RDF::URI.intern('https://pcdm.org/models#hasFile'), multiple: false do |index|
index.as :stored_sortable
end

property :translator, predicate: ::RDF::URI.intern('http://id.loc.gov/vocabulary/relators/trl') do |index|
index.as :stored_searchable, :facetable
property :representative_image, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3079'), multiple: false do |index|
index.as :stored_sortable
end

property :uniform_title, predicate: ::RDF::URI.intern('http://purl.org/dc/elements/1.1/title') do |index|
index.as :stored_searchable, :facetable
property :tagline, predicate: ::RDF::URI.intern('http://iflastandards.info/ns/fr/frbr/frbrer/P3081'), multiple: false do |index|
index.as :stored_sortable
end
end
end

# property :local_rights_statement, predicate: ::RDF::URI.intern('http://purl.org/dc/terms/rights') do |index|
# index.as :symbol
# end # This invokes License renderer from hyrax gem

# https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer/DefaultDescriptors#simple-class_method
# displayable: https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer%2FDefaultDescriptors.displayable
# stored_searchable https://www.rubydoc.info/gems/solrizer/3.4.0/Solrizer%2FDefaultDescriptors.stored_searchable
Expand Down
Loading

0 comments on commit 11077f7

Please sign in to comment.