Upgrade to new Gitlab Version 13.9 on Saturday 19th April 20:00. Expect an interruption of about 30 to 60 minutes

Commit 0d8ef216 authored by Jonas Waeber's avatar Jonas Waeber

Update tests.

Remove text field from record set.
Add handling for internal related record set.
parent c4f7bdb8
Pipeline #21839 passed with stages
in 4 minutes and 14 seconds
......@@ -60,7 +60,10 @@ class RdfTransformer(properties: Properties) {
resource.addProperty(RICO.identifiedBy, addIdentifier(model, Types.Identifier.main, input.field_memobase_id))
if (input.field_old_memobase_id != null)
resource.addProperty(RICO.identifiedBy, addIdentifier(model, Types.Identifier.oldMemobase, input.field_old_memobase_id))
resource.addProperty(
RICO.identifiedBy,
addIdentifier(model, Types.Identifier.oldMemobase, input.field_old_memobase_id)
)
input.recordset_ids.forEach {
resource.addProperty(RICO.isHolderOf, NS.mbrs + it)
......@@ -113,15 +116,6 @@ class RdfTransformer(properties: Properties) {
// Publikations Status
resource.addLiteral(MB.isPublished, input.status)
// Beschreibung
/* Not used in the metadata model.
addRichTextLiteralIfNotNull(
resource,
listOf(input.field_text_de, input.field_text_fr, input.field_text_it),
RICO.descriptiveNote
)
*/
// 0.1 Titel (Memobase)
addTitle(resource, model, Types.Title.main, listOf(input.title_de, input.title_fr, input.title_it))
// + convenience label on the resource directly.
......@@ -266,13 +260,34 @@ class RdfTransformer(properties: Properties) {
// 5.3 Verwandte Bestände (Titel)
// 5.4 Verwandte Bestände (Link)
input.field_related_record_sets_de.forEach { link ->
addRelatedRecordSet(resource, model, link, "de")
if (link.title == Util.internalRelatedRecordSet) {
resource.addProperty(
RICO.isRecordResourceAssociatedWithRecordResource,
model.createResource(NS.mbrs + link.uri)
)
} else {
addRelatedRecordSet(resource, model, link, "de")
}
}
input.field_related_record_sets_fr.forEach { link ->
addRelatedRecordSet(resource, model, link, "fr")
if (link.title == Util.internalRelatedRecordSet) {
resource.addProperty(
RICO.isRecordResourceAssociatedWithRecordResource,
model.createResource(NS.mbrs + link.uri)
)
} else {
addRelatedRecordSet(resource, model, link, "fr")
}
}
input.field_related_record_sets_it.forEach { link ->
addRelatedRecordSet(resource, model, link, "it")
if (link.title == Util.internalRelatedRecordSet) {
resource.addProperty(
RICO.isRecordResourceAssociatedWithRecordResource,
model.createResource(NS.mbrs + link.uri)
)
} else {
addRelatedRecordSet(resource, model, link, "it")
}
}
// Currently each publication link is added as a separate entity.
// 5.5 Publikationen (Titel)
......@@ -290,13 +305,34 @@ class RdfTransformer(properties: Properties) {
// 5.7 Dokumente (Titel)
// 5.8 Dokumente (Link)
input.field_documents_de.forEach { link ->
addRelatedRecord(resource, model, link, "de", RICO.isRecordResourceAssociatedWithRecordResource, Types.Record.related)
addRelatedRecord(
resource,
model,
link,
"de",
RICO.isRecordResourceAssociatedWithRecordResource,
Types.Record.related
)
}
input.field_documents_fr.forEach { link ->
addRelatedRecord(resource, model, link, "fr", RICO.isRecordResourceAssociatedWithRecordResource, Types.Record.related)
addRelatedRecord(
resource,
model,
link,
"fr",
RICO.isRecordResourceAssociatedWithRecordResource,
Types.Record.related
)
}
input.field_documents_it.forEach { link ->
addRelatedRecord(resource, model, link, "it", RICO.isRecordResourceAssociatedWithRecordResource, Types.Record.related)
addRelatedRecord(
resource,
model,
link,
"it",
RICO.isRecordResourceAssociatedWithRecordResource,
Types.Record.related
)
}
// 6.1 Datenübernahme
addRichTextLiteralIfNotNull(
......@@ -326,7 +362,10 @@ class RdfTransformer(properties: Properties) {
}
// 9.3 Alte Memobase ID
if (input.field_old_memobase_id != null)
resource.addProperty(RICO.identifiedBy, addIdentifier(model, Types.Identifier.oldMemobase, input.field_old_memobase_id))
resource.addProperty(
RICO.identifiedBy,
addIdentifier(model, Types.Identifier.oldMemobase, input.field_old_memobase_id)
)
log.info("Transformed record set ${resource.uri}.")
return Pair(resource.uri, model)
}
......@@ -380,6 +419,7 @@ class RdfTransformer(properties: Properties) {
node.addProperty(SCHEMA.sameAs, literal(link.uri))
resource.addProperty(RDA.hasSponsoringAgentOfResource, node)
}
private fun addRelatedRecordSet(resource: Resource, model: Model, link: Link, language: String) {
val node = model.createResource()
node.addProperty(RDF.type, RICO.RecordSet)
......@@ -391,7 +431,15 @@ class RdfTransformer(properties: Properties) {
node.addProperty(SCHEMA.sameAs, literal(link.uri))
resource.addProperty(RICO.isRecordResourceAssociatedWithRecordResource, node)
}
private fun addRelatedRecord(resource: Resource, model: Model, link: Link, language: String, property: Property, type: String) {
private fun addRelatedRecord(
resource: Resource,
model: Model,
link: Link,
language: String,
property: Property,
type: String
) {
val node = model.createResource()
node.addProperty(RDF.type, RICO.Record)
link.title.let {
......
......@@ -40,6 +40,11 @@ object Util {
const val drupalInstitutionTypeIdentifier = "node--institution"
const val drupalRecordSetTypeIdentifier = "node--record_set"
/**
* This constant is used to recognize if the related record set is a record set indexed in Memobase.
* The value is set to internal in the import-process-api monitoring endpoint.
*/
const val internalRelatedRecordSet = "internal"
val now: String = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)
private val log = LogManager.getLogger(this::class.java)
......
......@@ -72,10 +72,6 @@ data class RecordSet(
val field_original_id: String?,
/* 3.8 Bestandes Signatur */
val field_original_shelf_mark: String?,
/* 3.9 Beschreibung */
val field_text_de: RichText?,
val field_text_fr: RichText?,
val field_text_it: RichText?,
/* 3.9 Original Bestandesbeschreibung (Titel) */
/* 3.9.1 Original Bestandesbeschreibung (Link) */
val field_original_description_de: Link?,
......
......@@ -98,7 +98,7 @@ class TestInstitutions {
},
{
assertThat(key)
.isEqualTo("https://memobase.ch/institution/completeExampleTest")
.isEqualTo("https://memobase.ch/institution/completeInstitution")
}
)
}
......
{
"type": "node--institution",
"status": false,
"title_de": "Complete Example",
"title_fr": "Complete Example",
"title_it": "Complete Example",
"title_de": "Complete Institution (DE)",
"title_fr": "Complete Institution (FR)",
"title_it": "Complete Institution (IT)",
"field_address": [
{
"langcode": "",
......@@ -23,9 +23,9 @@
}
],
"field_isil": "ISIL-NUMBER",
"field_memobase_id": "completeExampleTest",
"field_memobase_id": "completeInstitution",
"field_old_memobase_id": "OLD_MEMOBASE_ID",
"field_email": "test@email.com",
"field_email": "test-institution@email.com",
"field_website": {
"uri": "https://website.com",
"title": "Website Title (DE)",
......@@ -53,10 +53,14 @@
"processed": "<p>Beschreibung (IT)</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"
},
"field_institution_types": [
"http://www.wikidata.org/wiki/Q591763",
"http://www.wikidata.org/wiki/Q15265344",
"http://www.wikidata.org/wiki/Q2029941"
],
"field_teaser_color": "#025200",
"recordset_ids": [
"testComplete"
],
"computed_teaser_image_url": "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2021-02/vitrine1_hero.jpg?itok=S-b5nq1p"
"computed_teaser_image_url": "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2021-02/vitrine1_hero.jpg?itok=S-b5nq1p",
"computed_teaser_color": "#303030"
}
\ No newline at end of file
<https://memobase.ch/institution/completeExampleTest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#CorporateBody> .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P18> "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2021-02/vitrine1_hero.jpg?itok=S-b5nq1p" .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P2699> "https://archive-online.com" .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q2029941> .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P791> "ISIL-NUMBER" .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P856> "https://website.com" .
<https://memobase.ch/institution/completeExampleTest> <http://www.wikidata.org/prop/direct/P968> "test@email.com" .
<https://memobase.ch/institution/completeExampleTest> <https://memobase.ch/internal/isPublished> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (DE)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@de .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (FR)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@fr .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (IT)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@it .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#hasLocation> _:B .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#isHolderOf> "https://memobase.ch/recordSet/testComplete" .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#name> "Complete Example"@de .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#name> "Complete Example"@fr .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#name> "Complete Example"@it .
<https://memobase.ch/institution/completeExampleTest> <https://www.ica.org/standards/RiC/ontology#type> "memobaseInstitution" .
<https://memobase.ch/institution/completeInstitution> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#CorporateBody> .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P18> "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2021-02/vitrine1_hero.jpg?itok=S-b5nq1p" .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P2699> "https://archive-online.com" .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q15265344> .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q2029941> .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P31> <http://www.wikidata.org/entity/Q591763> .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P791> "ISIL-NUMBER" .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P856> "https://website.com" .
<https://memobase.ch/institution/completeInstitution> <http://www.wikidata.org/prop/direct/P968> "test-institution@email.com" .
<https://memobase.ch/institution/completeInstitution> <https://memobase.ch/internal/isPublished> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (DE)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@de .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (FR)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@fr .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#descriptiveNote> "<p>Beschreibung (IT)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@it .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#hasLocation> _:B .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#identifiedBy> _:B .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#isHolderOf> "https://memobase.ch/recordSet/testComplete" .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#name> "Complete Institution (DE)"@de .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#name> "Complete Institution (FR)"@fr .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#name> "Complete Institution (IT)"@it .
<https://memobase.ch/institution/completeInstitution> <https://www.ica.org/standards/RiC/ontology#type> "memobaseInstitution" .
_:B <http://schema.org/sameAs> "http://www.wikidata.org/entity/Q11972" .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
_:B <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.ica.org/standards/RiC/ontology#Identifier> .
......@@ -32,7 +34,7 @@ _:B <http://www.wikidata.org/prop/direct/P6375> "Street Address" .
_:B <http://www.wikidata.org/prop/direct/P669> "Street" .
_:B <http://www.wikidata.org/prop/direct/P670> "Address" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "OLD_MEMOBASE_ID" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "completeExampleTest" .
_:B <https://www.ica.org/standards/RiC/ontology#identifier> "completeInstitution" .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Aargau"@de .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Argovia"@it .
_:B <https://www.ica.org/standards/RiC/ontology#name> "Argovie"@fr .
......
......@@ -22,16 +22,16 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
mbcb:completeExampleTest
mbcb:completeInstitution
a rico:CorporateBody ;
wdt:P18 "https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2021-02/vitrine1_hero.jpg?itok=S-b5nq1p" ;
wdt:P2699 "https://archive-online.com" ;
wdt:P31 wd:Q2029941 ;
wdt:P31 wd:Q15265344 , wd:Q2029941 , wd:Q591763 ;
wdt:P791 "ISIL-NUMBER" ;
wdt:P856 "https://website.com" ;
wdt:P968 "test@email.com" ;
wdt:P968 "test-institution@email.com" ;
internal:isPublished false ;
rico:descriptiveNote "<p>Beschreibung (DE)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@de , "<p>Beschreibung (IT)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@it , "<p>Beschreibung (FR)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@fr ;
rico:descriptiveNote "<p>Beschreibung (FR)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@fr , "<p>Beschreibung (IT)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@it , "<p>Beschreibung (DE)</p>\r\n\r\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>"@de ;
rico:hasLocation [ a rico:Place ;
wdt:P131 [ a rico:Place ;
schema:sameAs "http://www.wikidata.org/entity/Q11972" ;
......@@ -54,9 +54,9 @@ mbcb:completeExampleTest
rico:type "oldMemobase"
] ;
rico:identifiedBy [ a rico:Identifier ;
rico:identifier "completeExampleTest" ;
rico:identifier "completeInstitution" ;
rico:type "main"
] ;
rico:isHolderOf "https://memobase.ch/recordSet/testComplete" ;
rico:name "Complete Example"@de , "Complete Example"@fr , "Complete Example"@it ;
rico:name "Complete Institution (FR)"@fr , "Complete Institution (IT)"@it , "Complete Institution (DE)"@de ;
rico:type "memobaseInstitution" .
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