Skip to content

Commit

Permalink
Restructure claim fixtures, add many unqualified claim fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
mdholloway committed Jan 14, 2025
1 parent 06e23ee commit 6a40cc2
Show file tree
Hide file tree
Showing 29 changed files with 195 additions and 23 deletions.
4 changes: 2 additions & 2 deletions spec/digital_scriptorium/link_claim_transformer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module DigitalScriptorium

RSpec.describe LinkClaimTransformer do
context 'with an institutional record (P9) claim' do
json = read_fixture('claims/unqualified/P9_institutional_record.json')
json = read_fixture('claims/P9_institutional_record.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'institutional_record_link' => ['https://franklin.library.upenn.edu/catalog/FRANKLIN_9949945603503681']
Expand All @@ -22,7 +22,7 @@ module DigitalScriptorium
end

context 'with an IIIF manifest (P41) claim' do
json = read_fixture('claims/unqualified/P41_iiif_manifest.json')
json = read_fixture('claims/P41_iiif_manifest.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'iiif_manifest_link' => ['https://colenda.library.upenn.edu/phalt/iiif/2/81431-p33p8v/manifest'],
Expand Down
12 changes: 6 additions & 6 deletions spec/digital_scriptorium/name_claim_transformer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

module DigitalScriptorium
RSpec.describe NameClaimTransformer do
context 'with a single name in authority file (P17) qualifier' do
json = read_fixture('claims/qualified/P14_name.json')
context 'with a single authority file (P17) qualifier' do
json = read_fixture('claims/P14_name_qualified_no_original_script.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'owner_display' => [{
Expand All @@ -26,8 +26,8 @@ module DigitalScriptorium
end
end

context 'with multiple name in authority file (P17) qualifiers' do
json = read_fixture('claims/qualified/P14_name_multiple_qualifier_values.json')
context 'with multiple authority file (P17) qualifiers' do
json = read_fixture('claims/P14_name_multiple_qualifier_values.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)

recorded_value = 'From the codex made for Leonello d\'Este. ' \
Expand Down Expand Up @@ -61,8 +61,8 @@ module DigitalScriptorium
end
end

context 'with an original script (P13) qualifier' do
json = read_fixture('claims/qualified/P14_name_original_script.json')
context 'with a authority file (P17) and original script (P13) qualifiers' do
json = read_fixture('claims/P14_name_qualified_original_script.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'author_display' => [{
Expand Down
24 changes: 12 additions & 12 deletions spec/digital_scriptorium/qualified_claim_transformer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ def build_claim(json)
StatementRepresenter.new(Statement.new).from_json(json)
end

context 'with an institution (P5) claim' do
json = read_fixture('claims/qualified/P5_institution.json')
context 'with an qualified institution (P5) claim' do
json = read_fixture('claims/P5_institution_qualified.json')
expected = {
'institution_display' => [{
'recorded_value' => 'University of Pennsylvania',
'recorded_value' => 'U. of Penna.',
'linked_terms' => [{
'label' => 'University of Pennsylvania',
'source_url' => 'https://www.wikidata.org/wiki/Q49117'
}]
}.to_json],
'institution_search' => ['University of Pennsylvania'],
'institution_search' => ['U. of Penna.', 'University of Pennsylvania'],
'institution_facet' => ['University of Pennsylvania']
}

Expand All @@ -34,7 +34,7 @@ def build_claim(json)
end

context 'with a title (P10) claim with standard title (P11) and original script (P13) qualifiers' do
json = read_fixture('claims/qualified/P10_title.json')
json = read_fixture('claims/P10_title_qualified.json')
expected = {
'title_display' => [{
'recorded_value' => 'Kitāb al-Majisṭī',
Expand All @@ -52,7 +52,7 @@ def build_claim(json)
end

context 'with a qualified genre (P18) claim' do
json = read_fixture('claims/qualified/P18_genre.json')
json = read_fixture('claims/P18_genre_qualified.json')
expected = {
'term_display' => [{
'recorded_value' => 'Deeds',
Expand All @@ -69,7 +69,7 @@ def build_claim(json)
end

context 'with a qualified language (P21) claim' do
json = read_fixture('claims/qualified/P21_language.json')
json = read_fixture('claims/P21_language_qualified.json')
expected = {
'language_display' => [{
'recorded_value' => 'In Latin',
Expand All @@ -85,8 +85,8 @@ def build_claim(json)
end
end

context 'with a date (P23) claim' do
json = read_fixture('claims/qualified/P23_date.json')
context 'with a qualified date (P23) claim' do
json = read_fixture('claims/P23_date_qualified.json')
expected = {
'date_meta' => ['1358.'],
'date_display' => [{
Expand All @@ -109,8 +109,8 @@ def build_claim(json)
end
end

context 'with a place (P27) claim with multi-valued qualifier' do
json = read_fixture('claims/qualified/P27_place.json')
context 'with a qualified place (P27) claim with multi-valued qualifier' do
json = read_fixture('claims/P27_place_multiple_qualifier_values.json')
expected = {
'place_display' => [{
'recorded_value' => '[Provence or Spain],',
Expand All @@ -130,7 +130,7 @@ def build_claim(json)
end

context 'with a qualified material (P30) claim' do
json = read_fixture('claims/qualified/P30_material.json')
json = read_fixture('claims/P30_material_qualified.json')
expected = {
'material_display' => [{
'recorded_value' => 'parchment',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module DigitalScriptorium

RSpec.describe UnqualifiedClaimTransformer do
context 'with a shelfmark claim' do
json = read_fixture('claims/unqualified/P8_shelfmark.json')
json = read_fixture('claims/P8_shelfmark.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'shelfmark_display' => ['{"recorded_value":"Oversize LJS 110"}'],
Expand All @@ -24,7 +24,7 @@ module DigitalScriptorium
end

context 'with a physical description claim' do
json = read_fixture('claims/unqualified/P29_physical_description.json')
json = read_fixture('claims/P29_physical_description.json')
claim = StatementRepresenter.new(Statement.new).from_json(json)
expected = {
'physical_description_display' => ['{"recorded_value":"Extent: 1 parchment ; 170 x 245 mm."}'],
Expand Down
30 changes: 30 additions & 0 deletions spec/fixtures/claims/P10_title_qualfied_original_script_only.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P10",
"hash": "c543c2bae4274a088607a2055abe341658557324",
"datavalue": {
"value": "Kitāb al-Majisṭī",
"type": "string"
}
},
"type": "statement",
"qualifiers": {
"P13": [
{
"snaktype": "value",
"property": "P13",
"hash": "6aaaba1010b58d17a08c359fcd378b5847a3b3ad",
"datavalue": {
"value": "كتاب المجسطي.",
"type": "string"
}
}
]
},
"qualifiers-order": [
"P13"
],
"id": "Q649$B4FBF451-232F-4319-8333-9F3E1622E96E",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P10_title_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P10",
"hash": "c543c2bae4274a088607a2055abe341658557324",
"datavalue": {
"value": "Kitāb al-Majisṭī",
"type": "string"
}
},
"type": "statement",
"id": "Q649$B4FBF451-232F-4319-8333-9F3E1622E96E",
"rank": "normal"
}
30 changes: 30 additions & 0 deletions spec/fixtures/claims/P14_name_qualified_original_script_only.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P14",
"hash": "e6408806c91061c3bcdf84c60168dded2feb6701",
"datavalue": {
"value": "Dioscorides Pedanius, of Anazarbos",
"type": "string"
}
},
"type": "statement",
"qualifiers": {
"P13": [
{
"snaktype": "value",
"property": "P13",
"hash": "d2e77faa1d29cdc0793a2545248d83b3010cf706",
"datavalue": {
"value": "ديسقوريدس. of Anazarbos",
"type": "string"
}
}
]
},
"qualifiers-order": [
"P13"
],
"id": "Q514$854A97AF-34F1-40EE-9691-D9A85CC7748A",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P14_name_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P14",
"hash": "e6408806c91061c3bcdf84c60168dded2feb6701",
"datavalue": {
"value": "Dioscorides Pedanius, of Anazarbos",
"type": "string"
}
},
"type": "statement",
"id": "Q514$854A97AF-34F1-40EE-9691-D9A85CC7748A",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P18_genre_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P18",
"hash": "5d0305c385cd9e771a33cf3346a87909c54f9733",
"datavalue": {
"value": "Deeds",
"type": "string"
}
},
"type": "statement",
"id": "Q544$B974CC4D-4D42-47E2-8831-D687DDF3731A",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P21_language_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P21",
"hash": "9e246379b0dedebec12a4f1c930189c2cdc4935c",
"datavalue": {
"value": "In Latin",
"type": "string"
}
},
"type": "statement",
"id": "Q544$07404B0B-82AB-474F-B702-9E14D552B287",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P23_date_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P23",
"hash": "ff62be508403e913e71c078a14d32189f907eb0d",
"datavalue": {
"value": "1358.",
"type": "string"
}
},
"type": "statement",
"id": "Q544$868A931C-03C4-43DB-B6DB-FBB6A1ADD34C",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P27_place_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P27",
"hash": "64060adb20324c30cdacd76a5437499fa23d877e",
"datavalue": {
"value": "[Provence or Spain],",
"type": "string"
}
},
"type": "statement",
"id": "Q493$0711BABA-CD68-411C-9A2D-FAEE42761663",
"rank": "normal"
}
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P30_material_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P30",
"hash": "02646471404243a788eaf5d487266bf4bb5524fe",
"datavalue": {
"value": "parchment",
"type": "string"
}
},
"type": "statement",
"id": "Q544$A1CA52B3-A97A-4545-BBEC-DE5E6AC7DB6E",
"rank": "normal"
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"property": "P5",
"hash": "9374610faba500b29dedf759055e43198e98cded",
"datavalue": {
"value": "University of Pennsylvania",
"value": "U. of Penna.",
"type": "string"
}
},
Expand Down
14 changes: 14 additions & 0 deletions spec/fixtures/claims/P5_institution_unqualified.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mainsnak": {
"snaktype": "value",
"property": "P5",
"hash": "9374610faba500b29dedf759055e43198e98cded",
"datavalue": {
"value": "U. of Penna.",
"type": "string"
}
},
"type": "statement",
"id": "Q542$B0FDFE38-AAA8-4F33-AFC6-D486673EB44E",
"rank": "normal"
}
File renamed without changes.
File renamed without changes.

0 comments on commit 6a40cc2

Please sign in to comment.