Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index from Figgy. #167

Merged
merged 1 commit into from
Oct 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Metrics/MethodLength:
Exclude:
- 'db/migrate/**/*'
- 'app/indexers/plum_jsonld_converter.rb'
- 'spec/support/stub_plum_catalog.rb'
Metrics/ClassLength:
Exclude:
- 'app/indexers/plum_jsonld_converter.rb'
Expand Down
18 changes: 7 additions & 11 deletions app/indexers/plum_jsonld_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ def date_modified
end

def project_label
collection["title"]
end

def collection
json["memberOf"].find { |x| x["@id"].include?("collections") } || {}
"Latin American Ephemera"
end

def contributor
Expand All @@ -90,11 +86,11 @@ def box_barcode
end

def box
json["memberOf"].find { |x| x["@id"].include?("boxes") } || []
json["memberOf"].find { |x| x["box_number"].present? } || []
end

def category
json["category"]
json["subject"].select { |x| x["in_scheme"].present? }.map { |x| x["in_scheme"]["pref_label"] }
end

def genre_pul_label
Expand Down Expand Up @@ -122,11 +118,11 @@ def geo_subject_label
end

def height
json["height"]
Array.wrap(json["height"]).first
end

def width
json["width"]
Array.wrap(json["width"]).first
end

def language_label
Expand All @@ -138,7 +134,7 @@ def publisher_display
end

def title_display
json["title"]
Array.wrap(json["title"]).first
end

def subject_label
Expand All @@ -160,7 +156,7 @@ def lang_lookup
def manifest
@manifest ||=
begin
open("#{json['@id']}/manifest")
open("#{json['@id'].gsub('catalog', 'concern/ephemera_folders')}/manifest")
rescue OpenURI::HTTPError
"{}"
end
Expand Down
8 changes: 2 additions & 6 deletions app/indexers/reindexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def solr
end

def url
"#{LAE.config['plum_url']}/catalog.json?f[human_readable_type_sim][]=Ephemera+Folder&f[member_of_collections_ssim][]=#{collection_name.tr(' ', '+')}"
"#{LAE.config['plum_url']}/catalog.json?f[human_readable_type_sim][]=Ephemera+Folder&f[ephemera_project_ssim][]=#{collection_name.tr(' ', '+')}"
end

class JSONLDPathBuilder
Expand All @@ -27,11 +27,7 @@ def initialize(solr_doc)
end

def path
"#{LAE.config['plum_url']}/concern/#{model_name}/#{id}.jsonld"
end

def model_name
solr_doc["has_model_ssim"].first.underscore.pluralize
"#{LAE.config['plum_url']}/catalog/#{id}.jsonld"
end

def id
Expand Down
2 changes: 1 addition & 1 deletion app/services/plum_event_processor/create_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def process
end

def jsonld_url
manifest_url.gsub("/manifest", ".jsonld")
manifest_url.gsub("/manifest", ".jsonld").gsub("concern/ephemera_folders", "catalog")
end

def json
Expand Down
6 changes: 3 additions & 3 deletions config/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
development:
plum_url: "https://hydra-dev.princeton.edu"
plum_url: "https://figgy.princeton.edu"
collection:
slug: "lae"
events:
server: <%= ENV["LAE_RABBITMQ_URL"] || "amqp://localhost:5672" %>
exchange: <%= ENV["LAE_RABBITMQ_EXCHANGE"] || "plum_events" %>
test:
plum_url: "https://hydra-dev.princeton.edu"
plum_url: "https://figgy.princeton.edu"
collection:
slug: "lae"
events:
server: 'amqp://localhost:5672'
exchange: 'plum_events'
production:
plum_url: "https://plum.princeton.edu"
plum_url: "https://figgy.princeton.edu"
collection:
slug: "lae"
events:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
{
"id":"b9e8325e-baf2-45e4-b32c-5e5b3755c8ef",
"join_id_ssi":"id-b9e8325e-baf2-45e4-b32c-5e5b3755c8ef",
"created_at_dtsi":"2017-10-18T18:08:59Z",
"internal_resource_tsim":[
"EphemeraFolder"
],
"internal_resource_ssim":[
"EphemeraFolder"
],
"internal_resource_tesim":[
"EphemeraFolder"
],
"read_groups_tsim":[
"public"
],
"read_groups_ssim":[
"public"
],
"read_groups_tesim":[
"public"
],
"barcode_tsim":[
"32101100069481"
],
"barcode_ssim":[
"32101100069481"
],
"barcode_tesim":[
"32101100069481"
],
"folder_number_tsim":[
"193"
],
"folder_number_ssim":[
"193"
],
"folder_number_tesim":[
"193"
],
"title_tsim":[
"Caripe. Jardín turístico de Monagas. "
],
"title_ssim":[
"Caripe. Jardín turístico de Monagas. "
],
"title_tesim":[
"Caripe. Jardín turístico de Monagas. "
],
"sort_title_tsim":[
"caripe. jardín turístico de monagas. "
],
"sort_title_ssim":[
"caripe. jardín turístico de monagas. "
],
"sort_title_tesim":[
"caripe. jardín turístico de monagas. "
],
"language_tsim":[
"id-1bb6e264-8b3a-452c-9bc5-10e1c4c98c3e"
],
"language_ssim":[
"id-1bb6e264-8b3a-452c-9bc5-10e1c4c98c3e"
],
"language_tesim":[
"id-1bb6e264-8b3a-452c-9bc5-10e1c4c98c3e"
],
"genre_tsim":[
"id-42754ac7-7723-4219-81eb-11085946fdca"
],
"genre_ssim":[
"id-42754ac7-7723-4219-81eb-11085946fdca"
],
"genre_tesim":[
"id-42754ac7-7723-4219-81eb-11085946fdca"
],
"width_tsim":[
"11"
],
"width_ssim":[
"11"
],
"width_tesim":[
"11"
],
"height_tsim":[
"25"
],
"height_ssim":[
"25"
],
"height_tesim":[
"25"
],
"page_count_tsim":[
"6"
],
"page_count_ssim":[
"6"
],
"page_count_tesim":[
"6"
],
"rights_statement_tsim":[
"uri-http://rightsstatements.org/vocab/CNE/1.0/"
],
"rights_statement_ssim":[
"uri-http://rightsstatements.org/vocab/CNE/1.0/"
],
"rights_statement_tesim":[
"uri-http://rightsstatements.org/vocab/CNE/1.0/"
],
"contributor_tsim":[
"Gobierno Bolivariano de Venezuela"
],
"contributor_ssim":[
"Gobierno Bolivariano de Venezuela"
],
"contributor_tesim":[
"Gobierno Bolivariano de Venezuela"
],
"publisher_tsim":[
"Alcaldía del Municipio Caripe"
],
"publisher_ssim":[
"Alcaldía del Municipio Caripe"
],
"publisher_tesim":[
"Alcaldía del Municipio Caripe"
],
"geographic_origin_tsim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"geographic_origin_ssim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"geographic_origin_tesim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"subject_tsim":[
"id-fb359d07-e82d-479b-b3b9-06dcaebebd9f",
"id-a51c7f0b-4203-4ae9-b063-3e03fac1832b"
],
"subject_ssim":[
"id-fb359d07-e82d-479b-b3b9-06dcaebebd9f",
"id-a51c7f0b-4203-4ae9-b063-3e03fac1832b"
],
"subject_tesim":[
"id-fb359d07-e82d-479b-b3b9-06dcaebebd9f",
"id-a51c7f0b-4203-4ae9-b063-3e03fac1832b"
],
"geo_subject_tsim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"geo_subject_ssim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"geo_subject_tesim":[
"id-e36dd185-6875-4efd-a62d-81f01a700097"
],
"date_range_tsim":[
"serialized-{\"internal_resource\":\"DateRange\",\"created_at\":null,\"updated_at\":null,\"id\":null,\"start\":[\"2004\"],\"end\":[\"2012\"]}"
],
"viewing_hint_tsim":[
"individuals"
],
"viewing_hint_ssim":[
"individuals"
],
"viewing_hint_tesim":[
"individuals"
],
"visibility_tsim":[
"open"
],
"visibility_ssim":[
"open"
],
"visibility_tesim":[
"open"
],
"pdf_type_tsim":[
"none"
],
"pdf_type_ssim":[
"none"
],
"pdf_type_tesim":[
"none"
],
"local_identifier_tsim":[
"3cff0"
],
"local_identifier_ssim":[
"3cff0"
],
"local_identifier_tesim":[
"3cff0"
],
"state_tsim":[
"needs_qa"
],
"state_ssim":[
"needs_qa"
],
"state_tesim":[
"needs_qa"
],
"read_access_group_ssim":[
"public"
],
"display_subject_ssim":[
"National parks and reserves",
"Advertising--Tourism",
"Environment and ecology",
"Tourism"
],
"display_language_ssim":[
"Spanish"
],
"ephemera_project_ssim":[
"Latin American Ephemera"
],
"human_readable_type_ssim":[
"Ephemera Folder"
],
"updated_at_dtsi":"2017-10-19T21:01:54Z",
"timestamp":"2017-10-19T21:05:24.090Z",
"score":1.0
}
Loading