Skip to content

Commit

Permalink
Apollo's first working version
Browse files Browse the repository at this point in the history
- Updated migrations for the new test data
- Updated readme
- Added view block to list images related to subjects on their pages
- Fixed preceding character in apollo.csv that was causing a migration error for that file
  • Loading branch information
seth-shaw-unlv committed Apr 10, 2018
1 parent 741bd03 commit e7d9c25
Show file tree
Hide file tree
Showing 14 changed files with 468 additions and 104 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Proof of Concept: CLAW Migrate Files (Apollo Edition)

**STILL UNDER CONSTRUCTION**

This repository consists of two modules:

1. unlv_image: A local implementation of the Islandora Image module to include additional metadata fields.
Expand All @@ -15,10 +13,10 @@ The source data used for this proof of concept came from the [Project Apollo Arc

# Running

Note: using drush with migrate_tools is optional, but the instructions assumes it is enabled
Note: using drush with migrate_tools is optional, but the instructions assume it is installed.

1. Copy the migrate_cdm and unlv_image directories to your modules directory
2. Copy the data directory to the directory containing your drupal root (drupal root and the data directory will be parallel.)
3. Enable the modules. E.g. `drush en -y migrate_cdm`
4. Migrate the authorities. E.g. `drush mim tematres_agents`
5. Migrate the images. E.g. `drush mim --all` (Migrate will automatically skip any authorities in tematres_agents we already migrated.)
1. Copy the data directory to your drupal web root (e.g. in my tests the drupal web root is `/var/www/drupalvm/drupal/web` and the data directory is `/var/www/drupalvm/drupal/web/data`).
2. Copy the migrate_cdm and unlv_image directories to your modules directory.
3. Enable the modules. E.g. `drush en -y migrate_tools migrate_apollo`.
4. Run the migration. E.g. `drush mim --all`.
5. See a wonderful list of the newly migrated images on your Drupal site's front page!
2 changes: 1 addition & 1 deletion data/apollo.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AS11-36-5390,Apollo 11 Hasselblad image from film magazine 36/N - Trans-Lunar,"Neil took this picture of Buzz during their initial inspection of the LM at about 057:03. Journal Contributor David Sander notes that ""Buzz is wearing his intravehicular suit, a specially made set of garments designed to be as flame retardant as the rest of the ship, and made from the same fabric as the outer layer of the spacesuits"". Paolo Attivissimo notes that Buzz's watch reads 5:35 (Houston time), which is 57:03 GET (Ground Elapsed Time)","Aldrin, Buzz",
AS11-36-5390,Apollo 11 Hasselblad image from film magazine 36/N - Trans-Lunar,"Neil took this picture of Buzz during their initial inspection of the LM at about 057:03. Journal Contributor David Sander notes that ""Buzz is wearing his intravehicular suit, a specially made set of garments designed to be as flame retardant as the rest of the ship, and made from the same fabric as the outer layer of the spacesuits"". Paolo Attivissimo notes that Buzz's watch reads 5:35 (Houston time), which is 57:03 GET (Ground Elapsed Time)","Aldrin, Buzz",
AS11-37-5528,"Apollo 11 Hasselblad image from film magazine 37/R - Orbit, Post-Landing, Post-EVA",,"Armstrong, Neil",
AS11-37-5545,"Apollo 11 Hasselblad image from film magazine 37/R - Orbit, Post-Landing, Post-EVA",,,Flags--United States
AS11-40-5850,Apollo 11 Hasselblad image from film magazine 40/S - EVA,"First EVA picture. Neil's first frame in a pan taken west of the ladder. Jettison bag under the Descent Stage, south footpad, bent probe, strut supports. The view is more or less up-Sun, so we are seeing the shadowed faces of boulders. 20 July 1969.",,Lunar excursion module;Moonwalk
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: auth_complex
label: Import MADS ComplexSubject Authorities
migration_group: authorities

source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: xml
urls: 'data/apollo-auths.rdf' # Path relative to Drupal site root
item_selector: /rdf:RDF/madsrdf:ComplexSubject
fields:
-
name: uri
label: 'URI'
selector: '@rdf:about'
-
name: pref_label
label: 'MADS Auth Label'
selector: 'madsrdf:authoritativeLabel'
-
name: ref_uri
label: "External Authority"
selector: 'skos:exactMatch/@rdf:resource'

ids:
uri:
type: string

destination:
plugin: entity:node

process:
type:
plugin: default_value
default_value: subject
title: pref_label
field_uris:
- # Skip this field if there are no skos:exactMatch
plugin: skip_on_empty
method: process
source: ref_uri
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: auth_geographic
label: Import MADS Geographic Authorities
migration_group: authorities

source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: xml
urls: 'data/apollo-auths.rdf' # Path relative to Drupal site root
item_selector: /rdf:RDF/madsrdf:Geographic
fields:
-
name: uri
label: 'URI'
selector: '@rdf:about'
-
name: pref_label
label: 'MADS Auth Label'
selector: 'madsrdf:authoritativeLabel'
-
name: ref_uri
label: "External Authority"
selector: 'skos:exactMatch/@rdf:resource'

ids:
uri:
type: string

destination:
plugin: entity:node

process:
type:
plugin: default_value
default_value: subject
title: pref_label
field_uris:
- # Skip this field if there are no skos:exactMatch
plugin: skip_on_empty
method: process
source: ref_uri
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: auth_person
label: Import MADS PersonalName Authorities
migration_group: authorities

source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: xml
urls: 'data/apollo-auths.rdf' # Path relative to Drupal site root
item_selector: /rdf:RDF/madsrdf:PersonalName
fields:
-
name: uri
label: 'URI'
selector: '@rdf:about'
-
name: pref_label
label: 'MADS Auth Label'
selector: 'madsrdf:authoritativeLabel'
-
name: ref_uri
label: "External Authority"
selector: 'skos:exactMatch/@rdf:resource'

ids:
uri:
type: string

destination:
plugin: entity:node

process:
type:
plugin: default_value
default_value: person
title: pref_label
field_uris:
- # Skip this field if there are no skos:exactMatch
plugin: skip_on_empty
method: process
source: ref_uri
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: auth_topic
label: Import MADS Topic Authorities
migration_group: authorities

source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: xml
urls: 'data/apollo-auths.rdf' # Path relative to Drupal site root
item_selector: /rdf:RDF/madsrdf:Topic
fields:
-
name: uri
label: 'URI'
selector: '@rdf:about'
-
name: pref_label
label: 'MADS Auth Label'
selector: 'madsrdf:authoritativeLabel'
-
name: ref_uri
label: "External Authority"
selector: 'skos:exactMatch/@rdf:resource'

ids:
uri:
type: string

destination:
plugin: entity:node

process:
type:
plugin: default_value
default_value: subject
title: pref_label
field_uris:
- # Skip this field if there are no skos:exactMatch
plugin: skip_on_empty
method: process
source: ref_uri
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
id: cdm_file_import
label: Import CDM Image Files
id: claw_file
label: Import Image Files
migration_group: test_digital

source:
plugin: csv
path: '../data/source.csv' # Path relative to Drupal site root
path: 'data/apollo.csv' # Path relative to Drupal site root
delimiter: ','
header_row_count: 0 # No headers, 1 if there are headers
keys:
- digital_id
constants:
source_base_dir: '../data/images'
source_base_dir: 'data/images'
collection_alias: 'apollo'
dest_base_dir: 'public://originals'
extension: 'tiff'
column_names:
column_names:
0:
digital_id: 'Digital ID' # basename of the file
1:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
id: cdm_image_import
id: claw_image
label: Import CDM Images
migration_group: test_digital

migration_dependencies:
required:
- cdm_media_import
- authorities # Loading authorities first allows us to look them up
- claw_media
# Loading authorities first allows us to look them up
- auth_person
- auth_complex
- auth_geographic
- auth_topic

source:
plugin: csv
path: '../data/source.csv' # Path relative to Drupal site root
path: 'data/apollo.csv' # Path relative to Drupal site root
delimiter: ','
header_row_count: 0 # No headers, 1 if there are headers
keys:
Expand Down Expand Up @@ -62,12 +66,9 @@ process:
type: person

temp_subjects: # Temporary field of subjects
-
plugin: concat # Multiple CSV fields include subjects
delimiter: ';'
source: subjects
-
plugin: skip_on_empty
source: subjects
method: process
-
plugin: explode
Expand All @@ -80,6 +81,7 @@ process:
entity_type: node
default_values:
type: subject

field_subjects: # Gather temp arrays into the destination field
-
plugin: get
Expand All @@ -92,7 +94,7 @@ process:
# Now the TIFF entity references
field_tiff/target_id:
plugin: migration_lookup
migration: cdm_media_import
migration: claw_media
source: digital_id
no_stub: true
field_tiff/alt: title
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
id: cdm_media_import
id: claw_media
label: Import CDM Image Media
migration_group: test_digital

migration_dependencies:
required:
- cdm_file_import
- claw_file

source:
plugin: csv
path: '../data/source.csv' # Path relative to Drupal site root
path: 'data/apollo.csv' # Path relative to Drupal site root
delimiter: ','
header_row_count: 0 # No headers, 1 if there are headers
keys:
Expand All @@ -20,13 +20,13 @@ source:
process:
mid:
plugin: migration_lookup
migration: cdm_file_import
migration: claw_file
source: digital_id
no_stub: true

field_file/target_id:
plugin: migration_lookup
migration: cdm_file_import
migration: claw_file
source: digital_id
no_stub: true

Expand Down
11 changes: 11 additions & 0 deletions migrate_apollo/migrate_apollo.info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Migrate Islandora CLAW Images: Apollo Demo'
description: Migrates Master Tiff Images into an Islandora Claw Image derivative using Apollo 11 mission photos as an example.
package: custom
type: module
core: 8.x

dependencies:
- drupal:migrate
- migrate_plus:migrate_plus
- migrate_source_csv
- unlv_image
65 changes: 0 additions & 65 deletions migrate_cdm/config/install/migrate_plus.migration.authorities.yml

This file was deleted.

Loading

0 comments on commit e7d9c25

Please sign in to comment.