Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/models/archivematica_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def repeating
dc_identifier_orcid
dc_contributor_advisor
degree_fields
dc_contributor_department
dc_relation_orgunit
rights_fields
end

Expand Down Expand Up @@ -124,9 +124,9 @@ def rights_author(file, file_number)
@csv_hash["f#{file_number}".to_sym] << copyright_check(file)
end

def dc_contributor_department
def dc_relation_orgunit
@thesis.departments.each do |dept|
@csv_hash[:headers] << 'dc.contributor.department'
@csv_hash[:headers] << 'dc.relation.orgunit'
@thesis.files.each_with_index do |file, i|
@csv_hash["f#{i}".to_sym] << thesis_pdf_checker(file, dept.name_dspace)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/dspace_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def parse_orcids(thesis_users)

def departments(thesis_depts)
thesis_depts.each do |d|
add_metadata('dc.contributor.department', d.name_dspace)
add_metadata('dc.relation.orgunit', d.name_dspace)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/files/thesis_1234_archivematica.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
filename,Level_of_DPCommitment,dc.title,dc.date.issued,dc.date.submitted,dc.type,dc.description.abstract,dc.identifier.uri,BitstreamDescription,BitstreamChecksumValue,BitstreamChecksumAlgorithm,dc.publisher,dcterms.isPartOf,dc.contributor.author,dc.identifier.orcid,dc.contributor.advisor,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.contributor.department,dc.rights,dc.rights,dc.rights.uri
filename,Level_of_DPCommitment,dc.title,dc.date.issued,dc.date.submitted,dc.type,dc.description.abstract,dc.identifier.uri,BitstreamDescription,BitstreamChecksumValue,BitstreamChecksumAlgorithm,dc.publisher,dcterms.isPartOf,dc.contributor.author,dc.identifier.orcid,dc.contributor.advisor,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.relation.orgunit,dc.rights,dc.rights,dc.rights.uri
data/a_pdf.pdf,Level 3,MyString,2017-09,2021-12-25 12:20:00 UTC,Thesis,MyText,"",Thesis PDF,2800ec8c99c60f5b15520beac9939a46,MD5,Massachusetts Institute of Technology,AIC#Course_16_theses,"Yobot, Yo",0001,Addy McAdvisor,MFA,Master of Fine Arts,Bachelor,Massachusetts Institute of Technology. Department of Aeronautics and Astronautics,In Copyright - Educational Use Permitted,Copyright MIT,http://rightsstatements.org/page/InC-EDU/1.0/
data/b_pdf.pdf,"","","","","","","",Signature page,2800ec8c99c60f5b15520beac9939a46,MD5,"","","","","","","","","","","",""
2 changes: 1 addition & 1 deletion test/fixtures/submission_information_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sip_one:
196128f55c62f4c246bed52b07d3ae1c data/registrar.csv
3ac6f5cac4e09a6c95ee4004ebe19c51 data/metadata.csv
metadata: >-
filename,Level_of_DPCommitment,dc.title,dc.date.issued,dc.date.submitted,dc.type,dc.description.abstract,dc.identifier.uri,BitstreamDescription,BitstreamChecksumValue,BitstreamChecksumAlgorithm,dc.publisher,dc.terms.isPartOf,dc.terms.isPartOf,dc.contributor.author,dc.contributor.author,dc.identifier.orcid,dc.identifier.orcid,dc.contributor.advisor,dc.contributor.advisor,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.contributor.department,dc.contributor.department,dc.rights,dc.rights,dc.rights.uri
filename,Level_of_DPCommitment,dc.title,dc.date.issued,dc.date.submitted,dc.type,dc.description.abstract,dc.identifier.uri,BitstreamDescription,BitstreamChecksumValue,BitstreamChecksumAlgorithm,dc.publisher,dc.terms.isPartOf,dc.terms.isPartOf,dc.contributor.author,dc.contributor.author,dc.identifier.orcid,dc.identifier.orcid,dc.contributor.advisor,dc.contributor.advisor,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.description.degree,thesis.degree.name,mit.thesis.degree,dc.relation.orgunit,dc.relation.orgunit,dc.rights,dc.rights,dc.rights.uri

data/registrar.csv,Level 3,On the importance of titles,2022-02,2021-08-13
18:22:45 UTC,Thesis,"Lorem ipsum dolor sit amet, consectetur adipiscing
Expand Down
4 changes: 2 additions & 2 deletions test/models/archivematica_metadata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def publishing_friendly_thesis(thesis)
meta = ArchivematicaMetadata.new(t)
csv = meta.instance_variable_get(:@csv_hash)
assert_equal(csv[:headers],
["filename", "Level_of_DPCommitment", "dc.title", "dc.date.issued", "dc.date.submitted", "dc.type", "dc.description.abstract", "dc.identifier.uri", "BitstreamDescription", "BitstreamChecksumValue", "BitstreamChecksumAlgorithm", "dc.publisher", "dcterms.isPartOf", "dc.contributor.author", "dc.identifier.orcid", "dc.contributor.advisor", "dc.description.degree", "thesis.degree.name", "mit.thesis.degree", "dc.contributor.department", "dc.rights", "dc.rights", "dc.rights.uri"]
["filename", "Level_of_DPCommitment", "dc.title", "dc.date.issued", "dc.date.submitted", "dc.type", "dc.description.abstract", "dc.identifier.uri", "BitstreamDescription", "BitstreamChecksumValue", "BitstreamChecksumAlgorithm", "dc.publisher", "dcterms.isPartOf", "dc.contributor.author", "dc.identifier.orcid", "dc.contributor.advisor", "dc.description.degree", "thesis.degree.name", "mit.thesis.degree", "dc.relation.orgunit", "dc.rights", "dc.rights", "dc.rights.uri"]
)
end

Expand Down Expand Up @@ -145,7 +145,7 @@ def publishing_friendly_thesis(thesis)

t = theses(:one)
publishing_friendly_thesis(t)
assert_equal("b4f000886b890d2628f3d7500cecdfd9", ArchivematicaMetadata.new(t).md5)
assert_equal("d2fbe3f4a3bbbac0dcd393cbf1bb38a3", ArchivematicaMetadata.new(t).md5)

end
end
Expand Down
8 changes: 4 additions & 4 deletions test/models/dspace_metadata_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ def dss_friendly_thesis(thesis)
unserialized = JSON.parse(serialized)

assert unserialized['metadata'].include?(
{ 'key' => 'dc.contributor.department',
{ 'key' => 'dc.relation.orgunit',
'value' => 'Massachusetts Institute of Technology. Department of Aeronautics and Astronautics' }
)
refute unserialized['metadata'].include?({ 'key' => 'dc.contributor.department',
refute unserialized['metadata'].include?({ 'key' => 'dc.relation.orgunit',
'value' => 'MIT Anthropology Program' })

# Multiple departments
Expand All @@ -256,10 +256,10 @@ def dss_friendly_thesis(thesis)
unserialized = JSON.parse(serialized)

assert unserialized['metadata'].include?(
{ 'key' => 'dc.contributor.department',
{ 'key' => 'dc.relation.orgunit',
'value' => 'Massachusetts Institute of Technology. Department of Aeronautics and Astronautics' }
)
assert unserialized['metadata'].include?({ 'key' => 'dc.contributor.department',
assert unserialized['metadata'].include?({ 'key' => 'dc.relation.orgunit',
'value' => 'MIT Anthropology Program' })
end

Expand Down