ddr-models 2.10.2 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ddr/index/fields.rb +2 -0
- data/lib/ddr/models/indexing.rb +2 -0
- data/lib/ddr/models/media_type.rb +1 -1
- data/lib/ddr/models/version.rb +1 -1
- data/lib/ddr/vocab/sources/duketerms.rdf +22 -8
- data/spec/index/fields_spec.rb +12 -0
- data/spec/models/indexing_spec.rb +4 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5c0cafdcf29bd75b099189bf2fecd845ad1c48c1
         | 
| 4 | 
            +
              data.tar.gz: 73ad12db1e93d79a38cc79d7c32edf5d36b56fdc
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2f8ce7356cb93d87c3dbb7e524ae56bfdc8407df47a807d1384e35dd3c1cfbf07690a51f9ba1dfc75280ef253784667d5273af26e255def99963ed8c95cf5692
         | 
| 7 | 
            +
              data.tar.gz: a6d8d82f224a3cce762f4b93076fdd69b35f5f9fcc0686ce19028f58837a0a64add408a3eaf1607e906049b2800c140079218d6e87f27342a16a97d6e7431507
         | 
    
        data/lib/ddr/index/fields.rb
    CHANGED
    
    | @@ -17,8 +17,10 @@ module Ddr::Index | |
| 17 17 | 
             
                ASPACE_ID                   = Field.new :aspace_id, :stored_sortable
         | 
| 18 18 | 
             
                ATTACHED_FILES_HAVING_CONTENT =
         | 
| 19 19 | 
             
                  Field.new :attached_files_having_content, :symbol
         | 
| 20 | 
            +
                BIBLICAL_BOOK_FACET         = Field.new :biblical_book_facet, :facetable
         | 
| 20 21 | 
             
                BOX_NUMBER_FACET            = Field.new :box_number_facet, :facetable
         | 
| 21 22 | 
             
                CATEGORY_FACET              = Field.new :category_facet, :facetable
         | 
| 23 | 
            +
                CHAPTER_AND_VERSE_FACET     = Field.new :chapter_and_verse_facet, :facetable
         | 
| 22 24 | 
             
                COLLECTION_FACET            = Field.new :collection_facet, :facetable
         | 
| 23 25 | 
             
                COLLECTION_TITLE            = Field.new :collection_title, :stored_sortable
         | 
| 24 26 | 
             
                COLLECTION_URI              = Field.new :collection_uri, :symbol
         | 
    
        data/lib/ddr/models/indexing.rb
    CHANGED
    
    | @@ -25,8 +25,10 @@ module Ddr::Models | |
| 25 25 | 
             
                    ARRANGER_FACET          => desc_metadata_values('arranger'),
         | 
| 26 26 | 
             
                    ASPACE_ID               => aspace_id,
         | 
| 27 27 | 
             
                    ATTACHED_FILES_HAVING_CONTENT => attached_files_having_content.keys,
         | 
| 28 | 
            +
                    BIBLICAL_BOOK_FACET     => desc_metadata_values('biblical_book'),
         | 
| 28 29 | 
             
                    BOX_NUMBER_FACET        => desc_metadata_values('box_number'),
         | 
| 29 30 | 
             
                    CATEGORY_FACET          => desc_metadata_values('category'),
         | 
| 31 | 
            +
                    CHAPTER_AND_VERSE_FACET => desc_metadata_values('chapter_and_verse'),
         | 
| 30 32 | 
             
                    COLLECTION_TITLE        => collection_title,
         | 
| 31 33 | 
             
                    COMPANY_FACET           => desc_metadata_values('company'),
         | 
| 32 34 | 
             
                    COMPOSER_FACET          => desc_metadata_values('composer'),
         | 
| @@ -4,7 +4,7 @@ module Ddr::Models | |
| 4 4 | 
             
                def self.call(file_or_path)
         | 
| 5 5 | 
             
                  path = file_or_path.respond_to?(:path) ? file_or_path.path : file_or_path
         | 
| 6 6 | 
             
                  # Use preferred media type, if available
         | 
| 7 | 
            -
                  media_type = Ddr::Models.preferred_media_types[File.extname(path)]
         | 
| 7 | 
            +
                  media_type = Ddr::Models.preferred_media_types[(File.extname(path)).downcase]
         | 
| 8 8 | 
             
                  if !media_type
         | 
| 9 9 | 
             
                    if file_or_path.respond_to?(:content_type)
         | 
| 10 10 | 
             
                      # Rails ActionDispatch::Http::UploadedFile
         | 
    
        data/lib/ddr/models/version.rb
    CHANGED
    
    
| @@ -843,14 +843,28 @@ | |
| 843 843 | 
             
                    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/IsPartOf"/>
         | 
| 844 844 | 
             
                </rdf:Description>
         | 
| 845 845 |  | 
| 846 | 
            +
                <rdf:Description rdf:about="http://library.duke.edu/metadata/terms/biblical_book">
         | 
| 847 | 
            +
                    <rdfs:label xml:lang="en-US">Biblical Book</rdfs:label>
         | 
| 848 | 
            +
                    <rdfs:comment xml:lang="en-US"></rdfs:comment>
         | 
| 849 | 
            +
                    <dcterms:description xml:lang="en-US">Recommended best practice is to </dcterms:description>
         | 
| 850 | 
            +
                    <rdfs:isDefinedBy rdf:resource="http://purl.org/dc/terms/"/>
         | 
| 851 | 
            +
                    <dcterms:issued>2018-06-01</dcterms:issued>
         | 
| 852 | 
            +
                    <dcterms:modified>2018-06-01</dcterms:modified>
         | 
| 853 | 
            +
                    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
         | 
| 854 | 
            +
                    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
         | 
| 855 | 
            +
                    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/subject"/>
         | 
| 856 | 
            +
                </rdf:Description>
         | 
| 846 857 |  | 
| 847 | 
            -
             | 
| 848 | 
            -
             | 
| 849 | 
            -
             | 
| 850 | 
            -
             | 
| 851 | 
            -
             | 
| 852 | 
            -
             | 
| 853 | 
            -
             | 
| 854 | 
            -
             | 
| 858 | 
            +
                <rdf:Description rdf:about="http://library.duke.edu/metadata/terms/chapter_and_verse">
         | 
| 859 | 
            +
                    <rdfs:label xml:lang="en-US">Chapter and Verse</rdfs:label>
         | 
| 860 | 
            +
                    <rdfs:comment xml:lang="en-US"></rdfs:comment>
         | 
| 861 | 
            +
                    <dcterms:description xml:lang="en-US">Recommended best practice is to </dcterms:description>
         | 
| 862 | 
            +
                    <rdfs:isDefinedBy rdf:resource="http://purl.org/dc/terms/"/>
         | 
| 863 | 
            +
                    <dcterms:issued>2018-06-01</dcterms:issued>
         | 
| 864 | 
            +
                    <dcterms:modified>2018-06-01</dcterms:modified>
         | 
| 865 | 
            +
                    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"/>
         | 
| 866 | 
            +
                    <rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Class"/>
         | 
| 867 | 
            +
                    <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/terms/subject"/>
         | 
| 868 | 
            +
                </rdf:Description>
         | 
| 855 869 |  | 
| 856 870 | 
             
            </rdf:RDF>
         | 
    
        data/spec/index/fields_spec.rb
    CHANGED
    
    | @@ -63,12 +63,24 @@ module Ddr::Index | |
| 63 63 | 
             
                    its(:heading) { is_expected.to eq "aspace_id" }
         | 
| 64 64 | 
             
                  end
         | 
| 65 65 |  | 
| 66 | 
            +
                  describe "BIBLICAL_BOOK_FACET" do
         | 
| 67 | 
            +
                    subject { Fields::BIBLICAL_BOOK_FACET }
         | 
| 68 | 
            +
                    its(:label) { is_expected.to eq "Biblical Book Facet" }
         | 
| 69 | 
            +
                    its(:heading) { is_expected.to eq "biblical_book_facet" }
         | 
| 70 | 
            +
                  end
         | 
| 71 | 
            +
             | 
| 66 72 | 
             
                  describe "CATEGORY_FACET" do
         | 
| 67 73 | 
             
                    subject { Fields::CATEGORY_FACET }
         | 
| 68 74 | 
             
                    its(:label) { is_expected.to eq "Category Facet" }
         | 
| 69 75 | 
             
                    its(:heading) { is_expected.to eq "category_facet" }
         | 
| 70 76 | 
             
                  end
         | 
| 71 77 |  | 
| 78 | 
            +
                  describe "CHAPTER_AND_VERSE_FACET" do
         | 
| 79 | 
            +
                    subject { Fields::CHAPTER_AND_VERSE_FACET }
         | 
| 80 | 
            +
                    its(:label) { is_expected.to eq "Chapter And Verse Facet" }
         | 
| 81 | 
            +
                    its(:heading) { is_expected.to eq "chapter_and_verse_facet" }
         | 
| 82 | 
            +
                  end
         | 
| 83 | 
            +
             | 
| 72 84 | 
             
                  describe "COMPANY_FACET" do
         | 
| 73 85 | 
             
                    subject { Fields::COMPANY_FACET }
         | 
| 74 86 | 
             
                    its(:label) { is_expected.to eq "Company Facet" }
         | 
| @@ -26,7 +26,9 @@ module Ddr::Models | |
| 26 26 | 
             
                    obj.rights_note = ["Public domain"]
         | 
| 27 27 | 
             
                    obj.roles.grant role1, role2, role3, role4
         | 
| 28 28 | 
             
                    obj.set_desc_metadata_values(:arranger, "Arranger Value")
         | 
| 29 | 
            +
                    obj.set_desc_metadata_values(:biblical_book, "Ecclesiastes")
         | 
| 29 30 | 
             
                    obj.set_desc_metadata_values(:category, "Category Value")
         | 
| 31 | 
            +
                    obj.set_desc_metadata_values(:chapter_and_verse, "Ecclesiastes 3:19-4:3")
         | 
| 30 32 | 
             
                    obj.set_desc_metadata_values(:company, "Company Value")
         | 
| 31 33 | 
             
                    obj.set_desc_metadata_values(:composer, "Composer Value")
         | 
| 32 34 | 
             
                    obj.set_desc_metadata_values(:engraver, "Engraver Value")
         | 
| @@ -62,7 +64,9 @@ module Ddr::Models | |
| 62 64 | 
             
                    expect(subject[Indexing::ALEPH_ID]).to eq "lkheajklfwbsef"
         | 
| 63 65 | 
             
                    expect(subject[Indexing::ARRANGER_FACET]).to eq(["Arranger Value"])
         | 
| 64 66 | 
             
                    expect(subject[Indexing::ASPACE_ID]).to eq("aspace_dccea43034e1b8261e14cf999e86449d")
         | 
| 67 | 
            +
                    expect(subject[Indexing::BIBLICAL_BOOK_FACET]).to eq(["Ecclesiastes"])
         | 
| 65 68 | 
             
                    expect(subject[Indexing::CATEGORY_FACET]).to eq(["Category Value"])
         | 
| 69 | 
            +
                    expect(subject[Indexing::CHAPTER_AND_VERSE_FACET]).to eq(["Ecclesiastes 3:19-4:3"])
         | 
| 66 70 | 
             
                    expect(subject[Indexing::COMPANY_FACET]).to eq(["Company Value"])
         | 
| 67 71 | 
             
                    expect(subject[Indexing::COMPOSER_FACET]).to eq(["Composer Value"])
         | 
| 68 72 | 
             
                    expect(subject[Indexing::DC_IS_PART_OF]).to eq(["RL10059CS1010"])
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: ddr-models
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2. | 
| 4 | 
            +
              version: 2.11.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jim Coble
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2018- | 
| 12 | 
            +
            date: 2018-06-18 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: rails
         |