Unverified Commit a182b977 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

fix error in resourceCreator extractor

parent ae4a2c6d
Pipeline #19806 failed with stages
in 2 minutes and 30 seconds
...@@ -126,7 +126,7 @@ object Extractors { ...@@ -126,7 +126,7 @@ object Extractors {
.flatMap(obj => .flatMap(obj =>
getBlankNodeContent(graph)(obj)("creationRelationHasTarget") getBlankNodeContent(graph)(obj)("creationRelationHasTarget")
.flatMap(v => stringValue(v)("name")) match { .flatMap(v => stringValue(v)("name")) match {
case Some(name) => Some(obj("name").str, name) case Some(name) => Some(obj("type").str, name)
case None => None case None => None
} }
) )
......
{"@graph":[{"@id":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","P60558":"Grayscale","hasFormat":"fmt/41","hasMimeType":"image/jpeg","height":"481.0","isDistributedOn":"image","locator":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1/binary","orientation":"TopLeft","width":"620.0","componentColor":["C0D9D9","545454","2F2F4F","527F76","A9A9A9","E6E8FA","A8A8A8"],"contains":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1/binary","identifiedBy":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genid5c52ac88-cd03-46db-93eb-fd7b2425d447","instantiates":"https://memobase.ch/record/ias-001-UNIL_FC_2137","isDerivedFromInstantiation":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1","regulatedBy":["https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genidf4c737c0-c3ba-4375-8e8d-3f9cf0649116","https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genidbebe4319-d63e-4357-9f6f-10afab087a1f"],"type":"digitalObject"},{"@id":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genid5c52ac88-cd03-46db-93eb-fd7b2425d447","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ias-001-UNIL_FC_2137-1","type":"main"},{"@id":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genidbebe4319-d63e-4357-9f6f-10afab087a1f","@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/ias-001-UNIL_FC_2137-1","type":"usage"},{"@id":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1#genidf4c737c0-c3ba-4375-8e8d-3f9cf0649116","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"public","regulates":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1","type":"access"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","hasCarrierType":["https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid30ac13d6-0486-4781-bfe9-f57ebbeb852f","https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid5a0c464a-9a1d-4b88-a055-3fcddf21747a"],"hasDerivedInstantiation":"https://memobase.ch/digital/ias-001-UNIL_FC_2137-1","identifiedBy":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genidd324d1ee-46cc-44e1-b4e6-d8bbb6299512","instantiates":"https://memobase.ch/record/ias-001-UNIL_FC_2137","regulatedBy":["https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid70c13384-e774-49a6-ab47-a98b8d22757a","https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid9005f0be-201c-4bba-949d-2850dc7a13c8"],"type":"physicalObject"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid30ac13d6-0486-4781-bfe9-f57ebbeb852f","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","sameAs":"http://www.wikidata.org/entity/Q1138868","name":[{"@language":"it","@value":"lastra fotografica"},{"@language":"fr","@value":"plaque photographique"},{"@language":"de","@value":"Fotoplatte"}],"resultsFrom":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genidbb442034-3376-4450-bc28-60c906661279"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid5a0c464a-9a1d-4b88-a055-3fcddf21747a","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","name":"plaque"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid70c13384-e774-49a6-ab47-a98b8d22757a","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"onsite","regulates":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1","type":"access"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genid9005f0be-201c-4bba-949d-2850dc7a13c8","@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/ias-001-UNIL_FC_2137-1","type":"usage"},{"@id":"https://memobase.ch/physical/ias-001-UNIL_FC_2137-1#genidd324d1ee-46cc-44e1-b4e6-d8bbb6299512","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ias-001-UNIL_FC_2137-1","type":"main"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137","@type":"https://www.ica.org/standards/RiC/ontology#Record","eventType":"Update","P60451":"https://memobase.ch/institution/mrv","hasGenre":["https://memobase.ch/record/ias-001-UNIL_FC_2137#genid36f767c7-6716-4797-9cba-022c62ea1cab","https://memobase.ch/record/ias-001-UNIL_FC_2137#genid6ff1afb9-3730-4b2e-bc8e-933d024af29e"],"https://memobase.ch/tx:2d5d7f74-7af3-4f9c-8d29-f8d90c003b15/internal/isPublished":false,"conditionsOfUse":"Toute utilisation est soumise à autorisation par Anne Bielman / IASA : Anne.Bielman@unil.ch.","hasInstantiation":["https://memobase.ch/digital/ias-001-UNIL_FC_2137-1","https://memobase.ch/physical/ias-001-UNIL_FC_2137-1"],"hasSubject":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genida4df27c5-705e-40d2-bb82-1f9617bcfa7f","hasTitle":["https://memobase.ch/record/ias-001-UNIL_FC_2137#genid074f3f6b-55b0-4bbf-8b94-8a97c0b7fbcb","https://memobase.ch/record/ias-001-UNIL_FC_2137#genidf9dda113-374e-4fdd-b209-889555ffc518"],"heldBy":"https://memobase.ch/institution/ias","identifiedBy":["https://memobase.ch/record/ias-001-UNIL_FC_2137#genid324c0682-fc82-4f6a-88b2-f35e4d80fdee","https://memobase.ch/record/ias-001-UNIL_FC_2137#genid75e1d747-a1cd-491f-83ed-34a68e016e92","https://memobase.ch/record/ias-001-UNIL_FC_2137#genid00ae73bf-c7e3-4927-90da-93b1e96bda6d"],"isPartOf":"https://memobase.ch/recordSet/ias-001","recordResourceOrInstantiationIsSourceOfCreationRelation":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid2b69ce05-158d-48af-ac20-93880cb7ada2","regulatedBy":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid50cfc2d9-65b6-4029-97f8-586687f459b7","title":"Grèce - Philippes","type":"Foto"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid00ae73bf-c7e3-4927-90da-93b1e96bda6d","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"UNIL_FC_2137","type":"original"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid074f3f6b-55b0-4bbf-8b94-8a97c0b7fbcb","@type":"https://www.ica.org/standards/RiC/ontology#Title","title":"Philippes A","type":"series"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid2b69ce05-158d-48af-ac20-93880cb7ada2","@type":"https://www.ica.org/standards/RiC/ontology#CreationRelation","creationRelationHasSource":"https://memobase.ch/record/ias-001-UNIL_FC_2137","creationRelationHasTarget":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genidc021b568-a55f-482d-844d-93b9d19f4ed9","type":"creator"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid31984ef3-f0d7-44c3-a21a-66b7e00dc050","@type":"https://www.ica.org/standards/RiC/ontology#Activity","beginningDate":"2021-02-08T09:02:06+0000","endDate":"2021-02-08T09:02:06+0000","performedBy":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid68b83ba3-25a8-45c4-a402-1494c5a3a924","resultsIn":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid36f767c7-6716-4797-9cba-022c62ea1cab","type":"enrichment"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid324c0682-fc82-4f6a-88b2-f35e4d80fdee","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ias-001-UNIL_FC_2137","type":"main"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid36f767c7-6716-4797-9cba-022c62ea1cab","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":[{"@language":"it","@value":"Altri"},{"@language":"fr","@value":"Autres"},{"@language":"de","@value":"Andere"}],"resultsFrom":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid31984ef3-f0d7-44c3-a21a-66b7e00dc050"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid50cfc2d9-65b6-4029-97f8-586687f459b7","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"© IASA / UNIL","regulates":"https://memobase.ch/record/ias-001-UNIL_FC_2137","type":"holder"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid68b83ba3-25a8-45c4-a402-1494c5a3a924","@type":"https://www.ica.org/standards/RiC/ontology#Mechanism","name":"GenreNormalizer","performs":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid31984ef3-f0d7-44c3-a21a-66b7e00dc050"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid6ff1afb9-3730-4b2e-bc8e-933d024af29e","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Foto"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid75e1d747-a1cd-491f-83ed-34a68e016e92","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"IASA-UNIL_FC_2137","type":"oldMemobase"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genida4df27c5-705e-40d2-bb82-1f9617bcfa7f","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"théâtre"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genidc021b568-a55f-482d-844d-93b9d19f4ed9","@type":"https://www.ica.org/standards/RiC/ontology#Person","firstName":"Paul","lastName":"Collart","agentIsTargetOfCreationRelation":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genid2b69ce05-158d-48af-ac20-93880cb7ada2","name":"Paul Collart"},{"@id":"https://memobase.ch/record/ias-001-UNIL_FC_2137#genidf9dda113-374e-4fdd-b209-889555ffc518","@type":"https://www.ica.org/standards/RiC/ontology#Title","title":"Grèce - Philippes","type":"main"}],"@context":{"prefLabel":{"@id":"http://www.w3.org/2004/02/skos/core#prefLabel"},"sameAs":{"@id":"http://schema.org/sameAs"},"regulates":{"@id":"https://www.ica.org/standards/RiC/ontology#regulates","@type":"@id"},"type":{"@id":"https://www.ica.org/standards/RiC/ontology#type"},"name":{"@id":"https://www.ica.org/standards/RiC/ontology#name"},"identifier":{"@id":"https://www.ica.org/standards/RiC/ontology#identifier"},"resultsFrom":{"@id":"https://www.ica.org/standards/RiC/ontology#resultsFrom","@type":"@id"},"title":{"@id":"https://www.ica.org/standards/RiC/ontology#title"},"performs":{"@id":"https://www.ica.org/standards/RiC/ontology#performs","@type":"@id"},"isDistributedOn":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#isDistributedOn"},"identifiedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#identifiedBy","@type":"@id"},"componentColor":{"@id":"http://www.europeana.eu/schemas/edm/componentColor","@type":"http://www.w3.org/2001/XMLSchema#hexBinary"},"regulatedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#regulatedBy","@type":"@id"},"width":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#width"},"height":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#height"},"hasFormat":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasFormat"},"contains":{"@id":"http://www.w3.org/ns/ldp#contains","@type":"@id"},"isDerivedFromInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#isDerivedFromInstantiation","@type":"@id"},"locator":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#locator"},"hasMimeType":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasMimeType"},"orientation":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#orientation"},"instantiates":{"@id":"https://www.ica.org/standards/RiC/ontology#instantiates","@type":"@id"},"P60558":{"@id":"http://rdaregistry.info/Elements/u/P60558"},"P60451":{"@id":"http://rdaregistry.info/Elements/u/P60451","@type":"@id"},"hasInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasInstantiation","@type":"@id"},"hasGenre":{"@id":"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasGenre","@type":"@id"},"heldBy":{"@id":"https://www.ica.org/standards/RiC/ontology#heldBy","@type":"@id"},"isPublished":{"@id":"https://memobase.ch/tx:2d5d7f74-7af3-4f9c-8d29-f8d90c003b15/internal/isPublished","@type":"http://www.w3.org/2001/XMLSchema#boolean"},"conditionsOfUse":{"@id":"https://www.ica.org/standards/RiC/ontology#conditionsOfUse"},"hasTitle":{"@id":"https://www.ica.org/standards/RiC/ontology#hasTitle","@type":"@id"},"eventType":{"@id":"http://memobase.ch/internal/eventType"},"isPartOf":{"@id":"https://www.ica.org/standards/RiC/ontology#isPartOf","@type":"@id"},"recordResourceOrInstantiationIsSourceOfCreationRelation":{"@id":"https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation","@type":"@id"},"hasSubject":{"@id":"https://www.ica.org/standards/RiC/ontology#hasSubject","@type":"@id"},"hasDerivedInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasDerivedInstantiation","@type":"@id"},"hasCarrierType":{"@id":"https://www.ica.org/standards/RiC/ontology#hasCarrierType","@type":"@id"},"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"},"endDate":{"@id":"https://www.ica.org/standards/RiC/ontology#endDate","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"beginningDate":{"@id":"https://www.ica.org/standards/RiC/ontology#beginningDate","@type":"http://www.w3.org/2001/XMLSchema#dateTime"},"resultsIn":{"@id":"https://www.ica.org/standards/RiC/ontology#resultsIn","@type":"@id"},"performedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#performedBy","@type":"@id"},"creationRelationHasTarget":{"@id":"https://www.ica.org/standards/RiC/ontology#creationRelationHasTarget","@type":"@id"},"creationRelationHasSource":{"@id":"https://www.ica.org/standards/RiC/ontology#creationRelationHasSource","@type":"@id"}}}
\ No newline at end of file
...@@ -37,6 +37,13 @@ class ManifestSpec extends AnyFunSuite { ...@@ -37,6 +37,13 @@ class ManifestSpec extends AnyFunSuite {
assert(res.get.obj._2 == Utils.loadFile("src/test/resources/image_output_2.json")) assert(res.get.obj._2 == Utils.loadFile("src/test/resources/image_output_2.json"))
} }
test("a correct manifest should be built from image_input_3.json") {
val manifestBuilder = new Manifest
val res = manifestBuilder.create(Utils.loadFile("src/test/resources/image_input_3.json"))
assert(res.isSuccess)
assert(res.get.warnings.isEmpty)
}
test("an incorrect date format should result in a warning") { test("an incorrect date format should result in a warning") {
val manifestBuilder = new Manifest val manifestBuilder = new Manifest
val res = manifestBuilder.create(Utils.loadFile("src/test/resources/wrong_date_format.json")) val res = manifestBuilder.create(Utils.loadFile("src/test/resources/wrong_date_format.json"))
......
Supports Markdown
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