pulibrary / plum

Plum: Hydra Head to support digitization workflows
Apache License 2.0
34 stars 12 forks source link

Missing data from Folder JSON-LD view #1396

Closed tpendragon closed 7 years ago

tpendragon commented 7 years ago

Can't do a conversion to the LAE solr schema because there's a bunch of info missing from the JSON-LD. Here's the test with comments:

require 'rails_helper'

RSpec.describe PlumJsonldConverter do
  subject(:converter) { described_class.new(jsonld: jsonld) }
  let(:jsonld) do
    '{"title":"Test Folder 1","@context":"https://bibdata.princeton.edu/context.json","@id":"https://hydra-dev.princeton.edu/concern/ephemera_folders/sx920fz824","memberOf":[{"@id":"https://hydra-dev.princeton.edu/collections/s8w32r7521","title":"Latin American Ephemera","@type":"pcdm:Collection"},{"@id":"https://hydra-dev.princeton.edu/collections/s8623j062b","title":"Box Number 1","@type":"pcdm:Collection"}],"edm_rights":{"@id":"http://rightsstatements.org/vocab/NKC/1.0/","@type":"dcterms:RightsStatement","pref_label":"No Known Copyright"},"@type":"pcdm:Object","alternative":["Alternative Title"],"creator":["Test Creator"],"contributor":["Test Contributor"],"publisher":["Test Publisher"],"identifier":["00000000000000"],"label":"Folder 1","is_part_of":"Latin American Ephemera","coverage":["Spain"],"dcterms_type":[{"@id":"https://hydra-dev.princeton.edu/vocabulary_terms/186","pref_label":"Banners","exact_match":{"@id":"http://id.loc.gov/vocabulary/graphicMaterials/tgm000777"}}],"origin_place":["Spain"],"language":[{"@id":"https://hydra-dev.princeton.edu/vocabulary_terms/149","pref_label":"Spanish","exact_match":{"@id":"http://id.loc.gov/vocabulary/iso639-1/es"}}],"subject":[{"@id":"https://hydra-dev.princeton.edu/vocabulary_terms/278","pref_label":"Agricultural development projects","exact_match":{"@id":"http://id.loc.gov/authorities/subjects/sh85002306"}}]}'
  end
  it "converts the JSON-LD into a suitable solr document" do
    expect(converter.output.except("ttl", "manifest").to eq(
      {
        "id" => "sx920fz824",
        "pulstore_pid" => "sx920fz824",
        "barcode" => "00000000000000",
        "date_uploaded" => nil, ## MISSING
        "date_modified" => nil, ## MISSING
        "physical_number" => "1", ## MISSING
        "project_label" => "Latin American Ephemera",
        "contributor" => "Test Contributor",
        "creator" => "Test Creator",
        "sort_title" => "test folder 1", ## MISSING
        "title_es" => "Test Folder 1",
        "title_display" => "Test Folder 1",
        "height_in_cm" => "50", ## MISSING
        "width_in_cm" => "50", ## MISSING
        "page_count" => "50", ## MISSING
        "publisher_es" => "Test Publisher",
        "publisher_display" => "Test Publisher",
        "rights" => "This digital reproduction is intended to support research, teaching, and private study. Users are responsible for determining any copyright questions", ## Is this right?
        "category" => "Agrarian and rural issues", ## MISSING
        "geographic_subject_label" => "Spain",
        "subject_label" => ["Agricultural development projects"],
        "genre_pul_label" => "", ## MISSING
        "language_label" => "Spanish",
        "geographic_origin_label" => "Spain",
        "box_barcode" => "00000000000000", ## Maybe embed this in the JSONLD?
        "box_physical_location" => "rcpxr", ## MISSING unless this is always rcpxr
        "box_physical_number" => "1", ## Might be missing, box JSONLD is broken
        "thumbnail_base" => "https://libimages1.princeton.edu/loris/plum/st%2F72%2F2h%2Fc0%2F3g-intermediate_file.jp2/full/!200,150/0/default.jpg"
      }
    ))
  end
end
jpstroop commented 7 years ago

"box_physical_location" => "rcpxr" is always true.