krikri 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/krikri/harvesters/oai_harvester.rb~ +10 -0
- data/app/models/krikri/original_record_desc.rb~ +6 -0
- data/app/models/krikri/original_record_metadata.rb~ +9 -0
- data/app/models/krikri/parser.rb~ +5 -0
- data/app/models/krikri/parsers/xml_parser.rb~ +5 -0
- data/config/initializers/config.rb~ +19 -0
- data/config/settings/test.yml~ +3 -0
- data/lib/aggregation.rb~ +4 -0
- data/lib/blacklight.rb~ +8 -0
- data/lib/krikri/engine.rb +29 -2
- data/lib/krikri/enrichment.rb~ +5 -0
- data/lib/krikri/enrichment_agent.rb~ +11 -0
- data/lib/krikri/enrichment_agent_spec.rb~ +2 -0
- data/lib/krikri/enrichment_job.rb~ +13 -0
- data/lib/krikri/enrichments.rb~ +4 -0
- data/lib/krikri/enrichments/capitalize.rb~ +24 -0
- data/lib/krikri/enrichments/deduplication.rb~ +10 -0
- data/lib/krikri/enrichments/genre_filter.rb~ +9 -0
- data/lib/krikri/enrichments/iso_enrcich.rb~ +8 -0
- data/lib/krikri/enrichments/iso_enrich.rb~ +13 -0
- data/lib/krikri/enrichments/parse_date.rb~ +10 -0
- data/lib/krikri/enrichments/strip_html.rb~ +16 -0
- data/lib/krikri/enrichments/timespan.rb~ +6 -0
- data/lib/krikri/enrichments/timespan_split.rb~ +83 -0
- data/lib/krikri/field_enrichment.rb~ +3 -0
- data/lib/krikri/harvester.rb +19 -7
- data/lib/krikri/harvesters/basic_save_behavior.rb +9 -0
- data/lib/krikri/harvesters/basic_save_behavior.rb~ +1 -0
- data/lib/krikri/harvesters/harvest_behavior.rb +40 -0
- data/lib/krikri/harvesters/harvest_behavior.rb~ +14 -0
- data/lib/krikri/harvesters/oai_harvester.rb +110 -12
- data/lib/krikri/harvesters/oai_skip_deleted_behavior.rb +20 -0
- data/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +17 -0
- data/lib/krikri/id_minter.rb~ +8 -0
- data/lib/krikri/id_service.rb~ +4 -0
- data/lib/krikri/index_service.rb +40 -24
- data/lib/krikri/ldp/container.rb~ +22 -0
- data/lib/krikri/ldp/nr_source.rb~ +4 -0
- data/lib/krikri/ldp/rdf_source.rb~ +24 -0
- data/lib/krikri/ldp/resource.rb~ +49 -0
- data/lib/krikri/mapping_dsl.rb~ +4 -0
- data/lib/krikri/mapping_dsl/parser_methods.rb +13 -9
- data/lib/krikri/mapping_job.rb~ +13 -0
- data/lib/krikri/md5_minter.rb~ +8 -0
- data/lib/krikri/parsers/json_parser.rb~ +17 -0
- data/lib/krikri/parsers/mods_parser.rb +2 -0
- data/lib/krikri/parsers/oai_headers.rb~ +4 -0
- data/lib/krikri/parsers/oai_parser.rb~ +2 -0
- data/lib/krikri/parsers/oai_parser_headers.rb~ +4 -0
- data/lib/krikri/parsers/qdc_parser.rb +2 -0
- data/lib/krikri/parsers/xml_parser.rb~ +61 -0
- data/lib/krikri/provenance_query.rb~ +4 -0
- data/lib/krikri/provenance_query_client.rb~ +11 -0
- data/lib/krikri/util/edtf_converter.rb~ +26 -0
- data/lib/krikri/util/extended_date_parser.rb~ +70 -0
- data/lib/krikri/version.rb +1 -1
- data/lib/tasks/jetty.rake +1 -1
- data/lib/tasks/jetty.rake~ +12 -0
- data/lib/tasks/krikri.rake +13 -10
- data/lib/tasks/krikri.rake~ +20 -0
- data/spec/factories/krikri_original_record.rb +22 -0
- data/spec/factories/krikri_original_record.rb~ +5 -0
- data/spec/internal/Gemfile +3 -2
- data/spec/internal/Gemfile.lock +39 -41
- data/spec/internal/config/initializers/blacklight_initializer.rb +1 -1
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/secrets.yml +2 -2
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20150224000601_devise_create_users.rb → 20150305160911_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20150224000620_create_searches.blacklight.rb → 20150305160928_create_searches.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150224000621_create_bookmarks.blacklight.rb → 20150305160929_create_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150224000622_add_polymorphic_type_to_bookmarks.blacklight.rb → 20150305160930_add_polymorphic_type_to_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/lib/generators/test_app_generator.rb~ +14 -0
- data/spec/internal/log/development.log +67 -67
- data/spec/internal/log/test.log +60918 -3966
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_background-variant.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_border-radius.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_center-block.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_clearfix.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_gradients.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_grid-framework.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_hide-text.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_nav-divider.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_nav-vertical-align.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_opacity.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_progress-bar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_reset-filter.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_resize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_responsive-visibility.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_size.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_tab-focus.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_table-row.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_text-emphasis.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_text-overflow.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{b0e4dc91d58228c3adf15cb753bdeb4e4010a333 → 6150801e42e33a1ef8211bc5bd57210113efb322}/_vendor-prefixes.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{71fba6bdfa89d88fe8a72b36eafd3b91cf10a6d0 → 93e201cf4a11978a1f491a057a3bd569c3825210}/blacklight.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_blacklight_base.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_bookmark.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_catalog.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_facets.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_header.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_layout.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_modal.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/_search_history.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/blacklight.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{78e0580c292179fc5fdd7b74b703dad1702b4176 → ca8c12d03785e0d6cd4554f4d3939e7836d38282}/blacklight_defaults.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{e2a3786e4ebe66d44f7faa2a5c1fde6ac88e9913 → f4c2e42bd47363124f382d6b3accf5b68bede368}/_bootstrap-sprockets.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{e2a3786e4ebe66d44f7faa2a5c1fde6ac88e9913 → f4c2e42bd47363124f382d6b3accf5b68bede368}/_bootstrap.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_carousel.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_glyphicons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_input-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_jumbotron.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_media.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_normalize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_popovers.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_print.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_progress-bars.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_responsive-embed.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_responsive-utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_thumbnails.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_tooltip.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{86c40011646adf02115c5f9a86cbbbe78771a7f9 → f65d96a170ed1d9ac890c97fabbd2605e6dd83f7}/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{8ef9e7d38c0b792a85f86f7b5e764d33 → 02bee7ecb2697ab24c566acc29e23717} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/03126075e92026e5dd05f2c577bd4730 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/04a0815eb41346be1a815741677d9d46 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/059eceaa18e2eaee3d5168f3949f4957 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/093d898bf3f20b26b13c82714a77c040 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{8c1af1f5b9a42448f4b8ff3dc1c1b81b → 24c91d512c7cc64c22aeb15a7e6cb7a2} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2665fe64198bd4c9fec4c5ab52bea19e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2bea755b15e0adfa7c25ed3d0ede78ae +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{4873ea32d49c588483b701fcd571786b → 308dc75487b2e4133c218761921cbba0} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{7f804c48c333d9758fa49ff9331b78e2 → 350a65d446eb7398f96d102f7a1a6d69} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/37ad484f356c918e56ba82f60caf9521 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{e451ef2f153fc084065cf4f66d62a912 → 3ca413a5a67acfa5c4adb491faec270e} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{39329b3558b9f58b0d4e43621aeaa8c2 → 3cc20a63495e66e9251101ccfb0d389c} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/41b62fb10530766b5b9fef3338f5f30b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/421c89c58d3e76046a0294dae1f731ff +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/43da966542fafc2a4c768be78527391c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/496a0d7dce1ff6bf4a9c3a089ea3a635 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{ecb21744c6c865116bfaa342d4cc373d → 4ed1f0897f5818a8af48b809981f38f2} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5d9772b2d3ee4527f6669b3187f91bf2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{a66ba1ae2ecf53099b8c240249aaccaa → 6ca71451ade728977ed02cea06e07914} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6df5b5c0a8e6d87ced9504a460df875e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6eefd2765a716d66ff857cfcda69a119 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{c19459bc1eff0b0133093c0473f47c04 → 75da31aa64ac2526ffbe396852663999} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{cb74a43b2a6abc262abfed639df77470 → 7a841c591675a2dafb8b859ca4014f1c} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{853ad370adfaa0da7ec26f51b89421f1 → 813e23719129cf9f19349f720bebdf70} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8297d7100b7c4e6115a7e6408f2fced5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/86b7795bee54d7ffa2ff30e867aff344 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/88ded10f28177bec1bddb0d72d6b1cd2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{93c6b8da8f3373c42510a25694457483 → 8ad5c3dc0f5fcc5d7a775d6294dda9f5} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/93aaa9231a32901266b05632f3d35ecd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{4a9e62d054a09c7c8e486f73bd032bdc → 9f68eb44ffcb9dd95623c179300414fd} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{11b7eeb5da37de1c315d886349adbc98 → ab2a05b91d7d316d4ceb47ce067006fb} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ad4a54c43c2a4c3874bfde1c9f08c248 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b0423ae95a661f086b7766d7573885f9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f7a87683461c3a58ee9b6e9546473c4e → b1a42de74c934edd0e5eed0f98a23597} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b1c03c36188b4f58f819510adb9a7e9c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{cd59839c2fc0d494ffa76ef4c4dbfa42 → b225d67626669cb154cbe08a3c439d48} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b42c247628daaf44109584724682a6ad +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{92c82efebbff4c3a9f96e08b308e92dd → b660ec1ede271559cfd0259eed96ae9c} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bb1a549778011fb037836e1fa6a80ba6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/be8a6d8dc481c07c86bdf541e15c4634 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{6b20592285155ef367334915b33781ea → c5b703cc22fc68aa8cf29fb7af16cf71} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c644ecad928e076f999e9c9a3bc350c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c78dd20a0df27e9394a413bf2e4abf92 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{59b1fd64c6fc18a82465ad6fdc7094fa → c9efce42580b0ad0374a052aa61f2a07} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{47defd1245e87ed8558af57fa5f03bef → d0862d2af3fe93a869e9ecfdb9d89e23} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d24a7c4b8ac71a90e809881a64970898 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d5415d1f2b4a2672355dd988eb332d0b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dbba4bbc32c17ade3d618c5d0baeb371 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dfdda7a36a1428f72947384938d105a2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e40f087f7b8b59f85a4811f715e5e35a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e8276b98892dcac8285a592bb63fe75b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{d7bf17ad1471147b5314b4dda0bad9fe → ecfc314951b349e27742c1b26880619e} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/eddae0741d973a8ab3df27c1ea5b635e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{53329c49c9b4ba25d31c73c9b98260b0 → f3935581a84aba9a499005ed6a8e18be} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{82dd05a187bccd30f62fabb16491fe03 → f3e7729c53b8a2c408086a61b58922ae} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f45dfdb34e84d3c72a3319399a7316a3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{8ea9ff17090b736331312d04c8036810 → fa11f1beb15b0f04503ce1f06701a8bf} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/faac2909046aa87e1f1f08b2bf0ad2b2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/faef697283f2f0627727a5f856242651 +0 -0
- data/spec/krikri_spec.rb +15 -0
- data/spec/krikri_spec.rb~ +30 -0
- data/spec/ldp/active_triples_spec.rb~ +15 -0
- data/spec/ldp/at_resource_spec.rb~ +41 -0
- data/spec/ldp/nr_source_spec.rb~ +3 -0
- data/spec/ldp/rdf_source_spec.rb~ +4 -0
- data/spec/ldp/resource_spec.rb~ +49 -0
- data/spec/lib/krikri/enrichment_agent_spec.rb~ +4 -0
- data/spec/lib/krikri/enrichments/capitalize_spec.rb~ +24 -0
- data/spec/lib/krikri/enrichments/deduplication_spec.rb~ +5 -0
- data/spec/lib/krikri/enrichments/genre_filter_spec.rb~ +19 -0
- data/spec/lib/krikri/enrichments/iso_enrich_spec.rb~ +5 -0
- data/spec/lib/krikri/enrichments/parse_date_spec.rb~ +16 -0
- data/spec/lib/krikri/enrichments/timespan_spec.rb~ +10 -0
- data/spec/lib/krikri/enrichments/timespan_split_spec.rb~ +59 -0
- data/spec/lib/krikri/harvester_spec.rb +38 -2
- data/spec/lib/krikri/harvesters/basic_save_behavior_spec.rb +16 -0
- data/spec/lib/krikri/harvesters/basic_save_behavior_spec.rb~ +12 -0
- data/spec/lib/krikri/harvesters/harvest_behavior_spec.rb +5 -0
- data/spec/lib/krikri/harvesters/harvest_behavior_spec.rb~ +5 -0
- data/spec/lib/krikri/harvesters/oai_harvester_spec.rb +170 -2
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +7 -0
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior_spec.rb +25 -0
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior_spec.rb~ +15 -0
- data/spec/lib/krikri/id_service_spec.rb~ +3 -0
- data/spec/lib/krikri/index_service_spec.rb +25 -14
- data/spec/lib/krikri/job_spec.rb~ +13 -0
- data/spec/lib/krikri/mapper_agent_spec.rb~ +64 -0
- data/spec/lib/krikri/mapper_spec.rb +12 -0
- data/spec/lib/krikri/mapper_spec.rb~ +5 -0
- data/spec/lib/krikri/mapping_dsl/parser_methods_spec.rb +38 -14
- data/spec/lib/krikri/mapping_dsl/parser_methods_spec.rb~ +65 -0
- data/spec/lib/krikri/mapping_dsl/property_declaration_spec.rb~ +87 -0
- data/spec/lib/krikri/mapping_dsl/rdf_subjects_spec.rb~ +16 -0
- data/spec/lib/krikri/mapping_dsl_spec.rb~ +10 -0
- data/spec/lib/krikri/mapping_job.rb~ +12 -0
- data/spec/lib/krikri/mapping_job_spec.rb~ +11 -0
- data/spec/lib/krikri/mapping_spec.rb~ +5 -0
- data/spec/lib/krikri/md5_minter_spec.rb~ +5 -0
- data/spec/lib/krikri/parser_value_array.rb~ +5 -0
- data/spec/lib/krikri/parsers/json_parser_spec.rb~ +17 -0
- data/spec/lib/krikri/parsers/mods_parser_spec.rb +1 -0
- data/spec/lib/krikri/parsers/qdc_parser_spec.rb +1 -0
- data/spec/lib/krikri/parsers/xml_parser_spec.rb~ +21 -0
- data/spec/lib/krikri/provenance_query_client.rb~ +5 -0
- data/spec/lib/krikri/provenance_query_client_spec.rb~ +8 -0
- data/spec/lib/krikri/util/edtf_converter_spec.rb~ +17 -0
- data/spec/lib/krikri/util/extended_date_parser_spec.rb~ +102 -0
- data/spec/models/activity_spec.rb~ +41 -0
- data/spec/models/dpla/map/aggregation_spec.rb~ +67 -0
- data/spec/models/harvesters/oai_harvester_spec.rb~ +15 -0
- data/spec/models/mapper_spec.rb~ +5 -0
- data/spec/models/original_record_metadata_spec.rb~ +5 -0
- data/spec/models/original_record_spec.rb~ +5 -0
- data/spec/support/shared_contexts/mapping_dsl.rb~ +12 -0
- data/spec/support/shared_contexts/provenance_query_client.rb~ +6 -0
- data/spec/support/shared_examples/enrichment.rb~ +5 -0
- data/spec/support/shared_examples/harvest_behavior.rb +21 -0
- data/spec/support/shared_examples/harvest_behavior.rb~ +13 -0
- data/spec/support/shared_examples/harvester.rb +5 -3
- data/spec/support/shared_examples/job.rb~ +20 -0
- data/spec/support/shared_examples/ldp_resource.rb~ +4 -0
- data/spec/support/shared_examples/oai_parser_headers.rb~ +12 -0
- data/spec/support/shared_examples/rdf_source.rb~ +1 -0
- data/spec/support/shared_examples/software_agent.rb~ +5 -0
- data/spec/support/shared_examples/string_enrichment.rb~ +12 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb~ +14 -0
- data/spec/webmocks/oai.rb~ +13 -0
- metadata +566 -400
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -207
- data/spec/internal/tmp/cache/assets/test/sprockets/0b3850cd2568d76d8583e8e6bffa44d9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0dffbe192bade10cf2b568c73695e96e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/12fe6051fca3506bae2d3a3452d89b8a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/16648e86ab6ef2950f3630ff0d566409 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1877c8233ee501d08788d7324a70bd70 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2338a6f943deb78d21f2acca84ab4f2b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2c58fb6a2406edc8067b46ee33af7262 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2d0220441d85355dcd9ade523f95c048 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/339e294297aa1a0070e702f9b1d6a138 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/39ed74e4d194593ec48c481d0fd76007 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3cdc19003f073eb3b9f3a080ffdcba4b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/40271adcb3c4654dcb20b55abc2505c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/43f0a87eb2c9be2e37129f0a869756fa +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/46ec3d34d3576e4452b0a95b87176996 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/52ce034583a746333fd7b8aa3916b8e1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/677fd27eda24da657f51d725742582f3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/735621cd88de5e37980cced4fb13ded9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7de1f4ba8418fc9219f44e125c429b39 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7e4f29f7a7327f10677cd047be78cf8a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/806c560c2f6e89ba0ad39561804ff79c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9443255223294f7ad9ad6daba446afc3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9aae694d5c7713a4666814ecfd04bc8e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9ca9885875e2e0ab4e531cba60aa03e5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9e91dee79db70af8ab4149b9698a12a5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a13d3a27038cf6570d22b54c54442642 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a62c05e92bbbd1d49540b17c1a17982f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/acc90134230a954a6983332d94303e66 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b2b550f46801c5fb416302ef0737a62d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b37776526b5809e55fbb0add6d059127 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b7136d57967d58d8247f9168a681ce01 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d6995317fba3b6344c75db70b8c997e2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e3f7abb4568acd320b05e7765b31412f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e802e3ce42ea0c2e35ccfd33f3b8caad +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ef1d076b51c3ce03aa1e754fb8f0457e +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ba0502820a606ae6570cb7e683f35e4e7802536
|
4
|
+
data.tar.gz: 43cfd2802c166d2953038007c02d76146a72b5bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eea171ecd705736afdeb184d612e21ebf46e6f39336a7c6d0f10d80cc7d80d44d9a9a9aa15b03483e98f1ee6493cc2dc5eff817ed1d889fb4d5747e29b21a732
|
7
|
+
data.tar.gz: 7f81bfc7389b026eb30fb6c784bc30f1a5c1933c6f975bd45e71b866defa403fa847741900da0207779c1164b54c8bbfbce6a768ac5011a9648fdd81311344b0
|
@@ -0,0 +1,19 @@
|
|
1
|
+
setting_files = [self.root.join('config', 'settings.yml'),
|
2
|
+
self.root.join('config', 'settings', "#{Rails.env}.yml"),
|
3
|
+
self.root.join('config', 'environments', "#{Rails.env}.yml"),
|
4
|
+
self.root.join('config', 'settings.local.yml'),
|
5
|
+
self.root.join('config', 'settings', "#{Rails.env}.local.yml"),
|
6
|
+
self.root.join('config', 'environments',
|
7
|
+
"#{Rails.env}.local.yml")
|
8
|
+
].map { |path| path.to_s }
|
9
|
+
|
10
|
+
settings_const = Kernel.const_get(RailsConfig.const_name)
|
11
|
+
|
12
|
+
source_paths = settings_const.add_source!('nil')[0..-2].map do |source|
|
13
|
+
source.path
|
14
|
+
end
|
15
|
+
|
16
|
+
source_paths = setting_files + source_paths
|
17
|
+
|
18
|
+
RailsConfig.load_and_set_settings(source_paths)
|
19
|
+
Krikri::Settings = Kernel.const_get(RailsConfig.const_name)
|
data/lib/aggregation.rb~
ADDED
data/lib/blacklight.rb~
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
module Blacklight
|
2
|
+
def self.connection_config
|
3
|
+
@connection_config ||= begin
|
4
|
+
raise "The #{::Rails.env} environment settings were not found in the blacklight.yml config" unless blacklight_yml[::Rails.env]
|
5
|
+
blacklight_yml[::Rails.env].symbolize_keys
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
data/lib/krikri/engine.rb
CHANGED
@@ -15,6 +15,12 @@ module Krikri
|
|
15
15
|
class Engine < ::Rails::Engine
|
16
16
|
isolate_namespace Krikri
|
17
17
|
|
18
|
+
def configure_blacklight!
|
19
|
+
krikri_solr = Krikri::Settings.solr
|
20
|
+
Blacklight.solr_config = Blacklight.solr_config.merge(krikri_solr) unless
|
21
|
+
krikri_solr.nil?
|
22
|
+
end
|
23
|
+
|
18
24
|
# Autoload various classes and modules in lib
|
19
25
|
config.autoload_paths += Dir["#{config.root}/lib/**/"]
|
20
26
|
|
@@ -65,6 +71,10 @@ module Krikri
|
|
65
71
|
RDF::Marmotta.new(Krikri::Settings['marmotta']['base'])
|
66
72
|
end
|
67
73
|
|
74
|
+
initializer :blacklight_settings do
|
75
|
+
configure_blacklight!
|
76
|
+
end
|
77
|
+
|
68
78
|
initializer :aggregation do
|
69
79
|
DPLA::MAP::Aggregation.class_eval do
|
70
80
|
include Krikri::LDP::RdfSource
|
@@ -72,8 +82,25 @@ module Krikri
|
|
72
82
|
|
73
83
|
def mint_id!(seed = nil)
|
74
84
|
set_subject!(mint_id_fragment(seed))
|
75
|
-
|
76
|
-
|
85
|
+
update_source_resource_subject
|
86
|
+
end
|
87
|
+
|
88
|
+
##
|
89
|
+
# Forceably update the subject for the dpla:SourceResource to use a
|
90
|
+
# fragment URI. This is necessary because of an issue in
|
91
|
+
# ActiveTriples.
|
92
|
+
#
|
93
|
+
# @see https://github.com/ActiveTriples/ActiveTriples/issues/107
|
94
|
+
def update_source_resource_subject
|
95
|
+
unless sourceResource.empty?
|
96
|
+
sr = get_values(RDF::EDM::aggregatedCHO).first
|
97
|
+
orig = sourceResource_ids.first
|
98
|
+
# Q: should we have a check like `orig.node?` here?
|
99
|
+
sr.set_subject!(rdf_subject / '#sourceResource')
|
100
|
+
sr.persist!
|
101
|
+
update([self, RDF::EDM::aggregatedCHO, sr])
|
102
|
+
delete([orig, nil, nil])
|
103
|
+
end
|
77
104
|
end
|
78
105
|
|
79
106
|
##
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Krikri
|
2
|
+
##
|
3
|
+
# MappingJob: perform enqueued Krikri::Mapper::Agent
|
4
|
+
#
|
5
|
+
# @see: Krikri::Mapper, Krikri::Mapper::Agent
|
6
|
+
class EnrichmentJob < Krikri::Job
|
7
|
+
@queue = :enrichment
|
8
|
+
|
9
|
+
def self.run(mapper, activity_uri = nil)
|
10
|
+
mapper.run(activity_uri)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
module Krikri::Enrichments
|
3
|
+
##
|
4
|
+
# Enrichment to capitalize sentences in a text field
|
5
|
+
#
|
6
|
+
# Capitalize.new.enrich_value(
|
7
|
+
# 'THE MOOMIN BOOKS MAKE FOR BOTH SPLENDID BEDTIME READ-ALOUDS AND ' \
|
8
|
+
# "SOLITARY SAVORING. IT’S MORE THAN FORTY YEARS SINCE JANSSON’S " \
|
9
|
+
# 'MOOMINTROLLS FIRST APPEARED. I FOUND THE WRITING AND INVENTION ' \
|
10
|
+
# 'AS APPEALING AS EVER. SHE HAS A THISTLEDOWN TOUCH.'
|
11
|
+
# => 'The moomin books make for both splendid bedtime read-alouds and ' \
|
12
|
+
# "solitary savoring. It’s more than forty years since jansson’s " \
|
13
|
+
# 'moomintrolls first appeared. I found the writing and invention ' \
|
14
|
+
# 'as appealing as ever. She has a thistledown touch.'
|
15
|
+
#
|
16
|
+
class Capitalize
|
17
|
+
include Krikri::FieldEnrichment
|
18
|
+
|
19
|
+
def enrich_value(value)
|
20
|
+
return value unless value.respond_to? :capitalize
|
21
|
+
value.captialize
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Krikri::Enrichments
|
2
|
+
##
|
3
|
+
# Enrichment to capitalize sentences in a text field
|
4
|
+
#
|
5
|
+
# StripHtml.new.enrich_value('<html>Moomin <i><b>Valley</i></b>')
|
6
|
+
# => 'Moomin Valley'
|
7
|
+
#
|
8
|
+
class StripHtml
|
9
|
+
include Krikri::FieldEnrichment
|
10
|
+
|
11
|
+
def enrich_value(value)
|
12
|
+
return value unless value.respond_to? :capitalize
|
13
|
+
value.captialize
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module Krikri::Enrichments
|
2
|
+
##
|
3
|
+
# Splits edm:TimeSpan labels and populates `#begin` and `#end`. Any values
|
4
|
+
# generated from string values are left as strings to be normalized by
|
5
|
+
# another enrichment.
|
6
|
+
#
|
7
|
+
# Ignores values that are neither a String or an edm:TimeSpan
|
8
|
+
#
|
9
|
+
# Converts string values to a timespan with the value as providedLabel
|
10
|
+
# and enriches as below.
|
11
|
+
#
|
12
|
+
# Populates the `#providedLabel`, `#begin`, and `#end` properties of TimeSpan
|
13
|
+
# objects, and:
|
14
|
+
# - If a `#providedLabel` is present, but begin and end are missing:
|
15
|
+
# - Attempts to parse `#providedLabel` as an EDTF interval and populates
|
16
|
+
# begin and end with their respective values.
|
17
|
+
# - Splits dates
|
18
|
+
# - If no
|
19
|
+
# - Returns the TimeSpan unaltered if all three fields are present.
|
20
|
+
class TimespanSplit
|
21
|
+
include Krikri::FieldEnrichment
|
22
|
+
|
23
|
+
def enrich_value(value)
|
24
|
+
value = timespan_from_string(value) if value.is_a? String
|
25
|
+
return value unless value.is_a? DPLA::MAP::TimeSpan
|
26
|
+
populate_timespan(value)
|
27
|
+
end
|
28
|
+
|
29
|
+
def timespan_from_string(value)
|
30
|
+
timespan = DPLA::MAP::TimeSpan.new
|
31
|
+
timespan.providedLabel = value
|
32
|
+
timespan
|
33
|
+
end
|
34
|
+
|
35
|
+
def populate_timespan(timespan)
|
36
|
+
return timespan unless timespan.providedLabel.empty? ||
|
37
|
+
timespan.begin.empty? || timespan.end.empty?
|
38
|
+
parse_label(timespan.providedLabel)
|
39
|
+
|
40
|
+
return timespan
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# e.g. 1970-08-01/02 or 1970-12/10
|
45
|
+
def partial_edtf(str)
|
46
|
+
/^(\d{4}(-\d{2})*)-(\d{2})\/(\d{2})$/.match(str) do |m|
|
47
|
+
Date.edtf("#{m[1]}-#{m[3]}/#{m[1]}-#{m[4]}")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# e.g. 01-2045
|
53
|
+
def month_year(str)
|
54
|
+
/\d{2}-(\d{4})/.match(str) do |m|
|
55
|
+
Date.edtf("#{m[2]}-#{m[1]}")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# e.g. 1990-92
|
61
|
+
def hyphenated_partial_range(str)
|
62
|
+
/^(\d{2})(\d{2})-(\d{2})$/.match(str) do |m|
|
63
|
+
Date.edtf("#{m[1]}#{m[2]}/#{m[1]}#{m[3]}")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# e.g. 1990s
|
69
|
+
def decade_s(str)
|
70
|
+
/^(\d{3})0s)$/.match(str) do |m|
|
71
|
+
Date.edtf("#{m}x")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# e.g. 199-
|
77
|
+
def decade_hyphen
|
78
|
+
/^(\d{3})-)$/.match(str) do |m|
|
79
|
+
Date.edtf("#{m}x")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
data/lib/krikri/harvester.rb
CHANGED
@@ -22,14 +22,14 @@ module Krikri
|
|
22
22
|
# recommended to override this method in your subclass with
|
23
23
|
# an efficient implementation.
|
24
24
|
# - #run. Wraps persistence of each record returned by #records.
|
25
|
-
# Runs a full harvest,
|
26
|
-
# given the options passed
|
25
|
+
# Runs a full harvest, processing the created `record_class`
|
26
|
+
# instances through `harvest_behavior`, given the options passed
|
27
|
+
# to #initialize.
|
27
28
|
#
|
28
29
|
# When including, add a call to Krikri::Harvester::Registry.register() to
|
29
30
|
# put it in the registry so that it can be looked up.
|
30
|
-
# See lib/krikri/engine.rb.
|
31
|
-
# @see Krikri::Engine
|
32
31
|
#
|
32
|
+
# @see Krikri::Engine
|
33
33
|
module Harvester
|
34
34
|
extend ActiveSupport::Concern
|
35
35
|
include SoftwareAgent
|
@@ -55,6 +55,7 @@ module Krikri
|
|
55
55
|
# Krikri::OriginalRecord).
|
56
56
|
# id_minter: Module to create identifiers for generated records (optional;
|
57
57
|
# defaults to Krikri::Md5Minter)
|
58
|
+
# harvest_behavior: A behavior object implementing `#process_record`
|
58
59
|
#
|
59
60
|
# Pass harvester specific options to inheriting classes under a key for
|
60
61
|
# that harvester. E.g. { uri: my_uri, oai: { metadata_prefix: :oai_dc } }
|
@@ -64,9 +65,16 @@ module Krikri
|
|
64
65
|
@uri = opts.fetch(:uri)
|
65
66
|
@name = opts.delete(:name)
|
66
67
|
@record_class = opts.delete(:record_class) { Krikri::OriginalRecord }
|
68
|
+
.to_s.constantize
|
67
69
|
@id_minter = opts.delete(:id_minter) { Krikri::Md5Minter }
|
70
|
+
.to_s.constantize
|
71
|
+
@harvest_behavior = opts.delete(:harvest_behavior) do
|
72
|
+
Krikri::Harvesters::BasicSaveBehavior
|
73
|
+
end.to_s.constantize
|
68
74
|
end
|
69
75
|
|
76
|
+
delegate :process_record, :to => :@harvest_behavior
|
77
|
+
|
70
78
|
##
|
71
79
|
# @abstract Provide a low-memory, lazy enumerable for record ids.
|
72
80
|
#
|
@@ -107,16 +115,20 @@ module Krikri
|
|
107
115
|
|
108
116
|
##
|
109
117
|
# Run the harvest.
|
110
|
-
#
|
118
|
+
#
|
119
|
+
# Individual records are processed through `#process_record` which is
|
120
|
+
# delegated to the harvester's `@harvest_behavior` by default.
|
111
121
|
#
|
112
122
|
# @return [Boolean]
|
123
|
+
# @see Krirki::Harvesters:HarvestBehavior
|
113
124
|
def run(activity_uri = nil)
|
114
125
|
log :info, 'harvest is running'
|
115
126
|
records.each do |rec|
|
116
127
|
begin
|
117
|
-
rec
|
128
|
+
process_record(rec, activity_uri)
|
118
129
|
rescue => e
|
119
|
-
log :error, "Error harvesting record:\n#{rec.content}\n\
|
130
|
+
log :error, "Error harvesting record:\n#{rec.content}\n\t" \
|
131
|
+
"with message:\n#{e.message}"
|
120
132
|
next
|
121
133
|
end
|
122
134
|
end
|