don't provide default mimetype for thumbnails

parent aaa7a7ca
Pipeline #22122 passed with stages
in 8 minutes and 43 seconds
......@@ -86,11 +86,7 @@ object BinaryResourceMetadata extends RecordUtils {
BinaryResourceMetadata(
v("@id").str.substring(s"$baseUrl/digital/".length - 1),
buildDistributorUrl(v("@id").str, baseUrl, distributorHost, instantiation),
if (instantiation == Thumbnail) {
JpegFile
} else {
Conversions.getMediaFileType(v("hasMimeType").str).get
},
Conversions.getMediaFileType(v("hasMimeType").str).get,
instantiation)
case v if isLocalRecord(v) =>
val resource = MemobaseResource(v("type").str)
......
{"@graph":[{"@id":"_:b0","@type":"https://www.ica.org/standards/RiC/ontology#Title","title":"Für den Fall der Fälle (Tonbildschau Der Rotkreuzdienst 1. Lektion)","type":"main"},{"@id":"_:b1","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"IB Becker Audiovisuals-12","type":"original"},{"@id":"_:b10","@type":"https://www.ica.org/standards/RiC/ontology#CreationRelation","creationRelationHasSource":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","creationRelationHasTarget":"_:b32","name":"Author","type":"creator"},{"@id":"_:b11","@type":"https://www.ica.org/standards/RiC/ontology#CreationRelation","creationRelationHasSource":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","creationRelationHasTarget":"_:b19","name":"Regie","type":"contributor"},{"@id":"_:b12","@type":"https://www.ica.org/standards/RiC/ontology#CorporateBody","eventType":"CREATE","name":"Becker Audiovisuals (BAV)"},{"@id":"_:b13","@type":"https://www.ica.org/standards/RiC/ontology#Language","name":"deutsch","type":"content"},{"@id":"_:b14","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Image, Werbung"},{"@id":"_:b15","@type":"https://www.ica.org/standards/RiC/ontology#Rule","sameAs":"http://rightsstatements.org/vocab/CNE/1.0/","name":"Copyright Not Evaluated (CNE)","regulates":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","type":"usage"},{"@id":"_:b16","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"public","regulates":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","type":"access"},{"@id":"_:b17","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"afz-003-IB_Becker_Audiovisuals-12-1","type":"main"},{"@id":"_:b18","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"IB Becker Audiovisuals / 12","type":"callNumber"},{"@id":"_:b19","@type":"https://www.ica.org/standards/RiC/ontology#Person","firstName":"Egon","lastName":"Becker","agentIsTargetOfCreationRelation":"_:b11","name":"Egon Becker"},{"@id":"_:b2","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Frau, Pflegeberuf, Laborantin, Therapeutin, Gesundheitswesen Krieg, Katastrophe, Rotkreuz, Zivilopfer, Vorkehrungen, Zivilschutz, Militärspital, Zivilspital, Sanitätstruppe, Freiwillige"},{"@id":"_:b20","@type":"https://www.ica.org/standards/RiC/ontology#Mechanism","name":"LanguagesNormalizer","performs":"_:b21"},{"@id":"_:b21","@type":"https://www.ica.org/standards/RiC/ontology#Activity","affects":"_:b13","beginningDate":"2021-35-22T09:35:45+0000","endDate":"2021-35-22T09:35:45+0000","performedBy":"_:b20","resultsIn":"_:b5","type":"enrichment"},{"@id":"_:b22","@type":"https://www.ica.org/standards/RiC/ontology#Mechanism","name":"CarrierTypeNormalizer","performs":"_:b23"},{"@id":"_:b23","@type":"https://www.ica.org/standards/RiC/ontology#Activity","affects":"_:b27","beginningDate":"2021-35-22T09:35:45+0000","endDate":"2021-35-22T09:35:45+0000","performedBy":"_:b22","resultsIn":"_:b29","type":"enrichment"},{"@id":"_:b24","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"afz-003-IB_Becker_Audiovisuals-12-1","type":"main"},{"@id":"_:b25","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","sameAs":"http://www.wikidata.org/entity/Q166816","name":[{"@language":"de","@value":"Diafilm"},{"@language":"fr","@value":"film inversible"},{"@language":"it","@value":"GALATEO MANCANTE"}],"resultsFrom":"_:b30"},{"@id":"_:b26","@type":"https://www.ica.org/standards/RiC/ontology#Rule","sameAs":"http://rightsstatements.org/vocab/CNE/1.0/","name":"Copyright Not Evaluated (CNE)","regulates":"https://memobase.ch/physical/afz-003-IB_Becker_Audiovisuals-12-1","type":"usage"},{"@id":"_:b27","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","name":"Kleinbild-Diapositive, Audiokassette"},{"@id":"_:b28","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"onsite","regulates":"https://memobase.ch/physical/afz-003-IB_Becker_Audiovisuals-12-1","type":"access"},{"@id":"_:b29","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","sameAs":"http://www.wikidata.org/entity/Q149757","name":[{"@language":"de","@value":"Compact Cassette"},{"@language":"fr","@value":"cassette audio"},{"@language":"it","@value":"musicassetta"}],"resultsFrom":"_:b23"},{"@id":"_:b3","@type":"https://www.ica.org/standards/RiC/ontology#DateRange","normalizedDateValue":"1978"},{"@id":"_:b30","@type":"https://www.ica.org/standards/RiC/ontology#Activity","affects":"_:b27","beginningDate":"2021-35-22T09:35:45+0000","endDate":"2021-35-22T09:35:45+0000","performedBy":"_:b31","resultsIn":"_:b25","type":"enrichment"},{"@id":"_:b31","@type":"https://www.ica.org/standards/RiC/ontology#Mechanism","name":"CarrierTypeNormalizer","performs":"_:b30"},{"@id":"_:b32","@type":"https://www.ica.org/standards/RiC/ontology#Person","firstName":"Egon","lastName":"Becker","agentIsTargetOfCreationRelation":"_:b10","name":"Egon Becker"},{"@id":"_:b4","@type":"https://www.ica.org/standards/RiC/ontology#Place","name":"Schweiz"},{"@id":"_:b5","@type":"https://www.ica.org/standards/RiC/ontology#Language","sameAs":"http://www.wikidata.org/entity/Q188","name":[{"@language":"de","@value":"Deutsch"},{"@language":"fr","@value":"allemand"},{"@language":"it","@value":"tedesco"}],"resultsFrom":"_:b21","type":"content"},{"@id":"_:b6","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"Archiv für Zeitgeschichte (ETH Zürich)","regulates":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","type":"holder"},{"@id":"_:b7","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"afz-003-IB_Becker_Audiovisuals-12","type":"main"},{"@id":"_:b8","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"AfZ-IB_Becker_Audiovisuals-12","type":"oldMemobase"},{"@id":"_:b9","@type":"https://www.ica.org/standards/RiC/ontology#CorporateBody","name":"Schweizerisches Rotes Kreuz (SRK), Rotkreuzdienst"},{"@id":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","duration":"781.162667","hasFormat":"fmt/199","hasMimeType":"video/mp4","height":"1080.0","isDistributedOn":"video","locator":"http://digitalisate.afz.ethz.ch/?&guid=b0218da0a5f6459ebb2538d0bc78f84e&memobaseExt=mp4","width":"1920.0","hasDerivedInstantiation":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1/derived","identifiedBy":"_:b17","instantiates":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","isDerivedFromInstantiation":"https://memobase.ch/physical/afz-003-IB_Becker_Audiovisuals-12-1","regulatedBy":["_:b15","_:b16"],"type":"digitalObject"},{"@id":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1/derived","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","P60558":"TrueColorAlpha","hasFormat":"fmt/11","hasMimeType":"image/png","height":"138.0","isDistributedOn":"image","locator":"sftp:/swissbib_index/mb_sftp/afz-003/thumbnails/IB Becker Audiovisuals-12.png","orientation":"Undefined","width":"138.0","componentColor":["2F2F4F","545454","FFE4E1"],"eventType":"CREATE","instantiates":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","isDerivedFromInstantiation":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","type":"thumbnail"},{"@id":"https://memobase.ch/physical/afz-003-IB_Becker_Audiovisuals-12-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","P60558":"farbig","duration":"00:13:01","hasCarrierType":["_:b25","_:b27","_:b29"],"hasDerivedInstantiation":"https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","identifiedBy":["_:b24","_:b18"],"instantiates":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","physicalCharacteristics":["Seitenverhältnis: 16:9","Bemerkung: Überlieferte Form: Kleinbild-Diapositive, Audiokassette"],"regulatedBy":["_:b26","_:b28"],"type":"physicalObject"},{"@id":"https://memobase.ch/record/afz-003-IB_Becker_Audiovisuals-12","@type":"https://www.ica.org/standards/RiC/ontology#Record","abstract":"Darstellung der Anforderungen an die spitalmässige Patientenversorgung im Ernstfall. Überliefert ist ein Medienpaket mit 71 Kleinbild-Diapositiven, 1 Audiokassette","created":"_:b3","spatial":"_:b4","P60441":"_:b12","P60451":"https://memobase.ch/institution/mrv","sameAs":"http://onlinearchives.ethz.ch/load.aspx?guid=59e54e22-44c9-42a1-bd69-9da1271713af","hasGenre":"_:b14","eventType":"CREATE","isPublished":false,"conditionsOfUse":"Die Nutzungsrechte an den Tonbildschauen von Becker Audio-Visuals (BAV) liegen beim Archiv für Zeitgeschichte der ETH Zürich. Die Einbindung des Videostreams aus Memobase bzw. aus dem Webangebot des Archivs für Zeitgeschichte ist bei korrekter Nennung des Quellarchivs (Archiv für Zeitgeschichte ETH Zürich) erlaubt. Für jede weitergehende Publikation oder öffentliche Vorführung wenden Sie sich bitte an das Archiv für Zeitgeschichte, Hirschengraben 62 8092 Zürich.","hasInstantiation":["https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1/derived","https://memobase.ch/digital/afz-003-IB_Becker_Audiovisuals-12-1","https://memobase.ch/physical/afz-003-IB_Becker_Audiovisuals-12-1"],"hasLanguage":["_:b5","_:b13"],"hasSubject":["_:b2","_:b9"],"hasTitle":"_:b0","heldBy":"https://memobase.ch/institution/afz","identifiedBy":["_:b1","_:b7","_:b8"],"isPartOf":"https://memobase.ch/recordSet/afz-003","recordResourceOrInstantiationIsSourceOfCreationRelation":["_:b10","_:b11"],"regulatedBy":"_:b6","scopeAndContent":"Institutionelle Archive und Bestände / Becker Audiovisuals / 2. Tonbildschauen und Multimediaschauen (1968-1997) / 2.2. Bewerbung und Präsentation von Branchen, Institutionen und Produkten / 2.2.3. Organisationen, Körperschaften / 2.2.3.5. Rotkreuzdienst (Informationsprogramm im Auftrag des Schweizerischen Roten Kreuzes) (1977-1978)","title":"Für den Fall der Fälle (Tonbildschau Der Rotkreuzdienst 1. Lektion)","type":"Tonbildschau"}],"@context":{"hasTitle":{"@id":"https://www.ica.org/standards/RiC/ontology#hasTitle","@type":"@id"},"identifiedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#identifiedBy","@type":"@id"},"hasSubject":{"@id":"https://www.ica.org/standards/RiC/ontology#hasSubject","@type":"@id"},"created":{"@id":"http://purl.org/dc/terms/created","@type":"@id"},"hasInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasInstantiation","@type":"@id"},"abstract":{"@id":"http://purl.org/dc/terms/abstract"},"P60451":{"@id":"http://rdaregistry.info/Elements/u/P60451","@type":"@id"},"spatial":{"@id":"http://purl.org/dc/terms/spatial","@type":"@id"},"type":{"@id":"https://www.ica.org/standards/RiC/ontology#type"},"hasLanguage":{"@id":"https://www.ica.org/standards/RiC/ontology#hasLanguage","@type":"@id"},"regulatedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#regulatedBy","@type":"@id"},"scopeAndContent":{"@id":"https://www.ica.org/standards/RiC/ontology#scopeAndContent"},"title":{"@id":"https://www.ica.org/standards/RiC/ontology#title"},"isPublished":{"@id":"https://memobase.ch/internal/isPublished","@type":"http://www.w3.org/2001/XMLSchema#boolean"},"heldBy":{"@id":"https://www.ica.org/standards/RiC/ontology#heldBy","@type":"@id"},"recordResourceOrInstantiationIsSourceOfCreationRelation":{"@id":"https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation","@type":"@id"},"eventType":{"@id":"https://memobase.ch/internal/eventType"},"conditionsOfUse":{"@id":"https://www.ica.org/standards/RiC/ontology#conditionsOfUse"},"isPartOf":{"@id":"https://www.ica.org/standards/RiC/ontology#isPartOf","@type":"@id"},"P60441":{"@id":"http://rdaregistry.info/Elements/u/P60441","@type":"@id"},"sameAs":{"@id":"http://schema.org/sameAs"},"hasGenre":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasGenre","@type":"@id"},"isDistributedOn":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#isDistributedOn"},"isDerivedFromInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#isDerivedFromInstantiation","@type":"@id"},"hasDerivedInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasDerivedInstantiation","@type":"@id"},"height":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#height"},"locator":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#locator"},"hasFormat":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasFormat"},"instantiates":{"@id":"https://www.ica.org/standards/RiC/ontology#instantiates","@type":"@id"},"hasMimeType":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasMimeType"},"duration":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#duration"},"width":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#width"},"name":{"@id":"https://www.ica.org/standards/RiC/ontology#name"},"identifier":{"@id":"https://www.ica.org/standards/RiC/ontology#identifier"},"creationRelationHasSource":{"@id":"https://www.ica.org/standards/RiC/ontology#creationRelationHasSource","@type":"@id"},"creationRelationHasTarget":{"@id":"https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget","@type":"@id"},"regulates":{"@id":"https://www.ica.org/standards/RiC/ontology#regulates","@type":"@id"},"performs":{"@id":"https://www.ica.org/standards/RiC/ontology#performs","@type":"@id"},"hasCarrierType":{"@id":"https://www.ica.org/standards/RiC/ontology#hasCarrierType","@type":"@id"},"physicalCharacteristics":{"@id":"https://www.ica.org/standards/RiC/ontology#physicalCharacteristics"},"P60558":{"@id":"http://rdaregistry.info/Elements/u/P60558"},"beginningDate":{"@id":"https://www.ica.org/standards/RiC/ontology#beginningDate","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"endDate":{"@id":"https://www.ica.org/standards/RiC/ontology#endDate","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"performedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#performedBy","@type":"@id"},"affects":{"@id":"https://www.ica.org/standards/RiC/ontology#affects","@type":"@id"},"resultsIn":{"@id":"https://www.ica.org/standards/RiC/ontology#resultsIn","@type":"@id"},"prefLabel":{"@id":"http://www.w3.org/2004/02/skos/core#prefLabel"},"agentIsTargetOfCreationRelation":{"@id":"https://www.ica.org/standards/RiC/ontology#agentIsTargetOfCreationRelation","@type":"@id"},"firstName":{"@id":"http://xmlns.com/foaf/0.1/firstName"},"lastName":{"@id":"http://xmlns.com/foaf/0.1/lastName"},"resultsFrom":{"@id":"https://www.ica.org/standards/RiC/ontology#resultsFrom","@type":"@id"},"normalizedDateValue":{"@id":"https://www.ica.org/standards/RiC/ontology#normalizedDateValue"},"componentColor":{"@id":"http://www.europeana.eu/schemas/edm/componentColor","@type":"http://www.w3.org/2001/XMLSchema#hexBinary"},"orientation":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#orientation"}}}
\ No newline at end of file
......@@ -19,7 +19,7 @@
package ch.memobase
import ch.memobase.models.{BinaryResourceMetadata, NoLocalBinary, UnmanageableMediaFileType}
import ch.memobase.models.{BinaryResourceMetadata, NoLocalBinary, PngFile, UnmanageableMediaFileType}
import org.scalatest.funsuite.AnyFunSuite
import scala.io.Source
......@@ -58,4 +58,10 @@ class BinaryResourceMetadataTest extends AnyFunSuite {
.get
}
}
test("a thumbnail parsing should return the correct mimetype") {
val inData = Source.fromFile("src/test/resources/incoming_message_with_thumbnail.json")
val brm = BinaryResourceMetadata.build(inData.mkString, "outerUrl", "innerUrl")
assert(brm(1).get.mimeType == PngFile)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment