krikri 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/krikri/_qa_report_list.html.erb~ +10 -0
- data/app/controllers/krikri/concerns/provider_context.rb~ +7 -0
- data/app/controllers/krikri/qa_reports_controller.rb~ +18 -0
- 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/app/models/krikri/qa_report.rb~ +7 -0
- data/app/views/krikri/field_value_reports/show.csv.erb +4 -1
- data/app/views/krikri/qa_reports/index.html.erb~ +3 -0
- data/app/views/krikri/qa_reports/show.html.erb~ +1 -0
- data/config/initializers/config.rb~ +19 -0
- data/config/settings/test.yml~ +3 -0
- data/db/migrate/20150328035550_add_qa_report.rb~ +11 -0
- data/lib/krikri/engine.rb +1 -0
- data/lib/krikri/enrichments/dcmi_enforcer.rb +3 -1
- data/lib/krikri/enrichments/language_to_lexvo.rb +1 -1
- 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/parsers/json_parser.rb~ +17 -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/xml_parser.rb~ +61 -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~ +12 -0
- data/lib/tasks/krikri.rake~ +20 -0
- data/spec/controllers/application_controller_spec.rb~ +11 -0
- data/spec/controllers/qa_reports_controller_spec.rb~ +15 -0
- data/spec/controllers/records_controller_spec.rb~ +11 -0
- data/spec/controllers/reports_controller_spec.rb~ +6 -0
- data/spec/controllers/validation_reports_controller_spec.rb~ +15 -0
- data/spec/factories/krikri_original_record.rb~ +5 -0
- data/spec/factories/krikri_provider.rb~ +7 -0
- data/spec/factories/krikri_provider_spec.rb~ +7 -0
- data/spec/factories/krikri_qa_report.rb~ +8 -0
- data/spec/helpers/krikri/application_helper_spec.rb~ +16 -0
- data/spec/internal/Gemfile +3 -3
- data/spec/internal/Gemfile.lock +35 -35
- data/spec/internal/app/assets/javascripts/application.js +1 -1
- 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/{20150814140622_devise_create_users.rb → 20150818162651_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20150814140649_create_searches.blacklight.rb → 20150818162712_create_searches.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150814140650_create_bookmarks.blacklight.rb → 20150818162713_create_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20150814140651_add_polymorphic_type_to_bookmarks.blacklight.rb → 20150818162714_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 +73 -73
- data/spec/internal/log/test.log +4544 -13759
- data/spec/internal/tmp/cache/318/301/krikri%2Fapplication_helper%2Favailable_providers +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_background-variant.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_border-radius.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_center-block.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_clearfix.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_gradients.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_grid-framework.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_hide-text.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_image.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_nav-divider.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_nav-vertical-align.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_opacity.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_progress-bar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_reset-filter.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_resize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_responsive-visibility.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_size.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_tab-focus.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_table-row.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_text-emphasis.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_text-overflow.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{75eb48b5361d55a8133e0091d663a085dacee3c5 → 4a3ee647961c7e45976eb2c0a94406aad3427b3d}/_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/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_carousel.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_glyphicons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_input-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_jumbotron.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_labels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_list-group.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_media.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_normalize.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_panels.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_popovers.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_print.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_progress-bars.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_responsive-embed.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_responsive-utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_thumbnails.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_tooltip.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{f79e9f3544f6b8d5f7ca05529260dceec8dd44ed → a1ec1bb9c9cafeb054d542e861ebc8ffd5904439}/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{6449c927c92ef1ea4378c66161e3b0efe1bf954d → b28605b1c659cf09fc72f3c1fff32918869d28b8}/_bootstrap-sprockets.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/{6449c927c92ef1ea4378c66161e3b0efe1bf954d → b28605b1c659cf09fc72f3c1fff32918869d28b8}/_bootstrap.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/sprockets/059eceaa18e2eaee3d5168f3949f4957 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{16648e86ab6ef2950f3630ff0d566409 → 093d898bf3f20b26b13c82714a77c040} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/10517c9579f8d23c82fb8caa66dca6a7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{e83c10c393da1c028c7d4217ecfc9c03 → 19f4ba6fa86d2609c171da9f5ee3b11a} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{5eee68b0bfc10789f399d54d385856f6 → 1ba2e9a8a2fedf18f6019ee0469c3aa6} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{809bfad10edab5da465f5f5872ad94cc → 29385a6c9027b942ab612da9ed891b3d} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2bec18569db80effd80a2a19a038100b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{93dd91f6519f569f11fddf4df22460d9 → 30ca7caa200fa8eaddaef443913ad9ad} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{92c82efebbff4c3a9f96e08b308e92dd → 350a65d446eb7398f96d102f7a1a6d69} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4052820c15af72ba690230a0f92bd75e +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/{aa92d8a74950d2d6217a51424ce4b33b → 4e93570db72bb61820711448b78d548d} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/50b9db0b908b421a9b941a445dbaeacc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5155772cce704d83a64aa83eeda20c5a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/528c628cf107f8be6dd122e1154344be +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5ed02c7072bb024fa0832a1ca4113227 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/60141dc3d16c502963c3d798a099862d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{42ea718e494af5b51ce031822614b04d → 66ccc51251ba05bbab6ef05410f39dc2} +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/88ded10f28177bec1bddb0d72d6b1cd2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8edfca9082e02111be92e79000667f22 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/90b54a819800edfa41b67722d1561040 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/93aaa9231a32901266b05632f3d35ecd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9c653367feff82588eb6041d783a5809 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{e6a1afebb687728d619fe27e84335d2f → 9ce190f082dc4fb74bddb818cc011ce6} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{cc2c4b7bdb6167f64e3e25d282c318ff → a98ce7749f3cf3129873fb62e7842c28} +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/{8ea9ff17090b736331312d04c8036810 → b1a42de74c934edd0e5eed0f98a23597} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b1c03c36188b4f58f819510adb9a7e9c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{82dd05a187bccd30f62fabb16491fe03 → b225d67626669cb154cbe08a3c439d48} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b35e12934e9f05662777579549e31cd7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{d32e733978c8eb7c7db3ec2b865ee87f → b3ae9e3cdd9991d7103b0a00e33b5778} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b42c247628daaf44109584724682a6ad +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{7f804c48c333d9758fa49ff9331b78e2 → b660ec1ede271559cfd0259eed96ae9c} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{fed76e6bd857a06488c186874bbe2bb2 → ba078b29a7f067b3acdd538a286235a8} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bb108ef3fc4c96d1c20cc41f97d943a0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b146aa842b38c17ed4117b2f52d4b51f → bb92f4b8c1bedafe60b6f226b549138a} +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/{8fad7abbbfbb3748b36d73dfb482c2bd → d1bce36d6e3ab792562b9c929f2ce897} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d24a7c4b8ac71a90e809881a64970898 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{82de1c42365fd1cf6a2adc2f644150c1 → db0d9534ecdebba33af5d1d81060e855} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dbba4bbc32c17ade3d618c5d0baeb371 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e8276b98892dcac8285a592bb63fe75b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e9f7ccc553ce1a217709cc7a08cfb032 +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/f274b5f22db177b6464b50691d531688 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{53329c49c9b4ba25d31c73c9b98260b0 → f3935581a84aba9a499005ed6a8e18be} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{cd59839c2fc0d494ffa76ef4c4dbfa42 → f3e7729c53b8a2c408086a61b58922ae} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f45dfdb34e84d3c72a3319399a7316a3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{b6d54919d5e4a3921287a5fb178dc455 → f74af03e26e893af40b07a6d0f970cd4} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/{f7a87683461c3a58ee9b6e9546473c4e → fa11f1beb15b0f04503ce1f06701a8bf} +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/faac2909046aa87e1f1f08b2bf0ad2b2 +0 -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/harvesters/api_harvester_spec.rb~ +47 -0
- data/spec/lib/krikri/harvesters/basic_save_behavior_spec.rb~ +12 -0
- data/spec/lib/krikri/harvesters/file_harvester_spec.rb~ +3 -0
- data/spec/lib/krikri/harvesters/harvest_behavior_spec.rb~ +5 -0
- data/spec/lib/krikri/harvesters/mdl_api_harvester_spec.rb~ +11 -0
- data/spec/lib/krikri/harvesters/mdl_harvester_spec.rb~ +8 -0
- data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +7 -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/job_spec.rb~ +13 -0
- data/spec/lib/krikri/map_crosswalk_spec.rb~ +5 -0
- data/spec/lib/krikri/mapper_agent_spec.rb~ +64 -0
- data/spec/lib/krikri/mapper_spec.rb~ +5 -0
- 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/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/qa_query_client_spec.rb~ +9 -0
- data/spec/lib/krikri/random_search_index_docmument_builder_spec.rb~ +6 -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/models/provider_spec.rb~ +33 -0
- data/spec/models/qa_report_spec.rb~ +64 -0
- data/spec/models/validation_report_spec.rb~ +15 -0
- data/spec/support/shared_contexts/indexed_item.rb~ +15 -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_contexts/rake.rb~ +21 -0
- data/spec/support/shared_examples/enrichment.rb~ +5 -0
- data/spec/support/shared_examples/harvest_behavior.rb~ +13 -0
- 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/views/krikri/providers/index.html.erb_spec.rb~ +3 -0
- data/spec/views/krikri/providers/show.html.erb.spec~ +12 -0
- data/spec/views/krikri/providers/show.html.erb_spec.rb~ +10 -0
- data/spec/views/krikri/qa_reports/index.html.erb_spec.rb~ +17 -0
- data/spec/views/krikri/qa_reports/show.html.erb_spec.rb~ +22 -0
- data/spec/views/krikri/records/index.html.erb_spec.rb~ +15 -0
- data/spec/views/krikri/records/show.html.erb_spec.rb~ +8 -0
- data/spec/views/krikri/reports/index.html.erb_spec.rb~ +5 -0
- data/spec/webmocks/oai.rb~ +13 -0
- metadata +632 -453
- 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/05604ccd7329b6afb8e7cdafbaa09fe3 +0 -0
- 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/0e349883625d7536c00fac0eafde4415 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0f05dd42159c418ddcfa12edd10d98bb +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1877c8233ee501d08788d7324a70bd70 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1c814c5c5dfd63768fff312c442847d6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1e699d4d1e439eeb1d52a210573f5053 +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/39ed74e4d194593ec48c481d0fd76007 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/40271adcb3c4654dcb20b55abc2505c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/402ffe46f4586abacce366e0e3f690d8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/46ec3d34d3576e4452b0a95b87176996 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4c5e3966eae6a44e852dcf449c3f4cb0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/52ce034583a746333fd7b8aa3916b8e1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/52fe40fddbd8e73f6743866d4930bde6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/677fd27eda24da657f51d725742582f3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6b2c5572f9e2cd322ad7b2878673d0dd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/735621cd88de5e37980cced4fb13ded9 +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/857d45eb67a43a30a6d5d0370464e596 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8da6b6aafe413b1ba635e82f71c194be +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9181f512b689ddb01d6778bac83791ac +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9443255223294f7ad9ad6daba446afc3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/96ff03d6a5f9604c6980874bb00c1d17 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9ca9885875e2e0ab4e531cba60aa03e5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a13d3a27038cf6570d22b54c54442642 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b37776526b5809e55fbb0add6d059127 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c514fd002d57ddf3d94669e369d45283 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d6995317fba3b6344c75db70b8c997e2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f64fd792a429f69332c1489015953219 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acb9717b689c2284ce0a35f93d7b015163815c79
|
4
|
+
data.tar.gz: bb147f029097ec38d27d4b89708edf712b0abf62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a83db3cc736d955d97145d3665f47993417293e9e86dc2ebc1b662b0800ce79054d91317dc90647e940bdff3b6f2c2218a96bdeb159069def9f4638540598ef6
|
7
|
+
data.tar.gz: d28a6972b162b22266892c0f91b890df645e25fc714741cebf92dbb21274b5bc2fdf30e6c04720eda5d0c89975a661183f0001b59fb5a106fcfa21007ba46051
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<h3>Validation Reports</h3>
|
2
|
+
<% if @validation_reports %>
|
3
|
+
<ul>
|
4
|
+
<% @validation_reports.each do |validation_report| %>
|
5
|
+
<li><%= render_validation_report(validation_report) %></li>
|
6
|
+
<% end %>
|
7
|
+
</ul>
|
8
|
+
<% else %>
|
9
|
+
<div>There was an error generating the QA reports.</div>
|
10
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Krikri
|
2
|
+
##
|
3
|
+
# Handles HTTP requests for QA Reports
|
4
|
+
class QAReportsController < ApplicationController
|
5
|
+
include Concerns::ProviderContext
|
6
|
+
|
7
|
+
before_action :authenticate_user!, :set_current_provider
|
8
|
+
|
9
|
+
def show
|
10
|
+
require 'pry'
|
11
|
+
binding.pry
|
12
|
+
respond_to do |format|
|
13
|
+
format.html
|
14
|
+
format.csv { render csv: 'test' }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<% # krikri/institutions/show %>
|
@@ -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/krikri/engine.rb
CHANGED
@@ -4,13 +4,15 @@ module Krikri::Enrichments
|
|
4
4
|
class DcmiEnforcer
|
5
5
|
include Audumbla::FieldEnrichment
|
6
6
|
|
7
|
+
TERMS = RDF::DCMITYPE.to_a
|
8
|
+
|
7
9
|
##
|
8
10
|
# @param value [Object] the value to enrich
|
9
11
|
#
|
10
12
|
# @return [DPLA::MAP::Controlled::DCMIType, nil] the original value or `nil`
|
11
13
|
def enrich_value(value)
|
12
14
|
return nil unless value.is_a? DPLA::MAP::Controlled::DCMIType
|
13
|
-
return nil unless value.
|
15
|
+
return nil unless TERMS.include? value.rdf_subject
|
14
16
|
value
|
15
17
|
end
|
16
18
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Krikri::LDP
|
2
|
+
class Container < ActiveTriples::Resource
|
3
|
+
include Krikri::LDP::Resource
|
4
|
+
|
5
|
+
configure :type => RDF::URI('http://www.w3.org/ns/ldp#Container')
|
6
|
+
|
7
|
+
def initialize(uri, slug)
|
8
|
+
@ldp_uri = uri
|
9
|
+
@container_slug = slug
|
10
|
+
super("#{uri}/#{slug}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def save(body = nil, opts = {})
|
14
|
+
opts[:Link] = "<#{type.first.to_s}>; rel='type'"
|
15
|
+
opts[:Slug] = @container_slug
|
16
|
+
opts[:method] = :post unless exists?
|
17
|
+
body ||= (dump :ttl)
|
18
|
+
opts['Content-Type'] ||= 'text/turtle'
|
19
|
+
super(body, opts)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Krikri::LDP
|
2
|
+
module RdfSource
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
include Krikri::LDP::Resource
|
5
|
+
|
6
|
+
def save(headers = {})
|
7
|
+
result = super(dump(:ttl))
|
8
|
+
get
|
9
|
+
result
|
10
|
+
end
|
11
|
+
|
12
|
+
def get(*args)
|
13
|
+
result = super
|
14
|
+
reload
|
15
|
+
result
|
16
|
+
end
|
17
|
+
|
18
|
+
def reload
|
19
|
+
return super unless !node? && exists?
|
20
|
+
clear
|
21
|
+
self << RDF::Reader.for(:ttl).new(@http_cache.body).statements
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday_middleware'
|
3
|
+
|
4
|
+
module Krikri::LDP
|
5
|
+
module Resource
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
attr_accessor :rdf_subject, :connection_uri
|
9
|
+
|
10
|
+
def ldp_connection
|
11
|
+
@ldp_conn ||= Faraday.new(connection_uri) do |conn|
|
12
|
+
conn.use Faraday::Response::RaiseError
|
13
|
+
conn.use FaradayMiddleware::FollowRedirects, limit: 3
|
14
|
+
conn.adapter Faraday.default_adapter
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def etag
|
19
|
+
http_head.env['response_headers']['etag']
|
20
|
+
end
|
21
|
+
|
22
|
+
def http_head
|
23
|
+
raise 'No subject set for LDP resource.' if rdf_subject.nil?
|
24
|
+
@http_cache ||= ldp_connection.head { |request| request.url rdf_subject }
|
25
|
+
end
|
26
|
+
|
27
|
+
def exists?
|
28
|
+
return true if rdf_subject && http_head
|
29
|
+
false
|
30
|
+
rescue Faraday::ResourceNotFound
|
31
|
+
false
|
32
|
+
end
|
33
|
+
|
34
|
+
def save(uri, body = nil, opts = {})
|
35
|
+
require 'pry'
|
36
|
+
binding.pry
|
37
|
+
create(uri, body, opts)
|
38
|
+
end
|
39
|
+
|
40
|
+
def create(uri, body = nil, opts = {})
|
41
|
+
response = ldp_connection.post do |request|
|
42
|
+
request.url uri
|
43
|
+
request.headers = opts if opts
|
44
|
+
request.body = body
|
45
|
+
end
|
46
|
+
response
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Krikri
|
2
|
+
##
|
3
|
+
# A parser for JSON records
|
4
|
+
# @see Krikri::Parser
|
5
|
+
class JsonParser < Krikri::Parser
|
6
|
+
def initialize(record)
|
7
|
+
@root = Value.new(JSON.parse(record.content))
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
class Value < Krikri::Parser::Value
|
12
|
+
def initialize(json)
|
13
|
+
@json = json
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Krikri
|
2
|
+
##
|
3
|
+
# An XmlParser
|
4
|
+
# @see Krikri::Parser
|
5
|
+
class XmlParser < Krikri::Parser
|
6
|
+
def initialize(record, root_path = '/')
|
7
|
+
xml = Nokogiri::XML(record.to_s)
|
8
|
+
ns = namespaces_from_xml(xml)
|
9
|
+
@root = Value.new(xml.at_xpath(root_path, ns), ns)
|
10
|
+
super(record)
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def namespaces_from_xml(xml)
|
16
|
+
namespaces = xml.collect_namespaces.map do |k, v|
|
17
|
+
[k.gsub('xmlns:', ''), v]
|
18
|
+
end
|
19
|
+
namespaces.to_h
|
20
|
+
end
|
21
|
+
|
22
|
+
##
|
23
|
+
# An XML Parser Value node class
|
24
|
+
# @see Krikri::Parser::Value
|
25
|
+
class Value < Krikri::Parser::Value
|
26
|
+
def initialize(node, namespaces)
|
27
|
+
node = node.root if node.xml?
|
28
|
+
@node = node
|
29
|
+
@namespaces = namespaces
|
30
|
+
end
|
31
|
+
|
32
|
+
delegate :attributes, :xpath, :at_xpath, :css, :at_css, :to => :@node
|
33
|
+
|
34
|
+
def children
|
35
|
+
@node.element_children.map do |child|
|
36
|
+
return child.name unless child.namespace
|
37
|
+
"#{@namespaces.key(child.namespace.href)}:#{child.name}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def values
|
42
|
+
select_values.map(&:text)
|
43
|
+
end
|
44
|
+
|
45
|
+
def values?
|
46
|
+
!select_values.empty?
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def get_child_nodes(name)
|
52
|
+
@node.xpath("#{@node.path}/#{name}", @namespaces)
|
53
|
+
.map { |node| self.class.new(node, @namespaces) }
|
54
|
+
end
|
55
|
+
|
56
|
+
def select_values
|
57
|
+
@node.children.select(&:text?)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Krikri::Util
|
2
|
+
module ExtendedDateParser
|
3
|
+
|
4
|
+
##
|
5
|
+
# e.g. 1990s or 199- or 199x
|
6
|
+
def decade(str)
|
7
|
+
decade
|
8
|
+
end
|
9
|
+
|
10
|
+
##
|
11
|
+
# e.g. 1990s
|
12
|
+
def decade_s(str)
|
13
|
+
/^(\d{3})0s$/.match(str) do |m|
|
14
|
+
Date.edtf("#{m[1]}x")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
##
|
19
|
+
# e.g. 199-
|
20
|
+
def decade_hyphen(str)
|
21
|
+
/^(\d{3})-$/.match(str) do |m|
|
22
|
+
Date.edtf("#{m[1]}x")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Krikri::Util
|
2
|
+
module ExtendedDateParser
|
3
|
+
module_function
|
4
|
+
|
5
|
+
def parse(date_str)
|
6
|
+
date = Date.edtf(date_str)
|
7
|
+
date ||= partial_edtf(date_str)
|
8
|
+
date ||= decade_hyphen(date_str)
|
9
|
+
date ||= month_year(date_str)
|
10
|
+
date ||= decade_s(date_str)
|
11
|
+
date ||= hyphenated_partial_range(date_str)
|
12
|
+
date ||= begin
|
13
|
+
Date.parse(date_str)
|
14
|
+
rescue ArgumentError
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def range_match(str)
|
20
|
+
regexp = %r{
|
21
|
+
([\d\-\.xu\?\~]*\d{4}[\d\-\.xu\?\~]*)
|
22
|
+
\s*[-\.]+\s*
|
23
|
+
([\d\-\.xu\?\~]*\d{4}[\d\.\-xu\?\~]*)
|
24
|
+
}x
|
25
|
+
regexp.match(str) do |m|
|
26
|
+
[m[1], m[2]]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# e.g. 01-2045
|
32
|
+
def month_year(str)
|
33
|
+
/(\d{2})-(\d{4})/.match(str) do |m|
|
34
|
+
Date.edtf("#{m[2]}-#{m[1]}")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# e.g. 1990-92
|
40
|
+
def hyphenated_partial_range(str)
|
41
|
+
/^(\d{2})(\d{2})-(\d{2})$/.match(str) do |m|
|
42
|
+
Date.edtf("#{m[1]}#{m[2]}/#{m[1]}#{m[3]}")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# e.g. 1970-08-01/02 or 1970-12/10
|
48
|
+
def partial_edtf(str)
|
49
|
+
/^(\d{4}(-\d{2})*)-(\d{2})\/(\d{2})$/.match(str) do |m|
|
50
|
+
Date.edtf("#{m[1]}-#{m[3]}/#{m[1]}-#{m[4]}")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# e.g. 1990s
|
56
|
+
def decade_s(str)
|
57
|
+
/^(\d{3})0s$/.match(str) do |m|
|
58
|
+
Date.edtf("#{m[1]}x")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# e.g. 199-
|
64
|
+
def decade_hyphen(str)
|
65
|
+
/^(\d{3})-$/.match(str) do |m|
|
66
|
+
Date.edtf("#{m[1]}x")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|