Commit fa9b4349 authored by Günter Hipler's avatar Günter Hipler
Browse files

make a better seperation between IIIF Creator and EDM creation - weeded no...

make a better seperation between IIIF Creator and EDM creation - weeded no longer needed types and added the frame for new types
parent c1c26a11
import Dependencies._
import Dependencies.{rioapijsonld, rioapintriples, rioapiturtle, _}
ThisBuild / scalaVersion := "2.13.3"
ThisBuild / version := "0.1.0-SNAPSHOT"
......@@ -38,6 +38,13 @@ lazy val root = (project in file("."))
upickle,
kafkaStreamsTestUtils % Test,
scalatic % Test,
scalaTest % Test
scalaTest % Test,
rdf4jmodel,
rioapi,
rioapixml,
rioapiturtle,
rioapijsonld,
rioapintriples
)
)
/*
* IIIF Manifest Creator
* Copyright (C) 2020 Memobase
* rico2edm
* Copyright (C) 2021 UB Basel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
......@@ -14,14 +14,17 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
import sbt._
object Dependencies {
lazy val kafkaV = "2.7.0"
lazy val log4jV = "2.11.2"
lazy val log4jV = "2.12.0"
lazy val scalatestV = "3.1.2"
lazy val jenaV = "3.17.0"
lazy val rdf4jV = "3.5.1"
lazy val iiifApis = "de.digitalcollections.iiif" % "iiif-apis" % "0.3.8"
lazy val iiifPresentationApi =
......@@ -38,4 +41,16 @@ object Dependencies {
lazy val scalatic = "org.scalactic" %% "scalactic" % scalatestV
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalatestV
lazy val upickle = "com.lihaoyi" %% "upickle" % "0.9.5"
lazy val jena = "org.apache.jena" % "jena-core" % jenaV
lazy val jsonld = "org.apache.jena" % "jena-arq" % jenaV
lazy val rdf4jmodel = "org.eclipse.rdf4j" % "rdf4j-model" % rdf4jV
lazy val rioapi = "org.eclipse.rdf4j" % "rdf4j-rio-api" % rdf4jV
lazy val rioapixml = "org.eclipse.rdf4j" % "rdf4j-rio-rdfxml" % rdf4jV
lazy val rioapiturtle = "org.eclipse.rdf4j" % "rdf4j-rio-turtle" % rdf4jV
lazy val rioapijsonld = "org.eclipse.rdf4j" % "rdf4j-rio-jsonld" % rdf4jV
lazy val rioapintriples = "org.eclipse.rdf4j" % "rdf4j-rio-ntriples" % rdf4jV
}
......@@ -118,7 +118,7 @@
</check>
<check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
<parameters>
<parameter name="maxLength"><![CDATA[50]]></parameter>
<parameter name="maxLength"><![CDATA[150]]></parameter>
</parameters>
</check>
<check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
......
{"@graph":[{"@id":"_:b0","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Minusio edif"},{"@id":"_:b1","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"Archivio di Stato del Cantone Ticino","regulates":"https://memobase.ch/record/ati-001-L_44_13","type":"holder"},{"@id":"_:b10","@type":"https://www.ica.org/standards/RiC/ontology#DateRange","normalizedDateValue":"1930/1950"},{"@id":"_:b11","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Locarnese edif"},{"@id":"_:b12","@type":"https://www.ica.org/standards/RiC/ontology#Language","name":"Italian","type":"content"},{"@id":"_:b13","@type":"https://www.ica.org/standards/RiC/ontology#Mechanism","name":"LanguagesNormalizer","performs":"_:b14"},{"@id":"_:b14","@type":"https://www.ica.org/standards/RiC/ontology#Activity","affects":"_:b12","beginningDate":"2021-45-26T09:45:39+0000","endDate":"2021-45-26T09:45:39+0000","performedBy":"_:b13","resultsIn":"_:b5","type":"enrichment"},{"@id":"_:b15","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"public","regulates":"https://memobase.ch/digital/ati-001-L_44_13-1","type":"access"},{"@id":"_:b16","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ati-001-L_44_13-1","type":"main"},{"@id":"_:b17","@type":"https://www.ica.org/standards/RiC/ontology#Person","firstName":"Valentino","lastName":"Monotti","agentIsTargetOfCreationRelation":"_:b8","name":"Valentino Monotti"},{"@id":"_:b18","@type":"https://www.ica.org/standards/RiC/ontology#Rule","name":"onsite","regulates":"https://memobase.ch/physical/ati-001-L_44_13-1","type":"access"},{"@id":"_:b19","@type":"https://www.ica.org/standards/RiC/ontology#CarrierType","name":"Nitrato"},{"@id":"_:b2","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"L/44.13","type":"original"},{"@id":"_:b20","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"L/44.13","type":"callNumber"},{"@id":"_:b21","@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/ati-001-L_44_13-1","type":"usage"},{"@id":"_:b22","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ati-001-L_44_13-1","type":"main"},{"@id":"_:b23","@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/ati-001-L_44_13-1","type":"usage"},{"@id":"_:b3","@type":"https://www.ica.org/standards/RiC/ontology#Place","name":"Minusio"},{"@id":"_:b4","@type":"http://www.w3.org/2004/02/skos/core#Concept","prefLabel":"Edifici, piazze, strade, monumenti"},{"@id":"_:b5","@type":"https://www.ica.org/standards/RiC/ontology#Language","sameAs":"http://www.wikidata.org/entity/Q652","name":[{"@language":"de","@value":"Italienisch"},{"@language":"fr","@value":"italien"},{"@language":"it","@value":"italiano"}],"resultsFrom":"_:b14","type":"content"},{"@id":"_:b6","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ASTi-L_44_13","type":"oldMemobase"},{"@id":"_:b7","@type":"https://www.ica.org/standards/RiC/ontology#Identifier","identifier":"ati-001-L_44_13","type":"main"},{"@id":"_:b8","@type":"https://www.ica.org/standards/RiC/ontology#CreationRelation","creationRelationHasSource":"https://memobase.ch/record/ati-001-L_44_13","creationRelationHasTarget":"_:b17","type":"creator"},{"@id":"_:b9","@type":"https://www.ica.org/standards/RiC/ontology#Title","title":"Hotel Esplanade","type":"main"},{"@id":"https://memobase.ch/digital/ati-001-L_44_13-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","identifiedBy":"_:b22","instantiates":"https://memobase.ch/record/ati-001-L_44_13","isDerivedFromInstantiation":"https://memobase.ch/physical/ati-001-L_44_13-1","regulatedBy":["_:b15","_:b23"],"type":"digitalObject"},{"@id":"https://memobase.ch/physical/ati-001-L_44_13-1","@type":"https://www.ica.org/standards/RiC/ontology#Instantiation","P60558":"B/N","eventType":"CREATE","hasCarrierType":"_:b19","hasDerivedInstantiation":"https://memobase.ch/digital/ati-001-L_44_13-1","identifiedBy":["_:b20","_:b16"],"instantiates":"https://memobase.ch/record/ati-001-L_44_13","physicalCharacteristics":["Bemerkung: Pellicola","Verfahren: Negativo","Höhe: 13 cm","Weite: 18 cm"],"regulatedBy":["_:b18","_:b21"],"type":"physicalObject"},{"@id":"https://memobase.ch/record/ati-001-L_44_13","@type":"https://www.ica.org/standards/RiC/ontology#Record","abstract":"Veduta dell'albergo","created":"_:b10","spatial":"_:b3","P60451":"https://memobase.ch/institution/mrv","sameAs":"http://www3.ti.ch/DECS/sw/struttura/decs/dcsu/ac/asti/cff/index.php?p=immagine&id_immagine=17666","eventType":"CREATE","isPublished":false,"conditionsOfUse":"Si veda il regolamento per la consultazione e la riproduzione di immagini fotografiche","hasInstantiation":["https://memobase.ch/digital/ati-001-L_44_13-1","https://memobase.ch/physical/ati-001-L_44_13-1"],"hasLanguage":["_:b5","_:b12"],"hasSubject":["_:b4","_:b0","_:b11"],"hasTitle":"_:b9","heldBy":"https://memobase.ch/institution/ati","identifiedBy":["_:b2","_:b6","_:b7"],"isPartOf":"https://memobase.ch/recordSet/ati-001","recordResourceOrInstantiationIsSourceOfCreationRelation":"_:b8","regulatedBy":"_:b1","scopeAndContent":"Discreto","source":"Monotti_L_44.13.jpg","title":"Hotel Esplanade","type":"Foto"}],"@context":{"prefLabel":{"@id":"http://www.w3.org/2004/02/skos/core#prefLabel"},"regulatedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#regulatedBy","@type":"@id"},"identifiedBy":{"@id":"https://www.ica.org/standards/RiC/ontology#identifiedBy","@type":"@id"},"source":{"@id":"https://www.ica.org/standards/RiC/ontology#source"},"spatial":{"@id":"http://purl.org/dc/terms/spatial","@type":"@id"},"scopeAndContent":{"@id":"https://www.ica.org/standards/RiC/ontology#scopeAndContent"},"abstract":{"@id":"http://purl.org/dc/terms/abstract"},"heldBy":{"@id":"https://www.ica.org/standards/RiC/ontology#heldBy","@type":"@id"},"hasSubject":{"@id":"https://www.ica.org/standards/RiC/ontology#hasSubject","@type":"@id"},"hasLanguage":{"@id":"https://www.ica.org/standards/RiC/ontology#hasLanguage","@type":"@id"},"isPublished":{"@id":"https://memobase.ch/internal/isPublished","@type":"http://www.w3.org/2001/XMLSchema#boolean"},"hasInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasInstantiation","@type":"@id"},"recordResourceOrInstantiationIsSourceOfCreationRelation":{"@id":"https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation","@type":"@id"},"hasTitle":{"@id":"https://www.ica.org/standards/RiC/ontology#hasTitle","@type":"@id"},"P60451":{"@id":"http://rdaregistry.info/Elements/u/P60451","@type":"@id"},"type":{"@id":"https://www.ica.org/standards/RiC/ontology#type"},"title":{"@id":"https://www.ica.org/standards/RiC/ontology#title"},"created":{"@id":"http://purl.org/dc/terms/created","@type":"@id"},"conditionsOfUse":{"@id":"https://www.ica.org/standards/RiC/ontology#conditionsOfUse"},"isPartOf":{"@id":"https://www.ica.org/standards/RiC/ontology#isPartOf","@type":"@id"},"eventType":{"@id":"https://memobase.ch/internal/eventType"},"sameAs":{"@id":"http://schema.org/sameAs"},"name":{"@id":"https://www.ica.org/standards/RiC/ontology#name"},"performs":{"@id":"https://www.ica.org/standards/RiC/ontology#performs","@type":"@id"},"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"},"regulates":{"@id":"https://www.ica.org/standards/RiC/ontology#regulates","@type":"@id"},"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"},"physicalCharacteristics":{"@id":"https://www.ica.org/standards/RiC/ontology#physicalCharacteristics"},"hasCarrierType":{"@id":"https://www.ica.org/standards/RiC/ontology#hasCarrierType","@type":"@id"},"P60558":{"@id":"http://rdaregistry.info/Elements/u/P60558"},"instantiates":{"@id":"https://www.ica.org/standards/RiC/ontology#instantiates","@type":"@id"},"hasDerivedInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#hasDerivedInstantiation","@type":"@id"},"resultsFrom":{"@id":"https://www.ica.org/standards/RiC/ontology#resultsFrom","@type":"@id"},"isDerivedFromInstantiation":{"@id":"https://www.ica.org/standards/RiC/ontology#isDerivedFromInstantiation","@type":"@id"},"normalizedDateValue":{"@id":"https://www.ica.org/standards/RiC/ontology#normalizedDateValue"},"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"}}}
\ No newline at end of file
{
"@graph": [
{
"@id": "_:b0",
"@type": "http://www.w3.org/2004/02/skos/core#Concept",
"prefLabel": "Minusio edif"
},
{
"@id": "_:b1",
"@type": "https://www.ica.org/standards/RiC/ontology#Rule",
"name": "Archivio di Stato del Cantone Ticino",
"regulates": "https://memobase.ch/record/ati-001-L_44_13",
"type": "holder"
},
{
"@id": "_:b10",
"@type": "https://www.ica.org/standards/RiC/ontology#DateRange",
"normalizedDateValue": "1930/1950"
},
{
"@id": "_:b11",
"@type": "http://www.w3.org/2004/02/skos/core#Concept",
"prefLabel": "Locarnese edif"
},
{
"@id": "_:b12",
"@type": "https://www.ica.org/standards/RiC/ontology#Language",
"name": "Italian",
"type": "content"
},
{
"@id": "_:b13",
"@type": "https://www.ica.org/standards/RiC/ontology#Mechanism",
"name": "LanguagesNormalizer",
"performs": "_:b14"
},
{
"@id": "_:b14",
"@type": "https://www.ica.org/standards/RiC/ontology#Activity",
"affects": "_:b12",
"beginningDate": "2021-45-26T09:45:39+0000",
"endDate": "2021-45-26T09:45:39+0000",
"performedBy": "_:b13",
"resultsIn": "_:b5",
"type": "enrichment"
},
{
"@id": "_:b15",
"@type": "https://www.ica.org/standards/RiC/ontology#Rule",
"name": "public",
"regulates": "https://memobase.ch/digital/ati-001-L_44_13-1",
"type": "access"
},
{
"@id": "_:b16",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "ati-001-L_44_13-1",
"type": "main"
},
{
"@id": "_:b17",
"@type": "https://www.ica.org/standards/RiC/ontology#Person",
"firstName": "Valentino",
"lastName": "Monotti",
"agentIsTargetOfCreationRelation": "_:b8",
"name": "Valentino Monotti"
},
{
"@id": "_:b18",
"@type": "https://www.ica.org/standards/RiC/ontology#Rule",
"name": "onsite",
"regulates": "https://memobase.ch/physical/ati-001-L_44_13-1",
"type": "access"
},
{
"@id": "_:b19",
"@type": "https://www.ica.org/standards/RiC/ontology#CarrierType",
"name": "Nitrato"
},
{
"@id": "_:b2",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "L/44.13",
"type": "original"
},
{
"@id": "_:b20",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "L/44.13",
"type": "callNumber"
},
{
"@id": "_:b21",
"@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/ati-001-L_44_13-1",
"type": "usage"
},
{
"@id": "_:b22",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "ati-001-L_44_13-1",
"type": "main"
},
{
"@id": "_:b23",
"@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/ati-001-L_44_13-1",
"type": "usage"
},
{
"@id": "_:b3",
"@type": "https://www.ica.org/standards/RiC/ontology#Place",
"name": "Minusio"
},
{
"@id": "_:b4",
"@type": "http://www.w3.org/2004/02/skos/core#Concept",
"prefLabel": "Edifici, piazze, strade, monumenti"
},
{
"@id": "_:b5",
"@type": "https://www.ica.org/standards/RiC/ontology#Language",
"sameAs": "http://www.wikidata.org/entity/Q652",
"name": [
{
"@language": "de",
"@value": "Italienisch"
},
{
"@language": "fr",
"@value": "italien"
},
{
"@language": "it",
"@value": "italiano"
}
],
"resultsFrom": "_:b14",
"type": "content"
},
{
"@id": "_:b6",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "ASTi-L_44_13",
"type": "oldMemobase"
},
{
"@id": "_:b7",
"@type": "https://www.ica.org/standards/RiC/ontology#Identifier",
"identifier": "ati-001-L_44_13",
"type": "main"
},
{
"@id": "_:b8",
"@type": "https://www.ica.org/standards/RiC/ontology#CreationRelation",
"creationRelationHasSource": "https://memobase.ch/record/ati-001-L_44_13",
"creationRelationHasTarget": "_:b17",
"type": "creator"
},
{
"@id": "_:b9",
"@type": "https://www.ica.org/standards/RiC/ontology#Title",
"title": "Hotel Esplanade",
"type": "main"
},
{
"@id": "https://memobase.ch/digital/ati-001-L_44_13-1",
"@type": "https://www.ica.org/standards/RiC/ontology#Instantiation",
"identifiedBy": "_:b22",
"instantiates": "https://memobase.ch/record/ati-001-L_44_13",
"isDerivedFromInstantiation": "https://memobase.ch/physical/ati-001-L_44_13-1",
"regulatedBy": [
"_:b15",
"_:b23"
],
"type": "digitalObject"
},
{
"@id": "https://memobase.ch/physical/ati-001-L_44_13-1",
"@type": "https://www.ica.org/standards/RiC/ontology#Instantiation",
"P60558": "B/N",
"eventType": "CREATE",
"hasCarrierType": "_:b19",
"hasDerivedInstantiation": "https://memobase.ch/digital/ati-001-L_44_13-1",
"identifiedBy": [
"_:b20",
"_:b16"
],
"instantiates": "https://memobase.ch/record/ati-001-L_44_13",
"physicalCharacteristics": [
"Bemerkung: Pellicola",
"Verfahren: Negativo",
"Höhe: 13 cm",
"Weite: 18 cm"
],
"regulatedBy": [
"_:b18",
"_:b21"
],
"type": "physicalObject"
},
{
"@id": "https://memobase.ch/record/ati-001-L_44_13",
"@type": "https://www.ica.org/standards/RiC/ontology#Record",
"abstract": "Veduta dell'albergo",
"created": "_:b10",
"spatial": "_:b3",
"P60451": "https://memobase.ch/institution/mrv",
"sameAs": "http://www3.ti.ch/DECS/sw/struttura/decs/dcsu/ac/asti/cff/index.php?p=immagine&id_immagine=17666",
"eventType": "CREATE",
"isPublished": false,
"conditionsOfUse": "Si veda il regolamento per la consultazione e la riproduzione di immagini fotografiche",
"hasInstantiation": [
"https://memobase.ch/digital/ati-001-L_44_13-1",
"https://memobase.ch/physical/ati-001-L_44_13-1"
],
"hasLanguage": [
"_:b5",
"_:b12"
],
"hasSubject": [
"_:b4",
"_:b0",
"_:b11"
],
"hasTitle": "_:b9",
"heldBy": "https://memobase.ch/institution/ati",
"identifiedBy": [
"_:b2",
"_:b6",
"_:b7"
],
"isPartOf": "https://memobase.ch/recordSet/ati-001",
"recordResourceOrInstantiationIsSourceOfCreationRelation": "_:b8",
"regulatedBy": "_:b1",
"scopeAndContent": "Discreto",
"source": "Monotti_L_44.13.jpg",
"title": "Hotel Esplanade",
"type": "Foto"
}
],
"@context": {
"prefLabel": {"@id": "http://www.w3.org/2004/02/skos/core#prefLabel"},
"regulatedBy": {
"@id": "https://www.ica.org/standards/RiC/ontology#regulatedBy",
"@type": "@id"
},
"identifiedBy": {
"@id": "https://www.ica.org/standards/RiC/ontology#identifiedBy",
"@type": "@id"
},
"source": {"@id": "https://www.ica.org/standards/RiC/ontology#source"},
"spatial": {
"@id": "http://purl.org/dc/terms/spatial",
"@type": "@id"
},
"scopeAndContent": {"@id": "https://www.ica.org/standards/RiC/ontology#scopeAndContent"},
"abstract": {"@id": "http://purl.org/dc/terms/abstract"},
"heldBy": {
"@id": "https://www.ica.org/standards/RiC/ontology#heldBy",
"@type": "@id"
},
"hasSubject": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasSubject",
"@type": "@id"
},
"hasLanguage": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasLanguage",
"@type": "@id"
},
"isPublished": {
"@id": "https://memobase.ch/internal/isPublished",
"@type": "http://www.w3.org/2001/XMLSchema#boolean"
},
"hasInstantiation": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasInstantiation",
"@type": "@id"
},
"recordResourceOrInstantiationIsSourceOfCreationRelation": {
"@id": "https://www.ica.org/standards/RiC/ontology#recordResourceOrInstantiationIsSourceOfCreationRelation",
"@type": "@id"
},
"hasTitle": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasTitle",
"@type": "@id"
},
"P60451": {
"@id": "http://rdaregistry.info/Elements/u/P60451",
"@type": "@id"
},
"type": {"@id": "https://www.ica.org/standards/RiC/ontology#type"},
"title": {"@id": "https://www.ica.org/standards/RiC/ontology#title"},
"created": {
"@id": "http://purl.org/dc/terms/created",
"@type": "@id"
},
"conditionsOfUse": {"@id": "https://www.ica.org/standards/RiC/ontology#conditionsOfUse"},
"isPartOf": {
"@id": "https://www.ica.org/standards/RiC/ontology#isPartOf",
"@type": "@id"
},
"eventType": {"@id": "https://memobase.ch/internal/eventType"},
"sameAs": {"@id": "http://schema.org/sameAs"},
"name": {"@id": "https://www.ica.org/standards/RiC/ontology#name"},
"performs": {
"@id": "https://www.ica.org/standards/RiC/ontology#performs",
"@type": "@id"
},
"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"
},
"regulates": {
"@id": "https://www.ica.org/standards/RiC/ontology#regulates",
"@type": "@id"
},
"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"
},
"physicalCharacteristics": {"@id": "https://www.ica.org/standards/RiC/ontology#physicalCharacteristics"},
"hasCarrierType": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasCarrierType",
"@type": "@id"
},
"P60558": {"@id": "http://rdaregistry.info/Elements/u/P60558"},
"instantiates": {
"@id": "https://www.ica.org/standards/RiC/ontology#instantiates",
"@type": "@id"
},
"hasDerivedInstantiation": {
"@id": "https://www.ica.org/standards/RiC/ontology#hasDerivedInstantiation",
"@type": "@id"
},
"resultsFrom": {
"@id": "https://www.ica.org/standards/RiC/ontology#resultsFrom",
"@type": "@id"
},
"isDerivedFromInstantiation": {
"@id": "https://www.ica.org/standards/RiC/ontology#isDerivedFromInstantiation",
"@type": "@id"
},
"normalizedDateValue": {"@id": "https://www.ica.org/standards/RiC/ontology#normalizedDateValue"},
"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"}
}
}
\ No newline at end of file
/*
* IIIF Manifest Creator
* Copyright (C) 2020 Memoriav
* rico2edm
* Copyright (C) 2021 UB Basel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
......
/*
* IIIF Manifest Creator
* Copyright (C) 2020 Memobase
* rico2edm
* Copyright (C) 2021 UB Basel
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
......@@ -14,15 +14,18 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
package ch.memobase
import ch.memobase.edm.EDM
import org.apache.kafka.streams.Topology
import org.apache.kafka.streams.scala.ImplicitConversions._
import org.apache.kafka.streams.scala.kstream.KStream
import org.apache.kafka.streams.scala.{StreamsBuilder, _}
import org.apache.logging.log4j.scala.Logging
import ch.memobase.edm.ExtractionResult
import scala.util.Try
......@@ -37,20 +40,22 @@ class KafkaTopology extends Logging {
reportingTopic: String
): Topology = {
val builder = new StreamsBuilder
val manifestBuilder = new Manifest
val edmBuilder = new EDM
val source = builder.stream[String, String](topicIn)
val Array(noDigitalObject, noLocator, noPhoto, isPhoto) = source
//val Array(noDigitalObject, noLocator, noPhoto, isPhoto) = source
//we have to discuss, which documents should be delivered to Europeana
val Array(noDigitalObject, noLocator, isEDMDeliverable) = source
.branch(
(_, v) => hasNoDigitalObject(v),
(_, v) => hasNoLocator(v),
(_, v) => isNotPhotography(v),
(_, _) => true
)
//noinspection ConvertibleToMethodValue
val Array(hasWarnings, hasManifest, noManifest) = isPhoto
.mapValues(manifestBuilder.create(_))
val Array(hasWarnings, isDeliverable, noEDM) = isEDMDeliverable
.mapValues(edmBuilder.create(_))
.branch(
(_, v) => v.isSuccess && v.get.warnings.nonEmpty,
(_, v) => v.isSuccess,
......@@ -58,16 +63,23 @@ class KafkaTopology extends Logging {
)
sendRecord(hasWarnings, topicOut)
sendRecord(hasManifest, topicOut)
sendRecord(isDeliverable, topicOut)
reportManifestCreationWarnings(hasWarnings, reportingTopic)
reportSuccessfulManifestCreation(hasManifest, reportingTopic)
reportManifestCreationFailure(noManifest, reportingTopic)
reportSuccessfulEDMCreation(isDeliverable, reportingTopic)
reportEDMCreationFailure(noEDM, reportingTopic)
/*
do we need this for EDM??
reportIgnoredRecord(
noLocator,
reportingTopic,
"Digital object has no locator"
)
*/
/*
reportIgnoredRecord(noPhoto, reportingTopic, "Resource is not an image")
reportIgnoredRecord(
noDigitalObject,
......@@ -75,6 +87,8 @@ class KafkaTopology extends Logging {
"Record has no digital object"
)
*/
builder.build()
}
......@@ -102,7 +116,7 @@ class KafkaTopology extends Logging {
)
.to(topicReport)
private def reportSuccessfulManifestCreation(
private def reportSuccessfulEDMCreation(
stream: KStream[String, Try[ExtractionResult[(String, String)]]],
topicReport: String
): Unit =
......@@ -113,13 +127,13 @@ class KafkaTopology extends Logging {
ReportingObject(
s"https://memobase.ch/record/$k",
ProcessingSuccess,
"IIIF manifest successfully created"
"EDM document for Europeana successfully created"
).toString
)
)
.to(topicReport)
private def reportManifestCreationFailure(
private def reportEDMCreationFailure(
stream: KStream[String, Try[ExtractionResult[(String, String)]]],
topicReport: String
): Unit =
......@@ -130,7 +144,7 @@ class KafkaTopology extends Logging {
ReportingObject(